Author: pschweitzer
Date: Sat Jun 27 13:40:05 2015
New Revision: 68290
URL:
http://svn.reactos.org/svn/reactos?rev=68290&view=rev
Log:
[NTFS]
While handling IRP_MN_QUERY_DIRECTORY, in case there is no $FILE_NAME attribute, dump file
attributes & MFT ID.
This fixes ASSERT failure when browsing some Win7 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] Sat Jun 27 13:40:05 2015
@@ -38,6 +38,7 @@
static NTSTATUS
NtfsGetNameInformation(PDEVICE_EXTENSION DeviceExt,
PFILE_RECORD_HEADER FileRecord,
+ ULONGLONG MFTIndex,
PFILE_NAMES_INFORMATION Info,
ULONG BufferLength)
{
@@ -47,7 +48,12 @@
DPRINT("NtfsGetNameInformation() called\n");
FileName = GetBestFileNameFromRecord(FileRecord);
- ASSERT(FileName != NULL);
+ if (FileName == NULL)
+ {
+ DPRINT1("No name information for file ID: %#I64x\n", MFTIndex);
+ NtfsDumpFileAttributes(FileRecord);
+ return STATUS_OBJECT_NAME_NOT_FOUND;
+ }
Length = FileName->NameLength * sizeof (WCHAR);
if ((sizeof(FILE_NAMES_INFORMATION) + Length) > BufferLength)
@@ -76,7 +82,12 @@
DPRINT("NtfsGetDirectoryInformation() called\n");
FileName = GetBestFileNameFromRecord(FileRecord);
- ASSERT(FileName != NULL);
+ if (FileName == NULL)
+ {
+ DPRINT1("No name information for file ID: %#I64x\n", MFTIndex);
+ NtfsDumpFileAttributes(FileRecord);
+ return STATUS_OBJECT_NAME_NOT_FOUND;
+ }
StdInfo = GetStandardInformationFromRecord(FileRecord);
ASSERT(StdInfo != NULL);
@@ -121,7 +132,12 @@
DPRINT("NtfsGetFullDirectoryInformation() called\n");
FileName = GetBestFileNameFromRecord(FileRecord);
- ASSERT(FileName != NULL);
+ if (FileName == NULL)
+ {
+ DPRINT1("No name information for file ID: %#I64x\n", MFTIndex);
+ NtfsDumpFileAttributes(FileRecord);
+ return STATUS_OBJECT_NAME_NOT_FOUND;
+ }
StdInfo = GetStandardInformationFromRecord(FileRecord);
ASSERT(StdInfo != NULL);
@@ -167,7 +183,12 @@
DPRINT("NtfsGetBothDirectoryInformation() called\n");
FileName = GetBestFileNameFromRecord(FileRecord);
- ASSERT(FileName != NULL);
+ if (FileName == NULL)
+ {
+ DPRINT1("No name information for file ID: %#I64x\n", MFTIndex);
+ NtfsDumpFileAttributes(FileRecord);
+ return STATUS_OBJECT_NAME_NOT_FOUND;
+ }
ShortFileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS);
StdInfo = GetStandardInformationFromRecord(FileRecord);
@@ -332,6 +353,7 @@
case FileNameInformation:
Status = NtfsGetNameInformation(DeviceExtension,
FileRecord,
+ MFTRecord,
(PFILE_NAMES_INFORMATION)Buffer,
BufferLength);
break;