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