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);
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))
PAGED_CODE();
/* Sanity checks */
- ASSERT((CmpIsKcbLockedExclusive(Kcb) == TRUE) ||
- (CmpTestRegistryLockExclusive() == TRUE));
+ CMP_ASSERT_KCB_LOCK(Kcb);
ASSERT(Kcb->RefCount == 0);
/* Cleanup the value cache */
{
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))
/* 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) &&
}
/* Make sure we have the exclusive lock */
- ASSERT((CmpIsKcbLockedExclusive(KeyBody->KeyControlBlock) == TRUE) ||
- (CmpTestRegistryLockExclusive() == TRUE));
+ CMP_ASSERT_KCB_LOCK(KeyBody->KeyControlBlock);
- /* do the insert */
+ /* Do the insert */
InsertTailList(&KeyBody->KeyControlBlock->KeyBodyListHead,
&KeyBody->KeyBodyList);
/* 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);