diff --git a/ntoskrnl/config/cmapi.c b/ntoskrnl/config/cmapi.c index 6555658435f..e21eea3b793 100644 --- a/ntoskrnl/config/cmapi.c +++ b/ntoskrnl/config/cmapi.c @@ -2121,18 +2121,24 @@ CmLoadKey(IN POBJECT_ATTRIBUTES TargetKey, /* Release the hive */ CmHive->Hive.HiveFlags &= ~HIVE_IS_UNLOADING; CmHive->CreatorOwner = NULL; - - /* Allow loads */ - ExReleasePushLock(&CmpLoadHiveLock); } else { DPRINT1("CmpLinkHiveToMaster failed, Status %lx\n", Status); - /* FIXME: TODO */ - // ASSERT(FALSE); see CORE-17263 - ExReleasePushLock(&CmpLoadHiveLock); + + /* We're touching this hive, set the loading flag */ + CmHive->HiveIsLoading = TRUE; + + /* Close associated file handles */ + CmpCloseHiveFiles(CmHive); + + /* Cleanup its resources */ + CmpDestroyHive(CmHive); } + /* Allow loads */ + ExReleasePushLock(&CmpLoadHiveLock); + /* Is this first profile load? */ if (!CmpProfileLoaded && !CmpWasSetupBoot) {