From a9b289888e154e055eca1ce2f87074e7a0138bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Mon, 22 Sep 2014 07:43:06 +0000 Subject: [PATCH] [NTOS/CM] - Return the right index when the root subleaf is found. - Let's pretend I was nice enough to make the cells lexically sorted when in fact I just corrected a stupid binary search. WARNING: this breaks ntoskrnl reading hive files produced before this revision. Sorry, this is a breaking change. CORE-8524 #comment Committed, let's see what happens in the next days. svn path=/trunk/; revision=64222 --- reactos/ntoskrnl/config/cmindex.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/config/cmindex.c b/reactos/ntoskrnl/config/cmindex.c index ace3b54e79a..7975bf98ebf 100644 --- a/reactos/ntoskrnl/config/cmindex.c +++ b/reactos/ntoskrnl/config/cmindex.c @@ -12,6 +12,8 @@ #define NDEBUG #include "debug.h" +#define SOMEONE_WAS_NICE_ENOUGH_TO_MAKE_OUR_CELLS_LEXICALLY_SORTED + /* GLOBALS *******************************************************************/ ULONG CmpMaxFastIndexPerHblock = @@ -218,7 +220,7 @@ CmpFindSubKeyInRoot(IN PHHIVE Hive, /* Return it */ *SubKey = LeafCell; - ReturnIndex = Low; + ReturnIndex = i; goto Return; }