PopSpoilBatteryEstimate
INT64 __fastcall PopSpoilBatteryEstimate(INT64 a1, UINT8 a2){
int v2;
int v3;
unsigned int v4;
const char *v5;
INT64 result;
int v7;
int v8;
struct _EVENT_DATA_DESCRIPTOR v9;
int *v10;
int v11;
int v12;
int *v13;
int v14;
int v15;
if( (int)a1 < 2 )
{
v2 = a2;
v3 = a1;
v4 = (unsigned __int8)(1 << a1);
if( a2 )
_InterlockedOr(&PopEstimateSpoilerMask, v4);
else
_InterlockedAnd(&PopEstimateSpoilerMask, ~v4);
PopBatteryQueueWork(4i64);
v5 = "indefinitely";
if( !(_BYTE)v2 )
v5 = "temporarily";
LODWORD(result) = DbgPrintEx(
0x92u,
3u,
"Battery estimates spoiled %s by %d; mask=%x\n",
v5,
v3,
PopEstimateSpoilerMask);
if( (unsigned int)dword_140C021E8 > 5 )
{
v12 = 0;
v15 = 0;
v10 = &v7;
v7 = v2;
v13 = &v8;
v11 = 4;
v8 = v3;
v14 = 4;
LODWORD(result) = tlgWriteTransfer_EtwWriteTransfer(
(__int64)&dword_140C021E8,
(unsigned __int8 *)word_140027EA2,
0i64,
0i64,
4u,
&v9);
}
}
return result;
}Referenced by:
PopSpoilEstimatesOnPowerStateTransitionWorker
PopUpdateConsoleDisplayState