[NTFS]
authorPierre Schweitzer <pierre@reactos.org>
Tue, 4 Nov 2014 21:16:14 +0000 (21:16 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Tue, 4 Nov 2014 21:16:14 +0000 (21:16 +0000)
Actually, we know how to read non resident attributes, so read a non resident attribute list if found.

svn path=/trunk/; revision=65257

reactos/drivers/filesystems/ntfs/mft.c

index 820cfa4..f91e67b 100644 (file)
@@ -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;
                 }
             }
         }