WheapInitializeErrorSource

INT64 __fastcall WheapInitializeErrorSource(_WHEAP_ERROR_SOURCE *Source){
  unsigned int v2; 
  int v3; 
  int v4; 
  unsigned int v5; 
  VOID *PoolWithTag; 
  INT64 v7; 
  INT64 v8; 
  unsigned int i; 
  __int64 v10; 
  if( *((_DWORD *)Source + 26) > 0x10u )
    return(unsigned int)-1073741811;
  *((_DWORD *)Source + 9) = 1634035799;
  *((_DWORD *)Source + 10) = *((_DWORD *)Source + 26);
  *((_DWORD *)Source + 16) = *((_DWORD *)Source + 30);
  v2 = 0;
  if( (int)WheapCallErrorSourceCorrect((INT64)Source) >= 0 )
  {
    v3 = *((_DWORD *)Source + 17) + 72;
    *((_DWORD *)Source + 5) = *((_DWORD *)Source + 32);
    v4 = *((_DWORD *)Source + 29);
    *((_DWORD *)Source + 7) = v4;
    v5 = (*((_DWORD *)Source + 30) * v3 + 175) & 0xFFFFFFF8;
    *((_DWORD *)Source + 8) = v5;
    if( v4 )
    {
      PoolWithTag = ExAllocatePoolWithTag(NonPagedPoolNx, v5 * v4, 0x61656857ui64);
      v7 = (INT64)PoolWithTag;
      if( PoolWithTag )
      {
        memset((INT64)PoolWithTag, 0i64);
        v8 = v7;
        for( i = 0; i < *((_DWORD *)Source + 7); ++i )
        {
          WheapInitializeErrorRecordWrapper(v8, v5, (INT64)Source);
          v8 = v5 + v10;
        }
        *((_QWORD *)Source + 6) = v7;
      }
      else
      {
        return(unsigned int)-1073741670;
      }
    }
    return v2;
  }
  return 0i64;
}

Referenced by:

WheaAddErrorSource
WheapInitializeDeferredErrorSources
WheapInitializeErrorSourceTable