From 1018ad9087c69bb25d116ad79792fd304b319d59 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Tue, 3 Jun 2003 07:28:01 +0000 Subject: [PATCH] Point the root key's parent key pointer to the root key to prevent check routines from reporting false positives. svn path=/trunk/; revision=4827 --- reactos/ntoskrnl/cm/registry.c | 4 ++-- reactos/ntoskrnl/cm/regobj.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/reactos/ntoskrnl/cm/registry.c b/reactos/ntoskrnl/cm/registry.c index ccb06c8f980..cd32a5d4663 100644 --- a/reactos/ntoskrnl/cm/registry.c +++ b/reactos/ntoskrnl/cm/registry.c @@ -1,4 +1,4 @@ -/* $Id: registry.c,v 1.102 2003/06/02 16:51:15 ekohl Exp $ +/* $Id: registry.c,v 1.103 2003/06/03 07:28:01 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -305,7 +305,7 @@ CmInitializeRegistry(VOID) RootKey->RegistryHive = CmiVolatileHive; RootKey->BlockOffset = CmiVolatileHive->HiveHeader->RootKeyCell; RootKey->KeyCell = CmiGetBlock(CmiVolatileHive, RootKey->BlockOffset, NULL); - RootKey->ParentKey = NULL; + RootKey->ParentKey = RootKey; RootKey->Flags = 0; RootKey->NumberOfSubKeys = 0; RootKey->SubKeys = NULL; diff --git a/reactos/ntoskrnl/cm/regobj.c b/reactos/ntoskrnl/cm/regobj.c index afbd4a5c69a..f9ecbb9870d 100644 --- a/reactos/ntoskrnl/cm/regobj.c +++ b/reactos/ntoskrnl/cm/regobj.c @@ -328,7 +328,7 @@ CmiObjectQueryName (PVOID ObjectBody, if (LocalInfo == NULL) return STATUS_INSUFFICIENT_RESOURCES; - if (KeyObject->ParentKey != NULL) + if (KeyObject->ParentKey != KeyObject) { Status = ObQueryNameString (KeyObject->ParentKey, LocalInfo, @@ -337,6 +337,7 @@ CmiObjectQueryName (PVOID ObjectBody, } else { + /* KeyObject is the root key */ Status = ObQueryNameString (BODY_TO_HEADER(KeyObject)->Parent, LocalInfo, MAX_PATH * sizeof(WCHAR),