Index: ntoskrnl/config/cmindex.c
===================================================================
--- ntoskrnl/config/cmindex.c	(revision 64090)
+++ ntoskrnl/config/cmindex.c	(working copy)
@@ -24,6 +24,15 @@
                     sizeof(HCELL) +
                     FIELD_OFFSET(CM_KEY_INDEX, List))) / sizeof(HCELL_INDEX) - 1;
 
+/* PROTOS ********************************************************************/
+
+ULONG
+NTAPI
+CmpFindSubKeyInLeaf(IN PHHIVE Hive,
+                    IN PCM_KEY_INDEX Index,
+                    IN PCUNICODE_STRING SearchName,
+                    IN PHCELL_INDEX SubKey);
+
 /* FUNCTIONS *****************************************************************/
 
 LONG
@@ -174,6 +183,7 @@
                    (Leaf->Signature == CM_KEY_HASH_LEAF));
             ASSERT(Leaf->Count != 0);
 
+#ifdef SOMEONE_WAS_NICE_ENOUGH_TO_MAKE_OUR_CELLS_LEXICALLY_SORTED
             /* Do the compare */
             Result = CmpCompareInIndex(Hive,
                                        SearchName,
@@ -181,7 +191,18 @@
                                        Leaf,
                                        SubKey);
             if (Result == 2) goto Big;
+#else
+            *SubKey = HCELL_NIL;
+            Result = CmpFindSubKeyInLeaf(Hive,
+                                         Leaf,
+                                         SearchName,
+                                         SubKey);
 
+            /* Result should be 0 when the name was found */
+            if (*SubKey != HCELL_NIL) Result = 0;
+            else Result = !0;
+#endif
+
             /* Check if we found the leaf */
             if (!Result)
             {
@@ -240,8 +261,10 @@
             goto ReturnFailure;
         }
 
+#ifdef SOMEONE_WAS_NICE_ENOUGH_TO_MAKE_OUR_CELLS_LEXICALLY_SORTED
         /* Check if there is only one entry left */
         if ((High - Low) <= 1) break;
+#endif
 
         /* Release the leaf cell */
         HvReleaseCell(Hive, LeafCell);
@@ -1839,7 +1862,7 @@
         /* Find the child inside the root */
         RootIndex = CmpFindSubKeyInRoot(Hive, Leaf, &SearchName, &ChildCell);
         if (RootIndex & 0x80000000) goto Exit;
-        ASSERT(ChildCell != FALSE);
+        ASSERT(ChildCell != HCELL_NIL);
 
         /* The root cell is now this leaf */
         Root = Leaf;
