Author: pschweitzer
Date: Sun Oct 19 16:29:38 2014
New Revision: 64825

URL: http://svn.reactos.org/svn/reactos?rev=64825&view=rev
Log:
[NTFS]
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.

Modified:
    trunk/reactos/drivers/filesystems/ntfs/dirctl.c

Modified: trunk/reactos/drivers/filesystems/ntfs/dirctl.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/dirctl.c?rev=64825&r1=64824&r2=64825&view=diff
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/dirctl.c     [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/dirctl.c     [iso-8859-1] Sun Oct 19 
16:29:38 2014
@@ -138,7 +138,7 @@
     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 @@
     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 @@
     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 @@
     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);
 


Reply via email to