Module: wine Branch: master Commit: 419e4d69d6c3a4ea8b355f8b3fc211950eed0cdd URL: https://gitlab.winehq.org/wine/wine/-/commit/419e4d69d6c3a4ea8b355f8b3fc2119...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Mar 7 17:21:29 2023 +0100
wow64: In system calls always return the status from Wow64SystemServiceEx.
---
dlls/wow64/syscall.c | 17 ++++++++++++++++- dlls/wow64cpu/cpu.c | 1 + 2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index dd3937640bc..1feeac083d9 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -143,6 +143,19 @@ static EXCEPTION_RECORD *exception_record_32to64( const EXCEPTION_RECORD32 *rec3 }
+static NTSTATUS get_context_return_value( void *wow_context ) +{ + switch (current_machine) + { + case IMAGE_FILE_MACHINE_I386: + return ((I386_CONTEXT *)wow_context)->Eax; + case IMAGE_FILE_MACHINE_ARMNT: + return ((ARM_CONTEXT *)wow_context)->R0; + } + return 0; +} + + /********************************************************************** * call_user_exception_dispatcher */ @@ -400,9 +413,11 @@ NTSTATUS WINAPI wow64_NtContinue( UINT *args ) void *context = get_ptr( &args ); BOOLEAN alertable = get_ulong( &args );
+ NTSTATUS status = get_context_return_value( context ); + pBTCpuSetContext( GetCurrentThread(), GetCurrentProcess(), NULL, context ); if (alertable) NtTestAlert(); - return STATUS_SUCCESS; + return status; }
diff --git a/dlls/wow64cpu/cpu.c b/dlls/wow64cpu/cpu.c index 835353d9af8..13c94751d19 100644 --- a/dlls/wow64cpu/cpu.c +++ b/dlls/wow64cpu/cpu.c @@ -192,6 +192,7 @@ __ASM_GLOBAL_FUNC( syscall_32to64, "movq %rax,%rcx\n\t" /* syscall number */ "leaq 8(%r14),%rdx\n\t" /* parameters */ "call " __ASM_NAME("Wow64SystemServiceEx") "\n\t" + "movl %eax,0xb0(%r13)\n\t" /* context->Eax */
"syscall_32to64_return:\n\t" "movl 0x9c(%r13),%edi\n\t" /* context->Edi */