[NTFS] - Fix AddFileName() when the file path is two or more directories deep.

svn path=/branches/GSoC_2016/NTFS/; revision=75277
This commit is contained in:
Trevor Thompson 2017-07-04 20:47:06 +00:00 committed by Thomas Faber
parent 16204ed3a7
commit 612facc28f

View file

@ -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);