Code: Select all
SystemInformationClass := 16
VarSetCapacity(SystemInformation, SystemInformationLength := 0x100000)
VarSetCapacity(ReturnLength, 4)
status := DllCall("ntdll.dll\NtQuerySystemInformation"
, "UInt", SystemInformationClass
;, "Ptr", &SystemInformation ; works
, "Ptr*", SystemInformation ; fails
, "UInt", SystemInformationLength
, "UInt*", ReturnLength
, "Int")
SetFormat, IntegerFast, Hex
status &= 0xFFFFFFFF, status .= ""
setformat, IntegerFast, Dec
MsgBox % status ; 0xC0000005