From d0eb702ec28a8efa8d685462ab755c812af9f308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 11 Jan 2016 00:37:44 +0000 Subject: [PATCH] [NTOS:CONFIG] Remove a very old hack (that dated back from the Configuration Manager rewrite): now the hives are already correctly loaded in memory, therefore there is no need to call CmCreateRootNode after creating a hive, because the root node is subsequently initialized with calls to CmpCreateLinkNode. The comment saying that calls to CmCreateRootNode can be removed when CmpCreateLinkNode is used, is now in order. This means we correctly parse & mount the hives. The CmCreateRootNode function is now only used in the 'mkhive' tool in order to create file hives, since this tool needs to create new hives from nowhere (that's why also our bootloaders do not need this function: they only load & parse existing hive files). The fact that this hack remained caused us hidden troubles: some hives (SAM, SOFTWARE) had "two" root keys: a first one that was unused (which was created by this hackish call), and the second one which was the one used (and was created by CmpCreateLinkNode as expected). svn path=/trunk/; revision=70575 --- reactos/ntoskrnl/config/cmparse.c | 1 - reactos/ntoskrnl/config/cmsysini.c | 3 --- 2 files changed, 4 deletions(-) diff --git a/reactos/ntoskrnl/config/cmparse.c b/reactos/ntoskrnl/config/cmparse.c index 2021eb2a8ac..4a4177670c4 100644 --- a/reactos/ntoskrnl/config/cmparse.c +++ b/reactos/ntoskrnl/config/cmparse.c @@ -715,7 +715,6 @@ CmpDoOpen(IN PHHIVE Hive, return Status; } -/* Remove calls to CmCreateRootNode once this is used! */ NTSTATUS NTAPI CmpCreateLinkNode(IN PHHIVE Hive, diff --git a/reactos/ntoskrnl/config/cmsysini.c b/reactos/ntoskrnl/config/cmsysini.c index 1ae533a5070..38c7ba42c16 100644 --- a/reactos/ntoskrnl/config/cmsysini.c +++ b/reactos/ntoskrnl/config/cmsysini.c @@ -371,9 +371,6 @@ CmpInitHiveFromFile(IN PCUNICODE_STRING HiveName, /* Success, return hive */ *Hive = NewHive; - /* HACK: ROS: Init root key cell and prepare the hive */ - if (Operation == HINIT_CREATE) CmCreateRootNode(&NewHive->Hive, L""); - /* Duplicate the hive name */ NewHive->FileFullPath.Buffer = ExAllocatePoolWithTag(PagedPool, HiveName->Length,