CmpClaimGlobalQuota

UINT8 __stdcall CmpClaimGlobalQuota(UINT64 Size){
  __int64 v1; 
  _WORK_QUEUE_ITEM *PoolWithTag; 

  CmpUpdateGlobalQuotaAllowed();
  if( !(_DWORD)v1 || v1 >= CmpGlobalQuotaAllowed - CmpGlobalQuotaUsed )
    return 0;
  _InterlockedExchangeAdd((volatile signed __int32 *)&CmpGlobalQuotaUsed, v1);
  if( CmpGlobalQuotaUsed > (unsigned __int64)CmpGlobalQuotaWarning
    && !CmpQuotaWarningPopupDisplayed
    && ExReadyForErrors )
  {
    PoolWithTag = (_WORK_QUEUE_ITEM *)ExAllocatePoolWithTag(0x200ui64, 0x20ui64, 538987843i64);
    if( PoolWithTag )
    {
      PoolWithTag->List.Flink = 0i64;
      PoolWithTag->WorkerRoutine = (void(__fastcall *)(void *))CmpQuotaWarningWorker;
      CmpQuotaWarningPopupDisplayed = 1;
      PoolWithTag->Parameter = PoolWithTag;
      ExQueueWorkItem(PoolWithTag, DelayedWorkQueue);
    }
  }
  return 1;
}

Referenced by:

CmpAllocate
HvpAddBin
HvpBuildMapForMemoryBackedHive
HvpMapHiveImageFromViewMap