Author: ekohl
Date: Sat Aug 16 08:56:48 2014
New Revision: 63897
URL:
http://svn.reactos.org/svn/reactos?rev=63897&view=rev
Log:
[NTOSKRNL:CONFIG]
CmShutdownSystem: Close all hive files after flushing the hives.
Modified:
trunk/reactos/ntoskrnl/config/cmsysini.c
Modified: trunk/reactos/ntoskrnl/config/cmsysini.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmsysini.c…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmsysini.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmsysini.c [iso-8859-1] Sat Aug 16 08:56:48 2014
@@ -2043,12 +2043,35 @@
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();
}