Author: hpoussin
Date: Sun Oct 26 19:10:04 2014
New Revision: 65026
URL:
http://svn.reactos.org/svn/reactos?rev=65026&view=rev
Log:
[NTFS] Correctly read indexes
This fixes (at least) an infinite loop when trying to mount some partitions.
Modified:
trunk/reactos/drivers/filesystems/ntfs/mft.c
Modified: trunk/reactos/drivers/filesystems/ntfs/mft.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/m…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/mft.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/mft.c [iso-8859-1] Sun Oct 26 19:10:04 2014
@@ -631,9 +631,9 @@
IndexBuffer = (PINDEX_BUFFER)IndexRecord;
ASSERT(IndexBuffer->Ntfs.Type == 'XDNI');
ASSERT(IndexBuffer->Header.AllocatedSize + 0x18 == IndexBlockSize);
- IndexEntry = (PINDEX_ENTRY_ATTRIBUTE)(&IndexBuffer->Header +
IndexBuffer->Header.FirstEntryOffset);
- IndexEntryEnd = (PINDEX_ENTRY_ATTRIBUTE)(&IndexBuffer->Header +
IndexBuffer->Header.TotalSizeOfEntries);
- //ASSERT(IndexEntryEnd <=
(PINDEX_ENTRY_ATTRIBUTE)((ULONG_PTR)IndexBuffer + IndexBlockSize)); FIXME: Why doesn't
it work?
+ IndexEntry =
(PINDEX_ENTRY_ATTRIBUTE)((ULONG_PTR)&IndexBuffer->Header +
IndexBuffer->Header.FirstEntryOffset);
+ IndexEntryEnd =
(PINDEX_ENTRY_ATTRIBUTE)((ULONG_PTR)&IndexBuffer->Header +
IndexBuffer->Header.TotalSizeOfEntries);
+ ASSERT(IndexEntryEnd <=
(PINDEX_ENTRY_ATTRIBUTE)((ULONG_PTR)IndexBuffer + IndexBlockSize));
while (IndexEntry < IndexEntryEnd &&
!(IndexEntry->Flags & NTFS_INDEX_ENTRY_END))
@@ -653,6 +653,7 @@
}
++CurrentEntry;
+ ASSERT(IndexEntry->Length >= sizeof(INDEX_ENTRY_ATTRIBUTE));
IndexEntry = (PINDEX_ENTRY_ATTRIBUTE)((PCHAR)IndexEntry +
IndexEntry->Length);
}