static NTSTATUS
NtfsGetNameInformation(PDEVICE_EXTENSION DeviceExt,
PFILE_RECORD_HEADER FileRecord,
+ ULONGLONG MFTIndex,
PFILE_NAMES_INFORMATION Info,
ULONG BufferLength)
{
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)
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);
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);
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);
case FileNameInformation:
Status = NtfsGetNameInformation(DeviceExtension,
FileRecord,
+ MFTRecord,
(PFILE_NAMES_INFORMATION)Buffer,
BufferLength);
break;