From 81125deea08275d6f2d06868645287a8cb628250 Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Wed, 9 Dec 2009 14:15:11 +0000 Subject: [PATCH] [ntoskrnl\config] - Description of what previous code was doing in commit r44469 was completely incorrect. Source prior to r44469 was only missing parentheses. - CmpSplitLeaf: Revert back to previous code with correct fix. Fireballs code was correct, and because I found it before him I save myself from a severe lashing. svn path=/trunk/; revision=44481 --- reactos/ntoskrnl/config/cmindex.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/reactos/ntoskrnl/config/cmindex.c b/reactos/ntoskrnl/config/cmindex.c index 5b105bd59b4..6cc3b75f195 100644 --- a/reactos/ntoskrnl/config/cmindex.c +++ b/reactos/ntoskrnl/config/cmindex.c @@ -1289,14 +1289,13 @@ CmpSplitLeaf(IN PHHIVE Hive, LastHalf * EntrySize); } - /* If RootSelect is not the last index */ + /* Shift the data inside the root key */ if (RootSelect < (IndexKey->Count - 1)) { - /* 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]; + RtlMoveMemory(&IndexKey->List[RootSelect + 2], + &IndexKey->List[RootSelect + 1], + (IndexKey->Count - + (RootSelect + 1)) * sizeof(HCELL_INDEX)); } /* Make sure both old and new computed counts are valid */