From 9bdd02de0c5cd370a48901ceede12ff946662295 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 15 Feb 2021 21:58:02 +0100 Subject: [PATCH] ntdll: Store eflags in x86_64 syscall frame. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/ntdll/unix/signal_x86_64.c | 2 +- tools/winebuild/import.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 824cfb4febe..9366d8913c0 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -1947,7 +1947,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) context->Rsp = (ULONG64)&frame->ret_addr; context->Rbp = frame->rbp; context->Rip = frame->thunk_addr; - context->EFlags = 0x202; + context->EFlags = frame->eflags; __asm__( "movw %%cs,%0" : "=g" (context->SegCs) ); __asm__( "movw %%ss,%0" : "=g" (context->SegSs) ); context->ContextFlags |= CONTEXT_CONTROL; diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index c70470251a4..8c949a383e3 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1508,7 +1508,9 @@ void output_syscalls( DLLSPEC *spec ) output_cfi( ".cfi_rel_offset %%rbp,0" ); output( "\tmovq %%rsp,%%rbp\n" ); output_cfi( ".cfi_def_cfa_register %%rbp" ); - output( "\tleaq -0x2a8(%%rbp),%%rsp\n" ); + output( "\tleaq -0x10(%%rbp),%%rsp\n" ); + output( "\tpushfq\n" ); + output( "\tsubq $0x280,%%rsp\n" ); output( "\tandq $~63,%%rsp\n" ); output( "\tmovq %%rbx,-0x90(%%rbp)\n" ); output_cfi( ".cfi_rel_offset %%rbx,-144" );