name22

NTPowerInformation

Jun 9th, 2013
137
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $iCores = 4
  2.  
  3. $tProcessorInformation = DllStructCreate("ulong[" & $iCores * 6 & "]")
  4.  
  5. ConsoleWrite(Hex(_CallNTPowerInformation(11, 0, 0, DllStructGetPtr($tProcessorInformation), DllStructGetSize($tProcessorInformation))) & @CRLF)
  6.  
  7.  
  8. For $i = 1 To $iCores
  9.     ConsoleWrite("Core #" & $i -1 & ":" & @CRLF)
  10.     For $j = 1 To 6
  11.         ConsoleWrite(DllStructGetData($tProcessorInformation, 1, $i * $j) & @CRLF)
  12.     Next
  13.     ConsoleWrite(@CRLF)
  14. Next
  15.  
  16. Func _CallNTPowerInformation($InformationLevel, $lpInputBuffer, $nInputBufferSize, $lpOutputBuffer, $nOutputBufferSize)
  17.     $aRet = DllCall("PowrProf.dll", "int", "CallNtPowerInformation", "int", $InformationLevel, "ptr", $lpInputBuffer, "ulong", $nInputBufferSize, "ptr", $lpOutputBuffer, "ulong", $nOutputBufferSize)
  18.     If @error Then Return SetError(@error, 0, -1)
  19.     Return $aRet[0]
  20. EndFunc
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×