[NTFS]
authorPierre Schweitzer <pierre@reactos.org>
Sun, 19 Oct 2014 16:29:38 +0000 (16:29 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 19 Oct 2014 16:29:38 +0000 (16:29 +0000)
Bugfixing... Part 6/X:
- Properly compute file name length.

This makes directory enumeration return complete file/directory names.
Note that it's also possible to enumerate the files in open dialog of notepad (for instance :-))

Opening a subdirectory/file is broken though. To be investigated.

svn path=/trunk/; revision=64825

reactos/drivers/filesystems/ntfs/dirctl.c

index cd90222..28c1877 100644 (file)
@@ -138,7 +138,7 @@ NtfsGetNameInformation(PDEVICE_EXTENSION DeviceExt,
     FileName = GetFileNameFromRecord(FileRecord);
     ASSERT(FileName != NULL);
 
-    Length = FileName->NameLength;
+    Length = FileName->NameLength * sizeof (WCHAR);
     if ((sizeof(FILE_NAMES_INFORMATION) + Length) > BufferLength)
         return(STATUS_BUFFER_OVERFLOW);
 
@@ -166,7 +166,7 @@ NtfsGetDirectoryInformation(PDEVICE_EXTENSION DeviceExt,
     FileName = GetFileNameFromRecord(FileRecord);
     ASSERT(FileName != NULL);
 
-    Length = FileName->NameLength;
+    Length = FileName->NameLength * sizeof (WCHAR);
     if ((sizeof(FILE_DIRECTORY_INFORMATION) + Length) > BufferLength)
         return(STATUS_BUFFER_OVERFLOW);
 
@@ -208,7 +208,7 @@ NtfsGetFullDirectoryInformation(PDEVICE_EXTENSION DeviceExt,
     FileName = GetFileNameFromRecord(FileRecord);
     ASSERT(FileName != NULL);
 
-    Length = FileName->NameLength;
+    Length = FileName->NameLength * sizeof (WCHAR);
     if ((sizeof(FILE_FULL_DIRECTORY_INFORMATION) + Length) > BufferLength)
         return(STATUS_BUFFER_OVERFLOW);
 
@@ -251,7 +251,7 @@ NtfsGetBothDirectoryInformation(PDEVICE_EXTENSION DeviceExt,
     FileName = GetFileNameFromRecord(FileRecord);
     ASSERT(FileName != NULL);
 
-    Length = FileName->NameLength;
+    Length = FileName->NameLength * sizeof (WCHAR);
     if ((sizeof(FILE_BOTH_DIR_INFORMATION) + Length) > BufferLength)
         return(STATUS_BUFFER_OVERFLOW);