[NTOSKRNL]
authorCameron Gutman <aicommander@gmail.com>
Mon, 19 Dec 2011 09:33:40 +0000 (09:33 +0000)
committerCameron Gutman <aicommander@gmail.com>
Mon, 19 Dec 2011 09:33:40 +0000 (09:33 +0000)
- Lock the registry before flushing hives to avoid, among other things, use of an ERESOURCE without being inside a critical region

svn path=/trunk/; revision=54694

reactos/ntoskrnl/config/cmsysini.c

index d059fd2..d9f60a1 100644 (file)
@@ -1933,9 +1933,13 @@ VOID
 NTAPI
 CmShutdownSystem(VOID)
 {
-    /* Kill the workers and flush all hives */
+    /* Kill the workers */
     if (!CmFirstTime) CmpShutdownWorkers();
+
+    /* Flush all hives */
+    CmpLockRegistryExclusive();
     CmpDoFlushAll(TRUE);
+    CmpUnlockRegistry();
 }
 
 VOID