WheaRemoveErrorSourceDeviceDriver

NTSTATUS __stdcall WheaRemoveErrorSourceDeviceDriver(UINT64 ErrorSourceId){
  unsigned int v1; 
  NTSTATUS v2; 
  WHEA_ERROR_SOURCE_DESCRIPTOR *ErrorSource; 
  WHEA_ERROR_SOURCE_DESCRIPTOR *v4; 
  signed __int32 v5; 
  void *v6; 
  int Src[8]; 
  char pszDest[16]; 
  __int128 v10; 
  *(_OWORD *)pszDest = 0i64;
  v1 = ErrorSourceId;
  v10 = 0i64;
  v2 = 0;
  ErrorSource = WheaGetErrorSource(ErrorSourceId);
  v4 = ErrorSource;
  if( ErrorSource )
  {
    v5 = _InterlockedCompareExchange((volatile signed __int32 *)ErrorSource + 38, -1, 0);
    if( v5 != -1 )
    {
      if( v5 )
      {
        Src[0] = 1733060695;
        Src[1] = 1;
        Src[3] = 1;
        Src[7] = 32;
        Src[2] = 64;
        Src[5] = -2147483604;
        Src[4] = 1280201291;
        Src[6] = 2;
        RtlStringCchCopyA(pszDest, 0x20ui64, (PSTR)"RemoveErrorSourceDeviceDriver");
        WheaLogInternalEvent(Src);
        return -1073740024;
      }
      else
      {
        v6 = (void *)*((_QWORD *)v4 + 9);
        if( v6 )
        {
          ExFreePoolWithTag(v6, 0x41454857u);
          ExFreePoolWithTag(*((PVOID *)v4 + 18), 0x41454857u);
          *((_QWORD *)v4 + 9) = 0i64;
          *((_QWORD *)v4 + 18) = 0i64;
        }
        WheaRemoveErrorSource(v1);
        *((_QWORD *)v4 + 10) = HalSystemVectorDispatchEntry;
        *((_QWORD *)v4 + 11) = xHalTimerWatchdogStop;
      }
    }
  }
  return v2;
}

Referenced by:

No references.