[ros-diffs] [mjmartin] 44481: [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.

mjmartin at svn.reactos.org mjmartin at svn.reactos.org
Wed Dec 9 15:15:11 CET 2009


Author: mjmartin
Date: Wed Dec  9 15:15:11 2009
New Revision: 44481

URL: http://svn.reactos.org/svn/reactos?rev=44481&view=rev
Log:
[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.

Modified:
    trunk/reactos/ntoskrnl/config/cmindex.c

Modified: trunk/reactos/ntoskrnl/config/cmindex.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmindex.c?rev=44481&r1=44480&r2=44481&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmindex.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmindex.c [iso-8859-1] Wed Dec  9 15:15:11 2009
@@ -1289,14 +1289,13 @@
                       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 */




More information about the Ros-diffs mailing list