Dump available streams (if any!) in case unnamed stream isn't available when trying to read a file

svn path=/trunk/; revision=68286
This commit is contained in:
Pierre Schweitzer 2015-06-27 09:04:39 +00:00
parent 950f284f09
commit fc363d1f59

View file

@ -123,7 +123,28 @@ NtfsReadFile(PDEVICE_EXTENSION DeviceExt,
Status = FindAttribute(DeviceExt, FileRecord, AttributeData, L"", 0, &DataContext);
if (!NT_SUCCESS(Status))
{
DPRINT1("No data associated with file!\n");
PNTFS_ATTR_RECORD Attribute;
DPRINT1("No unnamed data stream associated with file!\n");
Attribute = (PNTFS_ATTR_RECORD)((ULONG_PTR)FileRecord + FileRecord->AttributeOffset);
while (Attribute < (PNTFS_ATTR_RECORD)((ULONG_PTR)FileRecord + FileRecord->BytesInUse) &&
Attribute->Type != AttributeEnd)
{
if (Attribute->Type == AttributeData)
{
UNICODE_STRING Name;
ASSERT(Attribute->NameLength != 0);
Name.Length = Attribute->NameLength * sizeof(WCHAR);
Name.MaximumLength = Name.Length;
Name.Buffer = (PWCHAR)((ULONG_PTR)Attribute + Attribute->NameOffset);
DPRINT1("Data stream: '%wZ' available\n", &Name);
}
Attribute = (PNTFS_ATTR_RECORD)((ULONG_PTR)Attribute + Attribute->Length);
}
ExFreePoolWithTag(FileRecord, TAG_NTFS);
if (AllocatedBuffer)
{