[SHELL/EXPERIMENTS]
[reactos.git] / ntoskrnl / config / cmkcbncb.c
index a123a3c..77e4e83 100644 (file)
@@ -22,6 +22,7 @@ PCM_NAME_HASH_TABLE_ENTRY CmpNameCacheTable;
 
 VOID
 NTAPI
+INIT_FUNCTION
 CmpInitializeCache(VOID)
 {
     ULONG Length, i;
@@ -44,7 +45,7 @@ CmpInitializeCache(VOID)
     for (i = 0;i < CmpHashTableSize; i++)
     {
         /* Setup the pushlock */
-        ExInitializePushLock((PULONG_PTR)&CmpCacheTable[i].Lock);
+        ExInitializePushLock(&CmpCacheTable[i].Lock);
     }
     
     /* Calculate length for the name cache */
@@ -65,7 +66,7 @@ CmpInitializeCache(VOID)
     for (i = 0;i < CmpHashTableSize; i++)
     {
         /* Setup the pushlock */
-        ExInitializePushLock((PULONG_PTR)&CmpNameCacheTable[i].Lock);
+        ExInitializePushLock(&CmpNameCacheTable[i].Lock);
     }
     
     /* Setup the delayed close table */
@@ -152,7 +153,8 @@ CmpGetNameControlBlock(IN PUNICODE_STRING NodeName)
     ULONG i;
     BOOLEAN IsCompressed = TRUE, Found = FALSE;
     PCM_NAME_HASH HashEntry;
-    ULONG Length, NcbSize;
+    ULONG NcbSize;
+    USHORT Length;
 
     /* Loop the name */
     p = NodeName->Buffer;
@@ -518,7 +520,7 @@ NTAPI
 CmpCleanUpSubKeyInfo(IN PCM_KEY_CONTROL_BLOCK Kcb)
 {
     PCM_KEY_NODE KeyNode;
-    
+
     /* Sanity check */
     ASSERT((CmpIsKcbLockedExclusive(Kcb) == TRUE) ||
            (CmpTestRegistryLockExclusive() == TRUE));
@@ -532,7 +534,7 @@ CmpCleanUpSubKeyInfo(IN PCM_KEY_CONTROL_BLOCK Kcb)
             /* Kill it */
             CmpFree(Kcb->IndexHint, 0);
         }
-        
+
         /* Remove subkey flags */
         Kcb->ExtFlags &= ~(CM_KCB_NO_SUBKEY | CM_KCB_SUBKEY_ONE | CM_KCB_SUBKEY_HINT);
     }
@@ -580,7 +582,7 @@ CmpDereferenceKeyControlBlock(IN PCM_KEY_CONTROL_BLOCK Kcb)
     /* Get the ref count and update it */
     OldRefCount = *(PLONG)&Kcb->RefCount;
     NewRefCount = OldRefCount - 1;
-   
+
     /* Check if we still have references */
     if ((NewRefCount & 0xFFFF) > 0)
     {
@@ -593,7 +595,7 @@ CmpDereferenceKeyControlBlock(IN PCM_KEY_CONTROL_BLOCK Kcb)
             return;
         }
     }
-    
+
     /* Save the key */
     ConvKey = Kcb->ConvKey;
 
@@ -900,7 +902,8 @@ NTAPI
 CmpConstructName(IN PCM_KEY_CONTROL_BLOCK Kcb)
 {
     PUNICODE_STRING KeyName;
-    ULONG NameLength, i;
+    ULONG i;
+    USHORT NameLength;
     PCM_KEY_CONTROL_BLOCK MyKcb;
     PCM_KEY_NODE KeyNode;
     BOOLEAN DeletedKey = FALSE;
@@ -1071,9 +1074,9 @@ EnlistKeyBodyWithKCB(IN PCM_KEY_BODY KeyBody,
     if (Flags & CMP_ENLIST_KCB_LOCKED_SHARED)
     {
         /* It's shared, so release the KCB shared lock */
-        CmpReleaseKcbLock(KeyBody->KeyControlBlock);     
+        CmpReleaseKcbLock(KeyBody->KeyControlBlock);
         ASSERT(!(Flags & CMP_ENLIST_KCB_LOCKED_EXCLUSIVE));
-    } 
+    }
 
     /* Check if we need to lock the KCB */
     if (!(Flags & CMP_ENLIST_KCB_LOCKED_EXCLUSIVE))
@@ -1096,7 +1099,7 @@ EnlistKeyBodyWithKCB(IN PCM_KEY_BODY KeyBody,
     {
         /* Release the lock */
         CmpReleaseKcbLock(KeyBody->KeyControlBlock);
-    } 
+    }
 }
 
 VOID
@@ -1183,7 +1186,7 @@ CmpFlushNotifiesOnKeyBodyList(IN PCM_KEY_CONTROL_BLOCK Kcb,
                         ASSERT(KeyBody->NotifyBlock == NULL);
                         
                         /* Release the reference we took */
-                                   ObDereferenceObjectDeferDelete(KeyBody);
+                        ObDereferenceObjectDeferDelete(KeyBody);
                         continue;
                     }
                 }