From e873fe63ce7879b3968aeeebabe6bb525fb030e7 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 19 Dec 2011 09:33:40 +0000 Subject: [PATCH] [NTOSKRNL] - 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/config/cmsysini.c b/reactos/ntoskrnl/config/cmsysini.c index d059fd27640..d9f60a145f4 100644 --- a/reactos/ntoskrnl/config/cmsysini.c +++ b/reactos/ntoskrnl/config/cmsysini.c @@ -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 -- 2.17.1