PpmClearSimulatedIdle

NTSTATUS __stdcall PpmClearSimulatedIdle(PROCESSOR_NUMBER *ProcessorNumber){
  int ProcessorIndexFromNumber; 
  char v3; 
  struct _KPRCB *CurrentPrcb; 
  unsigned __int8 CurrentIrql; 
  __int64 v6; 
  NTSTATUS v7; 
  struct _GROUP_AFFINITY Affinity; 
  struct _GROUP_AFFINITY PreviousAffinity; 
  Affinity = 0i64;
  PreviousAffinity = 0i64;
  ProcessorIndexFromNumber = KeGetProcessorIndexFromNumber(ProcessorNumber);
  if( ProcessorIndexFromNumber == -1 )
    return -1073741811;
  *(_DWORD *)Affinity.Reserved = 0;
  Affinity.Reserved[2] = 0;
  v3 = KiProcessorIndexToNumberMappingTable[ProcessorIndexFromNumber] & 0x3F;
  Affinity.Group = (unsigned int)KiProcessorIndexToNumberMappingTable[ProcessorIndexFromNumber] >> 6;
  Affinity.Mask = 1i64 << v3;
  KeSetSystemGroupAffinityThread(&Affinity, &PreviousAffinity);
  CurrentPrcb = KeGetCurrentPrcb();
  CurrentIrql = KeGetCurrentIrql();
  __writecr8(2ui64);
  v6 = *((_QWORD *)CurrentPrcb + 4096);
  if( v6 )
  {
    if( *(_BYTE *)(v6 + 1) )
    {
      *(_DWORD *)(v6 + 28) = 0;
      *(_BYTE *)(v6 + 1) = 0;
    }
    v7 = 0;
  }
  else
  {
    v7 = -1073741637;
  }
  __writecr8(CurrentIrql);
  KeRevertToUserGroupAffinityThread(&PreviousAffinity);
  return v7;
}

Referenced by:

NtPowerInformation