Module: wine Branch: master Commit: 51c3cfddfe03fa35ab21aeac6230c28d877b20f1 URL: https://gitlab.winehq.org/wine/wine/-/commit/51c3cfddfe03fa35ab21aeac6230c28...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Feb 10 13:55:54 2023 +0100
wow64: Preserve the CPURESERVED flags across user callbacks.
---
dlls/wow64/syscall.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index 41860aeb281..d2242134819 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -1044,9 +1044,11 @@ void WINAPI Wow64ApcRoutine( ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3, CON NTSTATUS WINAPI Wow64KiUserCallbackDispatcher( ULONG id, void *args, ULONG len, void **ret_ptr, ULONG *ret_len ) { + WOW64_CPURESERVED *cpu = NtCurrentTeb()->TlsSlots[WOW64_TLS_CPURESERVED]; TEB32 *teb32 = (TEB32 *)((char *)NtCurrentTeb() + NtCurrentTeb()->WowTebOffset); ULONG teb_frame = teb32->Tib.ExceptionList; struct user_callback_frame frame; + USHORT flags = cpu->Flags;
frame.prev_frame = NtCurrentTeb()->TlsSlots[WOW64_TLS_USERCALLBACKDATA]; frame.temp_list = NtCurrentTeb()->TlsSlots[WOW64_TLS_TEMPLIST]; @@ -1115,6 +1117,7 @@ NTSTATUS WINAPI Wow64KiUserCallbackDispatcher( ULONG id, void *args, ULONG len, teb32->Tib.ExceptionList = teb_frame; NtCurrentTeb()->TlsSlots[WOW64_TLS_USERCALLBACKDATA] = frame.prev_frame; NtCurrentTeb()->TlsSlots[WOW64_TLS_TEMPLIST] = frame.temp_list; + cpu->Flags = flags; return frame.status; }