Author: pschweitzer
Date: Tue Nov 4 07:52:14 2014
New Revision: 65239
URL:
http://svn.reactos.org/svn/reactos?rev=65239&view=rev
Log:
[NTFS]
Try to read the names from the biggest name space to the smallest.
Only at the end assert we have to have a name.
This fixes name enumeration on Windows 7 NTFS volumes.
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/d…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] Tue Nov 4 07:52:14 2014
@@ -137,7 +137,15 @@
DPRINT("NtfsGetNameInformation() called\n");
- FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_POSIX);
+ if (FileName == NULL)
+ {
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
+ if (FileName == NULL)
+ {
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS);
+ }
+ }
ASSERT(FileName != NULL);
Length = FileName->NameLength * sizeof (WCHAR);
@@ -165,7 +173,15 @@
DPRINT("NtfsGetDirectoryInformation() called\n");
- FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_POSIX);
+ if (FileName == NULL)
+ {
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
+ if (FileName == NULL)
+ {
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS);
+ }
+ }
ASSERT(FileName != NULL);
Length = FileName->NameLength * sizeof (WCHAR);
@@ -206,7 +222,15 @@
DPRINT("NtfsGetFullDirectoryInformation() called\n");
- FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_POSIX);
+ if (FileName == NULL)
+ {
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
+ if (FileName == NULL)
+ {
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS);
+ }
+ }
ASSERT(FileName != NULL);
Length = FileName->NameLength * sizeof (WCHAR);
@@ -248,7 +272,15 @@
DPRINT("NtfsGetBothDirectoryInformation() called\n");
- FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_POSIX);
+ if (FileName == NULL)
+ {
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
+ if (FileName == NULL)
+ {
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS);
+ }
+ }
ASSERT(FileName != NULL);
ShortFileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS);