From 81ef13c4a1bc96eca00a102bf4a5c86c387d8576 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Thu, 20 Sep 2007 10:36:36 +0000 Subject: [PATCH] - Implement a fast->slow leaf conversion (this assert was hit by OO.o setup) svn path=/trunk/; revision=29114 --- reactos/ntoskrnl/config/cmindex.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/reactos/ntoskrnl/config/cmindex.c b/reactos/ntoskrnl/config/cmindex.c index 0bce3d5e24c..5e80926cf04 100644 --- a/reactos/ntoskrnl/config/cmindex.c +++ b/reactos/ntoskrnl/config/cmindex.c @@ -1125,10 +1125,11 @@ CmpAddSubKey(IN PHHIVE Hive, { PCM_KEY_NODE KeyNode; PCM_KEY_INDEX Index; + PCM_KEY_FAST_INDEX OldIndex; UNICODE_STRING Name; HCELL_INDEX IndexCell = HCELL_NIL, CellToRelease = HCELL_NIL, LeafCell; PHCELL_INDEX RootPointer = NULL; - ULONG Type; + ULONG Type, i; BOOLEAN IsCompressed; PAGED_CODE(); @@ -1245,9 +1246,21 @@ CmpAddSubKey(IN PHHIVE Hive, if ((Index->Signature == CM_KEY_FAST_LEAF) && (Index->Count >= CmpMaxFastIndexPerHblock)) { - /* Not handled yet */ - DPRINT1("Fast->Slow Leaf Conversion not yet implemented!\n"); - ASSERT(FALSE); + DPRINT("Doing Fast->Slow Leaf conversion\n"); + + /* Mark this cell as dirty */ + HvMarkCellDirty(Hive, CellToRelease); + + /* Convert */ + OldIndex = (PCM_KEY_FAST_INDEX)Index; + + for (i=0; i < OldIndex->Count; i++) + { + Index->List[i] = OldIndex->List[i].Cell; + } + + /* Set the new type value */ + Index->Signature = CM_KEY_INDEX_LEAF; } else if (((Index->Signature == CM_KEY_INDEX_LEAF) || (Index->Signature == CM_KEY_HASH_LEAF)) &&