From: Torge Matthies tmatthies@codeweavers.com
This doesn't support CDECL syscalls. --- dlls/ntdll/unix/signal_x86_64.c | 13 +++++++++---- include/windef.h | 4 ++++ 2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 715190267af..dfce344adbc 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -2722,7 +2722,7 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "leaq -0x98(%rbp),%rcx\n" "2:\n\t" #endif - "leaq 0x28(%rsp),%rsi\n\t" /* first argument */ + "leaq 0x38(%rsp),%rsi\n\t" /* third argument */ "movq %rcx,%rsp\n\t" "movq 0x00(%rcx),%rax\n\t" "movq 0x18(%rcx),%rdx\n\t" @@ -2736,7 +2736,7 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "jae 5f\n\t" "movq 24(%rbx),%rcx\n\t" /* table->ArgumentTable */ "movzbl (%rcx,%rax),%ecx\n\t" - "subq $0x20,%rcx\n\t" + "subq $0x30,%rcx\n\t" "jbe 1f\n\t" "subq %rcx,%rsp\n\t" "shrq $3,%rcx\n\t" @@ -2744,8 +2744,13 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "movq %rsp,%rdi\n\t" "cld\n\t" "rep; movsq\n" - "1:\tmovq %r10,%rcx\n\t" - "subq $0x20,%rsp\n\t" + "1:\tmovq %r10,%rdi\n\t" + "movq %rdx,%rsi\n\t" + "movq %r8,%rdx\n\t" + "movq %r9,%rcx\n\t" + "movq -0x10(%rbp),%r9\n\t" /* frame->rsp */ + "movq 0x28(%r9),%r8\n\t" + "movq 0x30(%r9),%r9\n\t" "movq (%rbx),%r10\n\t" /* table->ServiceTable */ "callq *(%r10,%rax,8)\n\t" "leaq -0x98(%rbp),%rcx\n\t" diff --git a/include/windef.h b/include/windef.h index 1f2151f6f99..0cae9627683 100644 --- a/include/windef.h +++ b/include/windef.h @@ -200,7 +200,11 @@ extern "C" { #define APIENTRY WINAPI #define CONST __ONLY_IN_WINELIB(const)
+#if defined(_WIN64) && !defined(__WINE_PE_BUILD) +#define SYSCALL +#else #define SYSCALL WINAPI +#endif
/* Misc. constants. */