#include <Process.au3>
$tBuffer = DllStructCreate("dword;ptr;ulong_ptr;ulong[3]")
_NtQueryInformationProcess(-1, 0, DllStructGetPtr($tBuffer), 24)
$iInheritPid = DllStructGetData($tBuffer, 4, 3)
Msgbox(0, "Inherited from", _ProcessGetName($iInheritPid) & ":" & $iInheritPid)
Func _NtQueryInformationProcess($hProcess, $iClass, $pBuffer, $iSizeofBuffer)
Local $iResult
$iResult = DllCall("Ntdll.dll", "dword", "NtQueryInformationProcess", _
"hWnd", $hProcess, "int", $iClass, "ptr", $pBuffer, _
"ulong", $iSizeofBuffer, "ulong*", 0)
Return SetError($iResult[0], $iResult[5], $iResult[0] = 0)
EndFunc ;==>_NtQueryInformationProcess
|