[NTOS]: Reorder the destruction code in CmpDestroyHive() to make it similar to the...
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 16 Jun 2017 21:02:27 +0000 (21:02 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 16 Jun 2017 21:02:27 +0000 (21:02 +0000)
svn path=/trunk/; revision=75065

reactos/ntoskrnl/config/cminit.c
reactos/ntoskrnl/config/ntapi.c

index cd8b94d..502892f 100644 (file)
@@ -234,6 +234,12 @@ CmpDestroyHive(IN PCMHIVE CmHive)
     RemoveEntryList(&CmHive->HiveList);
     ExReleasePushLock(&CmpHiveListHeadLock);
 
     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);
     /* 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);
 
     /* 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);
 
     /* Free the hive storage */
     HvFree(&CmHive->Hive);
 
index b47f77f..03bcc3d 100644 (file)
@@ -1521,7 +1521,7 @@ NtUnloadKey2(IN POBJECT_ATTRIBUTES TargetKey,
     {
         if (Flags != REG_FORCE_UNLOAD)
         {
     {
         if (Flags != REG_FORCE_UNLOAD)
         {
-            /* Release two KCBs lock */
+            /* Release the KCB locks */
             CmpReleaseTwoKcbLockByKey(ChildConv, ParentConv);
 
             /* Release the hive loading lock */
             CmpReleaseTwoKcbLockByKey(ChildConv, ParentConv);
 
             /* Release the hive loading lock */