From 95bb94d1172891d1890bbf9b181b866a353eb7f2 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Wed, 23 Oct 2002 17:21:07 +0000 Subject: [PATCH] Initialize registry hives only once. svn path=/trunk/; revision=3651 --- reactos/ntoskrnl/cm/ntfunc.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/reactos/ntoskrnl/cm/ntfunc.c b/reactos/ntoskrnl/cm/ntfunc.c index 359a8e147b6..a419b7439c1 100644 --- a/reactos/ntoskrnl/cm/ntfunc.c +++ b/reactos/ntoskrnl/cm/ntfunc.c @@ -6,6 +6,8 @@ * UPDATE HISTORY: */ +/* INCLUDES *****************************************************************/ + #include #include #include @@ -19,9 +21,16 @@ #include "cm.h" + +/* GLOBALS ******************************************************************/ + extern POBJECT_TYPE CmiKeyType; extern PREGISTRY_HIVE CmiVolatileHive; +static BOOLEAN CmiRegistryInitialized = FALSE; + + +/* FUNCTIONS ****************************************************************/ NTSTATUS STDCALL NtCreateKey(OUT PHANDLE KeyHandle, @@ -775,9 +784,9 @@ END FIXME*/ RegistryHive->HiveHeader->Checksum = 0; pEntDword = (DWORD *) RegistryHive->HiveHeader; for (i = 0; i < 127 ; i++) - { - RegistryHive->HiveHeader->Checksum ^= pEntDword[i]; - } + { + RegistryHive->HiveHeader->Checksum ^= pEntDword[i]; + } /* Write new header */ fileOffset.u.LowPart = 0; @@ -1575,11 +1584,18 @@ NtUnloadKey(IN HANDLE KeyHandle) NTSTATUS STDCALL NtInitializeRegistry(IN BOOLEAN SetUpBoot) { - NTSTATUS Status; + NTSTATUS Status = STATUS_ACCESS_DENIED; - /* FIXME: save boot log file */ + if (CmiRegistryInitialized == FALSE) + { + /* FIXME: save boot log file */ - Status = CmiInitHives(SetUpBoot); + Status = CmiInitHives(SetUpBoot); + + CmiRegistryInitialized = TRUE; + } return(Status); } + +/* EOF */