Even if WOW64_CPURESERVED_FLAG_RESET_STATE ends up being set.
---
Unix call equivalent of 419e4d69d6c3a4ea8b355f8b3fc211950eed0cdd. After 7ef95229913cf004d002459fe9e53307344479f2, a SIGUSR1 in the middle of a Unix call can set WOW64_CPURESERVED_FLAG_RESET_STATE. If that happens, the original eax from before the Unix call will be restored in syscall_32to64_return, stomping on the actual return from the Unix function.
Thanks to @gofman for help spotting this!
From: Tim Clem tclem@codeweavers.com
Even if WOW64_CPURESERVED_FLAG_RESET_STATE ends up being set. --- dlls/wow64cpu/cpu.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/wow64cpu/cpu.c b/dlls/wow64cpu/cpu.c index f5900aa36ed..453c5dfb4d8 100644 --- a/dlls/wow64cpu/cpu.c +++ b/dlls/wow64cpu/cpu.c @@ -255,6 +255,7 @@ __ASM_GLOBAL_FUNC( unix_call_32to64, "movl 12(%r14),%edx\n\t" /* code */ "movl 16(%r14),%r8d\n\t" /* args */ "callq *__wine_unix_call_dispatcher(%rip)\n\t" + "movl %eax,0xb0(%r13)\n\t" /* context->Eax */ "btrl $0,-4(%r13)\n\t" /* cpu->Flags & WOW64_CPURESERVED_FLAG_RESET_STATE */ "jc .Lsyscall_32to64_return\n\t" "movl 0xb8(%r13),%edx\n\t" /* context->Eip */