From: Eric Kohl Date: Sat, 16 Aug 2014 08:56:48 +0000 (+0000) Subject: [NTOSKRNL:CONFIG] X-Git-Tag: backups/0.3.17@66124~785 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=50aa823cdbc3933436e0f984d38c5bb6c52dada8 [NTOSKRNL:CONFIG] CmShutdownSystem: Close all hive files after flushing the hives. svn path=/trunk/; revision=63897 --- diff --git a/reactos/ntoskrnl/config/cmsysini.c b/reactos/ntoskrnl/config/cmsysini.c index f41d27b042c..a191797e330 100644 --- a/reactos/ntoskrnl/config/cmsysini.c +++ b/reactos/ntoskrnl/config/cmsysini.c @@ -2043,12 +2043,35 @@ VOID NTAPI CmShutdownSystem(VOID) { + PLIST_ENTRY ListEntry; + PCMHIVE Hive; + ULONG i; + /* Kill the workers */ if (!CmFirstTime) CmpShutdownWorkers(); /* Flush all hives */ CmpLockRegistryExclusive(); CmpDoFlushAll(TRUE); + + /* Close all hive files */ + ListEntry = CmpHiveListHead.Flink; + while (ListEntry != &CmpHiveListHead) + { + Hive = CONTAINING_RECORD(ListEntry, CMHIVE, HiveList); + + for (i = 0; i < HFILE_TYPE_MAX; i++) + { + if (Hive->FileHandles[i] != NULL) + { + ZwClose(Hive->FileHandles[i]); + Hive->FileHandles[i] = NULL; + } + } + + ListEntry = ListEntry->Flink; + } + CmpUnlockRegistry(); }