Advertisement
name22

NTPowerInformation

Jun 9th, 2013
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.81 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement