PpmEventPlatformVetoRundown

VOID __stdcall PpmEventPlatformVetoRundown(){
  __int64 v0; 
  __int64 v1; 
  unsigned __int8 v2; 
  __int64 v3; 
  unsigned int v4; 
  unsigned __int64 v5; 
  __int64 v6; 
  _QWORD **v7; 
  _QWORD *v8; 
  unsigned int i; 
  _EVENT_DATA_DESCRIPTOR a2; 
  _QWORD *v11; 
  int v12; 
  int v13; 
  __int64 v14; 
  int v15; 
  int v16; 

  v0 = PpmPlatformStates;
  if( PpmPlatformStates )
  {
    v1 = 0i64;
    for( i = 0; (unsigned int)v1 < *(_DWORD *)PpmPlatformStates; i = v1 )
    {
      a2.Reserved = 0;
      a2.Size = 4;
      a2.Ptr = (unsigned __int64)&i;
      PpmEventTracePreVetoAccounting(&PPM_ETW_PLATFORM_PRE_VETO_ACCOUNTING_RUNDOWN, &a2, 384 * v1 + v0 + 80);
      v0 = PpmPlatformStates;
      v1 = i + 1;
    }
    if( PpmEtwRegistered && EtwEventEnabled(PpmEtwHandle, &PPM_ETW_PLATFORM_IDLE_VETO_RUNDOWN) )
    {
      v2 = KeAcquireSpinLockRaiseToDpc((UINT64 *)&stru_140C23628 + 122);
      v3 = PpmPlatformStates;
      v4 = 0;
      i = 0;
      v5 = v2;
      if( *(_DWORD *)PpmPlatformStates )
      {
        v6 = 0i64;
        do
        {
          a2.Reserved = 0;
          a2.Ptr = (unsigned __int64)&i;
          a2.Size = 4;
          v7 = (_QWORD **)(384 * v6 + v3 + 88);
          v8 = *v7;
          if( *v7 != v7 )
          {
            do
            {
              v13 = 0;
              v16 = 0;
              v11 = v8 + 2;
              v12 = 4;
              v14 = (__int64)v8 + 20;
              v15 = 4;
              EtwWriteEx(PpmEtwHandle, &PPM_ETW_PLATFORM_IDLE_VETO_RUNDOWN, 0i64, 0, 0, 0, 3u, &a2);
              v8 = (_QWORD *)*v8;
            }
            while( v8 != v7 );
            v4 = i;
          }
          v3 = PpmPlatformStates;
          i = ++v4;
          v6 = v4;
        }
        while( v4 < *(_DWORD *)PpmPlatformStates );
      }
      KxReleaseSpinLock((UINT64 *)&stru_140C23628 + 122);
      __writecr8(v5);
    }
  }
}

Referenced by:

PpmEventTraceControlCallback