WheaRemoveErrorSource

INT8 __stdcall WheaRemoveErrorSource(UINT64 ErrorSourceId){
  INT64 v1; 
  UINT64 v2; 
  _WHEAP_ERROR_SOURCE *ErrorSource; 
  INT64 v4; 
  __int64 v5; 
  INT64 v6; 
  char *v7; 
  __int128 v8; 
  NTSTATUS v9; 
  void *v10; 
  int v11; 
  _LARGE_INTEGER Interval; 
  int Src[8]; 
  char v15; 
  int v16; 
  char v17; 

  ErrorSource = WheapGetErrorSource(
                  (_WHEAP_ERROR_SOURCE_TABLE *)&WheapErrorSourceTable,
                  (unsigned int)ErrorSourceId,
                  v1,
                  v2);
  v4 = (INT64)ErrorSource;
  if( ErrorSource )
  {
    LOBYTE(ErrorSource) = WheapIsNonHestErrorSource((unsigned int)ErrorSource->Descriptor.Type);
    if( (_BYTE)ErrorSource )
    {
      if( (unsigned int)(*(_DWORD *)(v4 + 108) - 3) > 1 )
      {
        v5 = 7i64;
        Interval.QuadPart = -1000i64;
        v6 = v4 + 96;
        v7 = &v15;
        do
        {
          *(_OWORD *)v7 = *(_OWORD *)v6;
          *((_OWORD *)v7 + 1) = *(_OWORD *)(v6 + 16);
          *((_OWORD *)v7 + 2) = *(_OWORD *)(v6 + 32);
          *((_OWORD *)v7 + 3) = *(_OWORD *)(v6 + 48);
          *((_OWORD *)v7 + 4) = *(_OWORD *)(v6 + 64);
          *((_OWORD *)v7 + 5) = *(_OWORD *)(v6 + 80);
          *((_OWORD *)v7 + 6) = *(_OWORD *)(v6 + 96);
          v7 += 128;
          v8 = *(_OWORD *)(v6 + 112);
          v6 += 128i64;
          *((_OWORD *)v7 - 1) = v8;
          --v5;
        }
        while( v5 );
        *(_OWORD *)v7 = *(_OWORD *)v6;
        *((_OWORD *)v7 + 1) = *(_OWORD *)(v6 + 16);
        *((_OWORD *)v7 + 2) = *(_OWORD *)(v6 + 32);
        *((_OWORD *)v7 + 3) = *(_OWORD *)(v6 + 48);
        *((_QWORD *)v7 + 8) = *(_QWORD *)(v6 + 64);
        *((_DWORD *)v7 + 18) = *(_DWORD *)(v6 + 72);
        *(_DWORD *)(v4 + 108) = 4;
        while( _InterlockedCompareExchange((volatile signed __int32 *)(v4 + 92), -1, 0) > 0 )
          KeDelayExecutionThread(0, 0, &Interval);
        v9 = WheapCallErrorSourceUninitialize(v4);
        v10 = *(void **)(v4 + 48);
        v11 = v9;
        *(_DWORD *)(v4 + 108) = 3;
        if( v10 )
        {
          ExFreePoolWithTag(v10, 0x61656857u);
          *(_QWORD *)(v4 + 48) = 0i64;
        }
        Src[3] = 0;
        Src[0] = 1733060695;
        Src[1] = 1;
        Src[2] = 1009;
        Src[5] = -2147483636;
        Src[4] = 1280201291;
        Src[6] = 2;
        Src[7] = 977;
        v16 = v11;
        v17 = 1;
        LOBYTE(ErrorSource) = WheaLogInternalEvent(Src);
      }
    }
  }
  return(char)ErrorSource;
}

Referenced by:

WheaRemoveErrorSourceDeviceDriver