Author: hbelusca
Date: Sat Jun 17 01:22:17 2017
New Revision: 75070
URL:
http://svn.reactos.org/svn/reactos?rev=75070&view=rev
Log:
[NTOS]: Employ the simple CMP_ASSERT_KCB_LOCK() macro to perform these asserts.
Modified:
trunk/reactos/ntoskrnl/config/cmkcbncb.c
Modified: trunk/reactos/ntoskrnl/config/cmkcbncb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmkcbncb.c…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmkcbncb.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmkcbncb.c [iso-8859-1] Sat Jun 17 01:22:17 2017
@@ -305,9 +305,8 @@
NTAPI
CmpRemoveKeyControlBlock(IN PCM_KEY_CONTROL_BLOCK Kcb)
{
- /* Make sure that the registry and KCB are utterly locked */
- ASSERT((CmpIsKcbLockedExclusive(Kcb) == TRUE) ||
- (CmpTestRegistryLockExclusive() == TRUE));
+ /* Make sure we have the exclusive lock */
+ CMP_ASSERT_KCB_LOCK(Kcb);
/* Remove the key hash */
CmpRemoveKeyHash(&Kcb->KeyHash);
@@ -434,9 +433,8 @@
PULONG_PTR CachedList;
ULONG i;
- /* Sanity check */
- ASSERT((CmpIsKcbLockedExclusive(Kcb) == TRUE) ||
- (CmpTestRegistryLockExclusive() == TRUE));
+ /* Make sure we have the exclusive lock */
+ CMP_ASSERT_KCB_LOCK(Kcb);
/* Check if the value list is cached */
if (CMP_IS_CELL_CACHED(Kcb->ValueCache.ValueList))
@@ -482,8 +480,7 @@
PAGED_CODE();
/* Sanity checks */
- ASSERT((CmpIsKcbLockedExclusive(Kcb) == TRUE) ||
- (CmpTestRegistryLockExclusive() == TRUE));
+ CMP_ASSERT_KCB_LOCK(Kcb);
ASSERT(Kcb->RefCount == 0);
/* Cleanup the value cache */
@@ -521,9 +518,8 @@
{
PCM_KEY_NODE KeyNode;
- /* Sanity check */
- ASSERT((CmpIsKcbLockedExclusive(Kcb) == TRUE) ||
- (CmpTestRegistryLockExclusive() == TRUE));
+ /* Make sure we have the exclusive lock */
+ CMP_ASSERT_KCB_LOCK(Kcb);
/* Check if there's any cached subkey */
if (Kcb->ExtFlags & (CM_KCB_NO_SUBKEY | CM_KCB_SUBKEY_ONE |
CM_KCB_SUBKEY_HINT))
@@ -619,9 +615,8 @@
/* Check if this is the last reference */
if ((InterlockedDecrement((PLONG)&Kcb->RefCount) & 0xFFFF) == 0)
{
- /* Sanity check */
- ASSERT((CmpIsKcbLockedExclusive(Kcb) == TRUE) ||
- (CmpTestRegistryLockExclusive() == TRUE));
+ /* Make sure we have the exclusive lock */
+ CMP_ASSERT_KCB_LOCK(Kcb);
/* Check if we should do a direct delete */
if (((CmpHoldLazyFlush) &&
@@ -1086,10 +1081,9 @@
}
/* Make sure we have the exclusive lock */
- ASSERT((CmpIsKcbLockedExclusive(KeyBody->KeyControlBlock) == TRUE) ||
- (CmpTestRegistryLockExclusive() == TRUE));
-
- /* do the insert */
+ CMP_ASSERT_KCB_LOCK(KeyBody->KeyControlBlock);
+
+ /* Do the insert */
InsertTailList(&KeyBody->KeyControlBlock->KeyBodyListHead,
&KeyBody->KeyBodyList);
@@ -1132,8 +1126,7 @@
/* Lock the KCB */
if (!LockHeld) CmpAcquireKcbLockExclusive(KeyBody->KeyControlBlock);
- ASSERT((CmpIsKcbLockedExclusive(KeyBody->KeyControlBlock) == TRUE) ||
- (CmpTestRegistryLockExclusive() == TRUE));
+ CMP_ASSERT_KCB_LOCK(KeyBody->KeyControlBlock);
/* Remove the entry */
RemoveEntryList(&KeyBody->KeyBodyList);