diff --git a/reactos/ntoskrnl/config/cminit.c b/reactos/ntoskrnl/config/cminit.c index cd8b94dd646..502892f80f5 100644 --- a/reactos/ntoskrnl/config/cminit.c +++ b/reactos/ntoskrnl/config/cminit.c @@ -234,6 +234,12 @@ CmpDestroyHive(IN PCMHIVE CmHive) RemoveEntryList(&CmHive->HiveList); ExReleasePushLock(&CmpHiveListHeadLock); + /* Destroy the security descriptor cache */ + CmpDestroySecurityCache(CmHive); + + /* Destroy the view list */ + CmpDestroyHiveViewList(CmHive); + /* Delete the flusher lock */ ExDeleteResourceLite(CmHive->FlusherLock); ExFreePoolWithTag(CmHive->FlusherLock, TAG_CMHIVE); @@ -241,12 +247,6 @@ CmpDestroyHive(IN PCMHIVE CmHive) /* Delete the view lock */ ExFreePoolWithTag(CmHive->ViewLock, TAG_CMHIVE); - /* Destroy the security descriptor cache */ - CmpDestroySecurityCache(CmHive); - - /* Destroy the view list */ - CmpDestroyHiveViewList(CmHive); - /* Free the hive storage */ HvFree(&CmHive->Hive); diff --git a/reactos/ntoskrnl/config/ntapi.c b/reactos/ntoskrnl/config/ntapi.c index b47f77ffd49..03bcc3dc067 100644 --- a/reactos/ntoskrnl/config/ntapi.c +++ b/reactos/ntoskrnl/config/ntapi.c @@ -1521,7 +1521,7 @@ NtUnloadKey2(IN POBJECT_ATTRIBUTES TargetKey, { if (Flags != REG_FORCE_UNLOAD) { - /* Release two KCBs lock */ + /* Release the KCB locks */ CmpReleaseTwoKcbLockByKey(ChildConv, ParentConv); /* Release the hive loading lock */