directly use thread context manipulation for StepInto

This commit is contained in:
mrexodia 2017-04-28 01:06:58 +02:00
parent d7e66e5ae4
commit 21e146bc23
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
1 changed files with 7 additions and 4 deletions

View File

@ -4,6 +4,7 @@
#include "Global.Handle.h" #include "Global.Handle.h"
#include "Global.Threader.h" #include "Global.Threader.h"
#include "Global.Librarian.h" #include "Global.Librarian.h"
#include "Global.Engine.h"
__declspec(dllexport) void TITCALL ForceClose() __declspec(dllexport) void TITCALL ForceClose()
{ {
@ -62,10 +63,12 @@ __declspec(dllexport) void TITCALL StepInto(LPVOID StepCallBack)
} }
else else
{ {
ULONG_PTR ueContext = NULL; CONTEXT myDBGContext;
ueContext = (ULONG_PTR)GetContextData(UE_EFLAGS); HANDLE hActiveThread = EngineOpenThread(THREAD_GETSETSUSPEND, false, DBGEvent.dwThreadId);
ueContext |= UE_TRAP_FLAG; myDBGContext.ContextFlags = CONTEXT_CONTROL;
SetContextData(UE_EFLAGS, ueContext); GetThreadContext(hActiveThread, &myDBGContext);
myDBGContext.EFlags |= UE_TRAP_FLAG;
SetThreadContext(hActiveThread, &myDBGContext);
engineStepActive = true; engineStepActive = true;
engineStepCallBack = StepCallBack; engineStepCallBack = StepCallBack;
engineStepCount = 0; engineStepCount = 0;