Skip to content
Prev Previous commit
Next Next commit
Switch from using GetThreadContext to RtlCaptureContext.
  • Loading branch information
AustinWise authored and github-actions committed Feb 8, 2023
commit e779cca022d2c9dab133f68c01d5c532c74e06ba
Original file line number Diff line number Diff line change
Expand Up @@ -440,16 +440,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