CmReleaseLoadKeyContext

void __fastcall CmReleaseLoadKeyContext(PVOID BugCheckParameter4, int a2){
  if( a2 < 0 )
  {
    LOCK_HIVE_LOAD();
    CmpLockRegistry();
    if( *(_BYTE *)(*((_QWORD *)BugCheckParameter4 + 4) + 2936i64) == 1 )
    {
      CmpDereferenceKeyControlBlock((UINT64)BugCheckParameter4);
      CmpDoQueueLateUnloadWorker(*((_CMHIVE **)BugCheckParameter4 + 4));
    }
    else
    {
      CmpDereferenceKeyControlBlock((UINT64)BugCheckParameter4);
    }
    CmpUnlockRegistry();
    UNLOCK_HIVE_LOAD();
  }
  else
  {
    CmpLockRegistry();
    CmpDereferenceKeyControlBlock((UINT64)BugCheckParameter4);
    CmpUnlockRegistry();
  }
}

Referenced by:

CmLoadDifferencingKey