ARM64EC: Use correct context flags in ThreadTerm

This commit is contained in:
Jacek Caban committed 2026-09-28 10:39:21 +02:00
1 parent b1e54d803b
commit 517a1836ee
1 file changed
+2 -1
+2 -1
View File
@@ -1018,7 +1018,7 @@ NTSTATUS ThreadTerm(HANDLE Thread, LONG ExitCode) {
return STATUS_ACCESS_DENIED;
}
auto ThreadDup = FEX::Windows::DupHandle(Thread, THREAD_QUERY_INFORMATION | THREAD_SUSPEND_RESUME);
auto ThreadDup = FEX::Windows::DupHandle(Thread, THREAD_QUERY_INFORMATION | THREAD_SUSPEND_RESUME | THREAD_GET_CONTEXT);
THREAD_BASIC_INFORMATION Info;
if (auto Err = NtQueryInformationThread(*ThreadDup, ThreadBasicInformation, &Info, sizeof(Info), nullptr); Err) {
@@ -1032,6 +1032,7 @@ NTSTATUS ThreadTerm(HANDLE Thread, LONG ExitCode) {
// If we are suspending a thread that isn't ourselves, try to suspend it first so we know internal JIT locks aren't being held.
NtSuspendThread(*ThreadDup, NULL);
// This will wait for the thread to be suspended
TmpContext.ContextFlags = CONTEXT_CONTROL;
NtGetContextThread(*ThreadDup, &TmpContext);
}