[ntoskrnl\config]

- CmpSplitLeaf: When the leaf to insert is not the last leaf: Don't copy the leaf data from the location where the new leaf will be inserted to the next leaf. 
There may be more leafs following (registry corruption), the leafs may be different sizes (memory corruption) and a simpler solution exists.
- Just shift all the indexes of the root to the right of the insertion point.
- Fixes bug check when leafs are split more than once.

svn path=/trunk/; revision=44469
This commit is contained in:
Michael Martin 2009-12-08 16:04:03 +00:00
parent 8d819f40bb
commit 35d2322f26

View file

@ -1289,13 +1289,14 @@ CmpSplitLeaf(IN PHHIVE Hive,
LastHalf * EntrySize);
}
/* Shift the data inside the root key */
/* If RootSelect is not the last index */
if (RootSelect < (IndexKey->Count - 1))
{
RtlMoveMemory(&IndexKey->List[RootSelect + 2],
&IndexKey->List[RootSelect + 1],
IndexKey->Count -
(RootSelect + 1) * sizeof(HCELL_INDEX));
/* Shift indexes to the right */
ULONG IndexCount;
/* IndexKey->Count will be incremented below */
for (IndexCount = IndexKey->Count; IndexCount > RootSelect + 1; IndexCount --)
IndexKey->List[IndexCount] = IndexKey->List[IndexCount -1];
}
/* Make sure both old and new computed counts are valid */