From: Pierre Schweitzer Date: Tue, 4 Nov 2014 21:16:14 +0000 (+0000) Subject: [NTFS] X-Git-Tag: backups/tcpip_revolution@71025~91 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=71606f1035c434bdc3214eef999cdb3b9ba5e55a;ds=sidebyside [NTFS] Actually, we know how to read non resident attributes, so read a non resident attribute list if found. svn path=/trunk/; revision=65257 --- diff --git a/reactos/drivers/filesystems/ntfs/mft.c b/reactos/drivers/filesystems/ntfs/mft.c index 820cfa41dd8..f91e67b719c 100644 --- a/reactos/drivers/filesystems/ntfs/mft.c +++ b/reactos/drivers/filesystems/ntfs/mft.c @@ -105,44 +105,35 @@ FindAttributeHelper(PDEVICE_EXTENSION Vcb, PNTFS_ATTR_RECORD ListAttrRecord; PNTFS_ATTR_RECORD ListAttrRecordEnd; - // Do not handle non-resident yet - if (AttrRecord->IsNonResident) + ListContext = PrepareAttributeContext(AttrRecord); + + ListSize = AttributeDataLength(&ListContext->Record); + if(ListSize <= 0xFFFFFFFF) + ListBuffer = ExAllocatePoolWithTag(NonPagedPool, (ULONG)ListSize, TAG_NTFS); + else + ListBuffer = NULL; + + if(!ListBuffer) { - UNIMPLEMENTED; + DPRINT("Failed to allocate memory: %x\n", (ULONG)ListSize); continue; } - else - { - ListContext = PrepareAttributeContext(AttrRecord); - ListSize = AttributeDataLength(&ListContext->Record); - if(ListSize <= 0xFFFFFFFF) - ListBuffer = ExAllocatePoolWithTag(NonPagedPool, (ULONG)ListSize, TAG_NTFS); - else - ListBuffer = NULL; + ListAttrRecord = (PNTFS_ATTR_RECORD)ListBuffer; + ListAttrRecordEnd = (PNTFS_ATTR_RECORD)((PCHAR)ListBuffer + ListSize); - if(!ListBuffer) - { - DPRINT("Failed to allocate memory: %x\n", (ULONG)ListSize); - continue; - } + if (ReadAttribute(Vcb, ListContext, 0, ListBuffer, (ULONG)ListSize) == ListSize) + { + Context = FindAttributeHelper(Vcb, ListAttrRecord, ListAttrRecordEnd, + Type, Name, NameLength); - ListAttrRecord = (PNTFS_ATTR_RECORD)ListBuffer; - ListAttrRecordEnd = (PNTFS_ATTR_RECORD)((PCHAR)ListBuffer + ListSize); + ReleaseAttributeContext(ListContext); + ExFreePoolWithTag(ListBuffer, TAG_NTFS); - if (ReadAttribute(Vcb, ListContext, 0, ListBuffer, (ULONG)ListSize) == ListSize) + if (Context != NULL) { - Context = FindAttributeHelper(Vcb, ListAttrRecord, ListAttrRecordEnd, - Type, Name, NameLength); - - ReleaseAttributeContext(ListContext); - ExFreePoolWithTag(ListBuffer, TAG_NTFS); - - if (Context != NULL) - { - DPRINT("Found context = %p\n", Context); - return Context; - } + if (AttrRecord->IsNonResident) DPRINT("Found context = %p\n", Context); + return Context; } } }