Author: rharabien
Date: Wed Sep 7 09:51:13 2011
New Revision: 53614
URL:
http://svn.reactos.org/svn/reactos?rev=53614&view=rev
Log:
[MKHIVE]
- Fix max key name length, max value name length, max value data length properties of
registry key not being set correctly
- Fixes #6042 - regedit on LiveCD shows keys and values now
Modified:
trunk/reactos/tools/mkhive/cmi.c
trunk/reactos/tools/mkhive/registry.c
Modified: trunk/reactos/tools/mkhive/cmi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/cmi.c?rev=536…
==============================================================================
--- trunk/reactos/tools/mkhive/cmi.c [iso-8859-1] (original)
+++ trunk/reactos/tools/mkhive/cmi.c [iso-8859-1] Wed Sep 7 09:51:13 2011
@@ -388,6 +388,19 @@
if (NT_SUCCESS(Status))
{
ParentKeyCell->SubKeyCounts[Storage]++;
+ if (Packable)
+ {
+ if (NameLength*sizeof(WCHAR) > ParentKeyCell->MaxNameLen)
+ ParentKeyCell->MaxNameLen = NameLength*sizeof(WCHAR);
+ }
+ else
+ {
+ if (NameLength > ParentKeyCell->MaxNameLen)
+ ParentKeyCell->MaxNameLen = NameLength;
+ }
+ if (NewKeyCell->ClassLength > ParentKeyCell->MaxClassLen)
+ ParentKeyCell->MaxClassLen = NewKeyCell->ClassLength;
+
*pSubKeyCell = NewKeyCell;
*pBlockOffset = NKBOffset;
}
@@ -720,6 +733,16 @@
ValueListCell->ValueOffset[KeyCell->ValueList.Count] = NewValueCellOffset;
KeyCell->ValueList.Count++;
+ if (NewValueCell->Flags & VALUE_COMP_NAME)
+ {
+ if (NewValueCell->NameLength*sizeof(WCHAR) > KeyCell->MaxValueNameLen)
+ KeyCell->MaxValueNameLen = NewValueCell->NameLength*sizeof(WCHAR);
+ }
+ else
+ {
+ if (NewValueCell->NameLength > KeyCell->MaxValueNameLen)
+ KeyCell->MaxValueNameLen = NewValueCell->NameLength;
+ }
HvMarkCellDirty(&RegistryHive->Hive, KeyCellOffset, FALSE);
HvMarkCellDirty(&RegistryHive->Hive, KeyCell->ValueList.List, FALSE);
Modified: trunk/reactos/tools/mkhive/registry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/registry.c?re…
==============================================================================
--- trunk/reactos/tools/mkhive/registry.c [iso-8859-1] (original)
+++ trunk/reactos/tools/mkhive/registry.c [iso-8859-1] Wed Sep 7 09:51:13 2011
@@ -448,6 +448,9 @@
HvMarkCellDirty(&Key->RegistryHive->Hive, ValueCellOffset, FALSE);
}
+ if (cbData > Key->KeyCell->MaxValueDataLen)
+ Key->KeyCell->MaxValueDataLen = cbData;
+
HvMarkCellDirty(&Key->RegistryHive->Hive, Key->KeyCellOffset, FALSE);
DPRINT("Return status 0x%08x\n", Status);