PopThermalReadCounters

NTSTATUS __stdcall PopThermalReadCounters(
        POP_THERMAL_ZONE *ThermalZone,
        UINT64 CounterMask,
        _THERMAL_ZONE_COUNTERS *Counters){
  NTSTATUS v3; 
  _POP_RW_LOCK *v6; 
  _KDPC *v7; 
  PVOID v8; 
  PVOID v9; 
  PVOID v10; 
  VOID *Object[3]; 

  v3 = 0;
  if( *((_BYTE *)ThermalZone + 228) )
    goto LABEL_5;
  if( (CounterMask & 9) == 0 )
    goto LABEL_5;
  v6 = (_POP_RW_LOCK *)(ThermalZone + 108);
  PopAcquireRwLockExclusive((_POP_RW_LOCK *)ThermalZone + 27);
  KeResetEvent((_KEVENT *)(ThermalZone + 118));
  v7 = (_KDPC *)*((_QWORD *)ThermalZone + 7);
  ThermalZone[28] = 0;
  IoCancelIrp(v7, v8, v9, v10);
  PopReleaseRwLock(v6);
  Object[1] = ThermalZone + 112;
  Object[0] = ThermalZone + 118;
  if( KeWaitForMultipleObjects(2ui64, Object, WaitAny, Executive, 0, 0, 0i64, 0i64) )
    return -1073741823;
LABEL_5:
  PopAcquireRwLockExclusive((_POP_RW_LOCK *)ThermalZone + 27);
  Counters->Temperature = ThermalZone[32] / 0xAu;
  Counters->TemperatureHighPrecision = ThermalZone[32];
  Counters->ThrottleLimit = ThermalZone[20];
  Counters->ThrottleReasons = ThermalZone[53];
  PopReleaseRwLock((_POP_RW_LOCK *)ThermalZone + 27);
  return v3;
}

Referenced by:

PoThermalCounterSetCallback