Skip to content
Prev Previous commit
Next Next commit
Switch from using GetThreadContext to RtlCaptureContext.
  • Loading branch information
AustinWise committed Jan 27, 2023
commit f29268efb0688a90aa0e562bf55656a840373085
Original file line number Diff line number Diff line change
Expand Up @@ -449,16 +449,9 @@ REDHAWK_PALEXPORT void REDHAWK_PALAPI PalRestoreContext(CONTEXT * pCtx)
REDHAWK_PALIMPORT bool REDHAWK_PALAPI TryPopulateControlSegmentRegisters(CONTEXT* pContext)
{
#if defined(TARGET_X86) || defined(TARGET_AMD64)
HANDLE hThread = GetCurrentThread();

CONTEXT ctx;
memset(&ctx, 0, sizeof(ctx));
ctx.ContextFlags = CONTEXT_CONTROL;

if (!GetThreadContext(hThread, &ctx))
{
return false;
}
RtlCaptureContext(&ctx);

pContext->SegCs = ctx.SegCs;
pContext->SegSs = ctx.SegSs;
Expand Down