[ntoskrnl/config]

- CmpFindSubKeyInName: CmpFindSubKeyInRoot is useless in finding the correct leaf with the key name that is being searched for when keys are not sorted. Loop and search each leaf of the root index for the key name. See bug #4895 for more info.

svn path=/trunk/; revision=44303
This commit is contained in:
Michael Martin 2009-11-28 14:54:34 +00:00
parent 911304e174
commit 3ba0c60504

View file

@ -733,6 +733,33 @@ CmpFindSubKeyByName(IN PHHIVE Hive,
/* Check if this is another index root */
if (IndexRoot->Signature == CM_KEY_INDEX_ROOT)
{
#ifndef SOMEONE_WAS_NICE_ENOUGH_TO_MAKE_OUR_CELLS_LEXICALLY_SORTED
/* CmpFindSubKeyInRoot is useless for actually finding the correct leaf when keys are not sorted */
LONG ii;
PCM_KEY_INDEX Leaf;
/* Loop through each leaf in the index root */
for (ii=0; ii<IndexRoot->Count; ii++)
{
Leaf = HvGetCell(Hive, IndexRoot->List[ii]);
if (Leaf)
{
Found = CmpFindSubKeyInLeaf(Hive, Leaf, SearchName, &SubKey);
HvReleaseCell(Hive, IndexRoot->List[ii]);
if (Found & 0x80000000)
{
HvReleaseCell(Hive, CellToRelease);
return HCELL_NIL;
}
if ((Found) && (SubKey != HCELL_NIL))
{
HvReleaseCell(Hive, CellToRelease);
return SubKey;
}
}
}
#endif
/* Lookup the name in the root */
Found = CmpFindSubKeyInRoot(Hive,
IndexRoot,