https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9dce6f4db1ec015588ccf7...
commit 9dce6f4db1ec015588ccf7d5657693d5a0697390 Author: Trevor Thompson tmt256@email.vccs.edu AuthorDate: Fri Jun 16 05:42:01 2017 +0000
[NTFS] - Add some improvements to the previous commit, as suggested by Thomas.
svn path=/branches/GSoC_2016/NTFS/; revision=75054 --- drivers/filesystems/ntfs/attrib.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/filesystems/ntfs/attrib.c b/drivers/filesystems/ntfs/attrib.c index eeed58104e..78be3ecf3c 100644 --- a/drivers/filesystems/ntfs/attrib.c +++ b/drivers/filesystems/ntfs/attrib.c @@ -167,9 +167,7 @@ AddFileName(PFILE_RECORD_HEADER FileRecord, // we need to extract the filename from the path DPRINT1("Pathname: %wZ\n", &FileObject->FileName);
- RtlZeroMemory(&FilenameNoPath, sizeof(UNICODE_STRING)); - FilenameNoPath.Buffer = Buffer; - FilenameNoPath.MaximumLength = MAX_PATH; + RtlInitEmptyUnicodeString(&FilenameNoPath, Buffer, MAX_PATH);
FsRtlDissectName(FileObject->FileName, &Current, &Remaining);
@@ -210,7 +208,7 @@ AddFileName(PFILE_RECORD_HEADER FileRecord,
DPRINT1("FileNameAttribute->DirectoryFileReferenceNumber: 0x%016I64x\n", FileNameAttribute->DirectoryFileReferenceNumber);
- FileNameAttribute->NameLength = FilenameNoPath.Length / 2; + FileNameAttribute->NameLength = FilenameNoPath.Length / sizeof(WCHAR); // TODO: Get proper nametype, add DOS links as needed FileNameAttribute->NameType = NTFS_FILE_NAME_WIN32_AND_DOS; RtlCopyMemory(FileNameAttribute->Name, FilenameNoPath.Buffer, FilenameNoPath.Length);