https://git.reactos.org/?p=reactos.git;a=commitdiff;h=612facc28fb9e0bc15cb7…
commit 612facc28fb9e0bc15cb759abda871b8f7478477
Author: Trevor Thompson <tmt256(a)email.vccs.edu>
AuthorDate: Tue Jul 4 20:47:06 2017 +0000
[NTFS] - Fix AddFileName() when the file path is two or more directories deep.
svn path=/branches/GSoC_2016/NTFS/; revision=75277
---
drivers/filesystems/ntfs/attrib.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/filesystems/ntfs/attrib.c b/drivers/filesystems/ntfs/attrib.c
index 239e1c0400..4fece45c6c 100644
--- a/drivers/filesystems/ntfs/attrib.c
+++ b/drivers/filesystems/ntfs/attrib.c
@@ -146,7 +146,7 @@ AddFileName(PFILE_RECORD_HEADER FileRecord,
ULONGLONG CurrentMFTIndex = NTFS_FILE_ROOT;
UNICODE_STRING Current, Remaining, FilenameNoPath;
NTSTATUS Status = STATUS_SUCCESS;
- ULONG FirstEntry = 0;
+ ULONG FirstEntry;
WCHAR Buffer[MAX_PATH];
if (AttributeAddress->Type != AttributeEnd)
@@ -183,6 +183,7 @@ AddFileName(PFILE_RECORD_HEADER FileRecord,
if(Remaining.Length != 0)
RtlCopyUnicodeString(&FilenameNoPath, &Remaining);
+ FirstEntry = 0;
Status = NtfsFindMftRecord(DeviceExt,
CurrentMFTIndex,
&Current,
@@ -200,7 +201,7 @@ AddFileName(PFILE_RECORD_HEADER FileRecord,
break;
}
- FsRtlDissectName(Current, &Current, &Remaining);
+ FsRtlDissectName(Remaining, &Current, &Remaining);
}
DPRINT1("MFT Index of parent: %I64u\n", CurrentMFTIndex);