PopTraceThermalRequestActiveActivity

VOID __fastcall PopTraceThermalRequestActiveActivity(INT64 a1){
  __int64 v2; 
  UINT64 *v3; 
  DEVICE_OBJECT *DeviceAttachmentBaseRefWithTag; 
  DEVICE_OBJECT *v5; 
  __int64 v6; 
  UINT64 *PoolWithTag; 
  const WCHAR *v8; 
  CHAR active; 
  int v10; 
  _DWORD a2[2]; 
  SIZE_T NumberOfBytes; 
  __int64 v13; 
  struct _EVENT_DATA_DESCRIPTOR v14; 
  int *v15; 
  int v16; 
  int v17; 
  __int64 v18; 
  int v19[2]; 
  char v20[16]; 
  _DWORD *v21; 
  int v22; 
  int v23; 
  SIZE_T *p_NumberOfBytes; 
  int v25; 
  int v26; 
  __int64 *v27; 
  int v28; 
  int v29; 
  INT64 a4[5]; 
  NumberOfBytes = 0i64;
  v2 = *(_QWORD *)(a1 + 32);
  a2[0] = 0;
  v3 = 0i64;
  DeviceAttachmentBaseRefWithTag = IoGetDeviceAttachmentBaseRefWithTag(*(DEVICE_OBJECT **)(v2 + 48), 0x67446F50ui64);
  v5 = DeviceAttachmentBaseRefWithTag;
  if( DeviceAttachmentBaseRefWithTag )
    v6 = *(_QWORD *)(*((_QWORD *)DeviceAttachmentBaseRefWithTag + 39) + 40i64);
  else
    v6 = 0i64;
  if( v6 )
  {
    PoStoreDiagnosticContext(*(_QWORD *)(a1 + 24), 0i64, &NumberOfBytes);
    PoolWithTag = (UINT64 *)ExAllocatePoolWithTag(PagedPool, NumberOfBytes, 0x50455654ui64);
    v3 = PoolWithTag;
    if( PoolWithTag )
    {
      if( (int)PoStoreDiagnosticContext(*(_QWORD *)(a1 + 24), PoolWithTag, &NumberOfBytes) >= 0 )
      {
        v8 = (const WCHAR *)((char *)v3 + v3[2]);
        active = PopDiagSnapActiveActivity(a1 + 40, a2, &a2[1], (INT64)a4);
        if( a2[0] )
        {
          if( (active || PopThermalTelemetryVerbosity)
            && (unsigned int)dword_140C021E8 > 5
            && tlgKeywordOn((__int64)&dword_140C021E8, 0x400000000000i64) )
          {
            v17 = 0;
            v19[1] = 0;
            v15 = v19;
            v18 = *(_QWORD *)(v6 + 136);
            v19[0] = *(unsigned __int16 *)(v6 + 128);
            v16 = 2;
            tlgCreate1Sz_wchar_t((__int64)v20, v8);
            v23 = 0;
            v26 = 0;
            v29 = 0;
            v21 = a2;
            LODWORD(NumberOfBytes) = a4[0];
            p_NumberOfBytes = &NumberOfBytes;
            v22 = 4;
            v27 = &v13;
            v25 = 4;
            v28 = 8;
            a2[0] = v10;
            v13 = 0x1000000i64;
            tlgWriteTransfer_EtwWriteTransfer(
              (__int64)&dword_140C021E8,
              (unsigned __int8 *)byte_140026F7D,
              0i64,
              0i64,
              8u,
              &v14);
          }
        }
      }
    }
  }
  if( v5 )
    ObfDereferenceObjectWithTag(v5, 0x67446F50ui64);
  if( v3 )
    ExFreePoolWithTag(v3, 0x50455654u);
}

Referenced by:

PopCoolingSxTransition
PopCoolingTelemetryWorker
PopDeactiveThermalRequest
PopOrphanCoolingExtension