Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 2b0a53f

Browse files
committed
Backport #66356
Port of dotnet/runtime#66356
1 parent c9d60c2 commit 2b0a53f

File tree

2 files changed

+222
-162
lines changed

2 files changed

+222
-162
lines changed

src/vm/threads.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3455,6 +3455,14 @@ class Thread: public IUnknown
34553455
static void __stdcall RedirectedHandledJITCaseForGCStress();
34563456
#endif // defined(HAVE_GCCOVER) && USE_REDIRECT_FOR_GCSTRESS
34573457

3458+
#ifdef _TARGET_X86_
3459+
// RtlRestoreContext is available on x86, but relatively recently.
3460+
// RestoreContextSimulated uses SEH machinery for a similar result on legacy OS-es.
3461+
// This function should not be used on new OS-es as the pattern is not
3462+
// guaranteed to continue working in the future.
3463+
static void RestoreContextSimulated(Thread* pThread, CONTEXT* pCtx, void* pFrame, DWORD dwLastError);
3464+
#endif
3465+
34583466
friend void CPFH_AdjustContextForThreadSuspensionRace(T_CONTEXT *pContext, Thread *pThread);
34593467
#endif // FEATURE_HIJACK && !PLATFORM_UNIX
34603468

0 commit comments

Comments
 (0)