diff --git a/ntoskrnl/config/cmsysini.c b/ntoskrnl/config/cmsysini.c index 32450c366a6..0e3a647de66 100644 --- a/ntoskrnl/config/cmsysini.c +++ b/ntoskrnl/config/cmsysini.c @@ -21,7 +21,6 @@ LIST_ENTRY CmpSelfHealQueueListHead; KEVENT CmpLoadWorkerEvent; LONG CmpLoadWorkerIncrement; PEPROCESS CmpSystemProcess; -BOOLEAN HvShutdownComplete; PVOID CmpRegistryLockCallerCaller, CmpRegistryLockCaller; BOOLEAN CmpFlushOnLockRelease; BOOLEAN CmpSpecialBootCondition; @@ -30,6 +29,7 @@ BOOLEAN CmpWasSetupBoot; BOOLEAN CmpProfileLoaded; BOOLEAN CmpNoVolatileCreates; ULONG CmpTraceLevel = 0; +BOOLEAN HvShutdownComplete = FALSE; extern LONG CmpFlushStarveWriters; extern BOOLEAN CmFirstTime; @@ -2049,6 +2049,14 @@ CmShutdownSystem(VOID) ListEntry = ListEntry->Flink; } + /* + * As we flushed all the hives on the disk, + * tell the system we do not want any further + * registry flushing or syncing at this point + * since we are shutting down the registry anyway. + */ + HvShutdownComplete = TRUE; + CmpUnlockRegistry(); } diff --git a/ntoskrnl/include/internal/cm.h b/ntoskrnl/include/internal/cm.h index db702bd8b28..e8fee77faf4 100644 --- a/ntoskrnl/include/internal/cm.h +++ b/ntoskrnl/include/internal/cm.h @@ -1473,6 +1473,7 @@ extern BOOLEAN CmpProfileLoaded; extern PCMHIVE CmiVolatileHive; extern LIST_ENTRY CmiKeyObjectListHead; extern BOOLEAN CmpHoldLazyFlush; +extern BOOLEAN HvShutdownComplete; // // Inlined functions