mirror of https://github.com/x64dbg/GleeBug
closed #41 (use WaitForDebugEventEx when supported)
This commit is contained in:
parent
6d77f83205
commit
fd0ef5bf00
|
|
@ -8,11 +8,24 @@ namespace GleeBug
|
||||||
mBreakDebugger = false;
|
mBreakDebugger = false;
|
||||||
mIsDebugging = true;
|
mIsDebugging = true;
|
||||||
|
|
||||||
|
//use correct WaitForDebugEvent function
|
||||||
|
typedef BOOL(WINAPI *MYWAITFORDEBUGEVENT)(
|
||||||
|
_Out_ LPDEBUG_EVENT lpDebugEvent,
|
||||||
|
_In_ DWORD dwMilliseconds
|
||||||
|
);
|
||||||
|
static auto WFDEX = MYWAITFORDEBUGEVENT(GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "WaitForDebugEventEx"));
|
||||||
|
static auto MyWaitForDebugEvent = WFDEX ? WFDEX : MYWAITFORDEBUGEVENT(GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "WaitForDebugEvent"));
|
||||||
|
if (!MyWaitForDebugEvent)
|
||||||
|
{
|
||||||
|
cbInternalError("MyWaitForDebugEvent not set!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
while (!mBreakDebugger)
|
while (!mBreakDebugger)
|
||||||
{
|
{
|
||||||
//wait for a debug event
|
//wait for a debug event
|
||||||
mIsRunning = true;
|
mIsRunning = true;
|
||||||
if (!WaitForDebugEvent(&mDebugEvent, INFINITE))
|
if (!MyWaitForDebugEvent(&mDebugEvent, INFINITE))
|
||||||
break;
|
break;
|
||||||
mIsRunning = false;
|
mIsRunning = false;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue