CmpRecordUnloadEventForHive

NTSTATUS __stdcall CmpRecordUnloadEventForHive(CMHIVE *CmHive, KEVENT *UserEvent){
  VOID **PoolWithTag; 
  __int64 UnloadEventCount; 

  PoolWithTag = ExAllocatePoolWithTag(1ui64, 8i64 * (CmHive->UnloadEventCount + 1), 1984261443i64);
  if( !PoolWithTag )
    return -1073741670;
  UnloadEventCount = CmHive->UnloadEventCount;
  if( (_DWORD)UnloadEventCount )
  {
    memmove(PoolWithTag, CmHive->UnloadEventArray, 8 * UnloadEventCount);
    ExFreePoolWithTag(CmHive->UnloadEventArray, 0);
    UnloadEventCount = CmHive->UnloadEventCount;
  }
  CmHive->UnloadEventArray = (_KEVENT **)PoolWithTag;
  PoolWithTag[UnloadEventCount] = UserEvent;
  ++CmHive->UnloadEventCount;
  ObfReferenceObject(UserEvent);
  return 0;
}

Referenced by:

CmpFreezeHive
CmpLinkHiveToMaster
CmpResolveHiveLoadConflict