I'm trying to use those methods in AutoHotkey but have a problem.
CheckRemoteDebuggerPresent function C++ syntax is
BOOL WINAPI CheckRemoteDebuggerPresent(
_In_ HANDLE hProcess,
_Inout_ PBOOL pbDebuggerPresent
);
Parameters
hProcess [in] - A handle to the process.
pbDebuggerPresent [in, out] - A pointer to a variable that the function sets to TRUE if the specified process is being debugged, or FALSE otherwise.
So I translated this to AHK as
aModule := DllCall("CheckRemoteDebuggerPresent", UInt, Handleme, IntP, pbDebuggerPresent)
However, 'pbDebuggerPresent' doesnt return FALSE or TRUE. Instead, it returns 0
here is my test script, you have to manually write process handle on edit control.
Code: Select all
#SingleInstance force
#NoEnv
SetTitleMatchMode, 3
Gui, +LastFound +hwndMainF
Gui, add, button, w100 h70, button
Gui, add, edit, w100 vhandleme, edit
Gui, add, listbox, w100, listbox
Gui, add, listview, w100, listview
Gui, add, groupbox, w100, groupbox
Gui, show,, Test Script
pbDebuggerPresent := ""
return
Buttonbutton:
Gui, Submit, NoHide
MsgBox % handleme
WinGet, which, PID, Test Script
aModule := DllCall("CheckRemoteDebuggerPresent", UInt, handleme, IntP, pbDebuggerPresent)
hModule := DllCall("IsDebuggerPresent")
MsgBox, % "IsDebuggerPresent : " hModule "`nCheckRemoteDebugger : " aModule "`nDebugpresent : " boolean
/*
if hModule <> 0
{
aModule := DllCall("DebugActiveProcessStop", "Uint", which)
MsgBox % aModule
}
*/
return
GuiClose:
ExitApp