CmpReferenceKeyControlBlockLockNotHeld

NTSTATUS __stdcall CmpReferenceKeyControlBlockLockNotHeld(PVOID BugCheckParameter2){
  signed __int64 v1; 
  signed __int64 v3; 

  v1 = *(_QWORD *)BugCheckParameter2;
  while( v1 )
  {
    if( v1 == -1 )
      KeBugCheckEx(0x51u, (PVOID)0x24, BugCheckParameter2, 0i64, 0i64);
    v3 = v1;
    v1 = _InterlockedCompareExchange64((volatile signed __int64 *)BugCheckParameter2, v1 + 1, v1);
    if( v3 == v1 )
      return v1;
  }
  ExAcquirePushLockSharedEx((_EX_PUSH_LOCK *)BugCheckParameter2 + 6, 0i64);
  _InterlockedIncrement((volatile signed __int32 *)BugCheckParameter2 + 14);
  CmpReferenceKeyControlBlock(BugCheckParameter2);
  CmpUnlockKcb((_CM_KEY_CONTROL_BLOCK *)BugCheckParameter2);
  return v1;
}

Referenced by:

CmpCreateKeyControlBlock
CmpWalkOneLevel