sync to trunk revision 36500
[reactos.git] / reactos / ntoskrnl / config / cmsysini.c
index 50fa2c5..267a3ee 100644 (file)
@@ -29,6 +29,7 @@ BOOLEAN CmpSpecialBootCondition;
 BOOLEAN CmpNoWrite;
 BOOLEAN CmpForceForceFlush;
 BOOLEAN CmpWasSetupBoot;
+ULONG CmpTraceLevel = 0;
 
 extern BOOLEAN CmFirstTime;
 
@@ -70,11 +71,10 @@ CmpDeleteKeyObject(PVOID DeletedObject)
         {
             /* Delist the key */
             DelistKeyBodyFromKCB(KeyBody, FALSE);
+
+            /* Dereference the KCB */
+            CmpDelayDerefKeyControlBlock(Kcb);
         }
-        
-        /* Dereference the KCB */
-        CmpDelayDerefKeyControlBlock(Kcb);
-        
     }
     
     /* Release the registry lock */
@@ -774,7 +774,7 @@ CmpInitializeSystemHive(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
     }
 
     /* Save the boot type */
-    if (SystemHive) CmpBootType = SystemHive->Hive.BaseBlock->BootType;
+    CmpBootType = SystemHive->Hive.BaseBlock->BootType;
 
     /* Are we in self-healing mode? */
     if (!CmSelfHeal)