WheapEtwEnableCallback

VOID __stdcall WheapEtwEnableCallback(
        _GUID *SourceId,
        UINT64 IsEnabled,
        UINT8 Level,
        UINT64 MatchAnyKeyword,
        UINT64 MatchAllKeyword,
        _EVENT_FILTER_DESCRIPTOR *FilterData,
        PVOID Context){
  ULONG_PTR v7; 
  __int64 v8; 
  __int64 *v9; 
  __int64 v10; 
  WheapEventingInitialized = IsEnabled;
  if( (_DWORD)IsEnabled == 1 )
  {
    while( 1 )
    {
      KeWaitForSingleObject(&WheapWaitingETWEventLock, Executive, 0, 0, 0i64);
      v7 = WheapWaitingETWEvents;
      if( *(__int64 **)(WheapWaitingETWEvents + 8) != &WheapWaitingETWEvents )
        goto LABEL_9;
      v8 = *(_QWORD *)WheapWaitingETWEvents;
      if( *(_QWORD *)(*(_QWORD *)WheapWaitingETWEvents + 8i64) != WheapWaitingETWEvents )
        goto LABEL_9;
      WheapWaitingETWEvents = *(_QWORD *)WheapWaitingETWEvents;
      *(_QWORD *)(v8 + 8) = &WheapWaitingETWEvents;
      KeSetEvent(&WheapWaitingETWEventLock, 0);
      if( (__int64 *)v7 == &WheapWaitingETWEvents )
        break;
      WheapGenerateETWEvents((WHEA_ERROR_RECORD *)(v7 + 40));
      WheapFreeErrorRecord(v7);
    }
    while( 1 )
    {
      KeWaitForSingleObject(&WheapDeferredInternalLogsEventLock, Executive, 0, 0, 0i64);
      v9 = (__int64 *)WheapDeferredInternalLogs;
      if( *(__int64 **)(WheapDeferredInternalLogs + 8) != &WheapDeferredInternalLogs )
        break;
      v10 = *(_QWORD *)WheapDeferredInternalLogs;
      if( *(_QWORD *)(*(_QWORD *)WheapDeferredInternalLogs + 8i64) != WheapDeferredInternalLogs )
        break;
      WheapDeferredInternalLogs = *(_QWORD *)WheapDeferredInternalLogs;
      *(_QWORD *)(v10 + 8) = &WheapDeferredInternalLogs;
      KeSetEvent(&WheapDeferredInternalLogsEventLock, 0);
      if( v9 == &WheapDeferredInternalLogs )
        return;
      WheaLogInternalEvent(v9 + 2);
    }
LABEL_9:
    __fastfail(3u);
  }
}

Referenced by:

No references.