[NTFS] - Fix AddFileName() when the file path is two or more directories deep.
authorTrevor Thompson <tmt256@email.vccs.edu>
Tue, 4 Jul 2017 20:47:06 +0000 (20:47 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 10 Dec 2017 10:14:47 +0000 (11:14 +0100)
svn path=/branches/GSoC_2016/NTFS/; revision=75277

drivers/filesystems/ntfs/attrib.c

index 239e1c0..4fece45 100644 (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);