diff --git a/patches/winebuild-Fake_Dlls/0010-tools-winebuild-Add-syscall-thunks-for-64-bit.patch b/patches/winebuild-Fake_Dlls/0010-tools-winebuild-Add-syscall-thunks-for-64-bit.patch index 5a0b9649..bad0e763 100644 --- a/patches/winebuild-Fake_Dlls/0010-tools-winebuild-Add-syscall-thunks-for-64-bit.patch +++ b/patches/winebuild-Fake_Dlls/0010-tools-winebuild-Add-syscall-thunks-for-64-bit.patch @@ -1,4 +1,4 @@ -From 82a2149f0e1f9ead8997e8fd52c7f4ad4e1f118e Mon Sep 17 00:00:00 2001 +From 3715c18f27d8019e6692196fc3d9e98106c9041f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 7 Sep 2017 00:38:09 +0200 Subject: [PATCH] tools/winebuild: Add syscall thunks for 64 bit. @@ -9,8 +9,8 @@ Subject: [PATCH] tools/winebuild: Add syscall thunks for 64 bit. dlls/ntdll/thread.c | 10 ++ libs/wine/loader.c | 4 + tools/winebuild/parser.c | 2 +- - tools/winebuild/spec32.c | 283 ++++++++++++++++++++++++++++++++++- - 6 files changed, 300 insertions(+), 8 deletions(-) + tools/winebuild/spec32.c | 284 ++++++++++++++++++++++++++++++++++- + 6 files changed, 301 insertions(+), 8 deletions(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index 78fed489e9..47309b53ed 100644 @@ -117,7 +117,7 @@ index 004b6aea7a..40946409c5 100644 if (odp->flags & (FLAG_FORWARD | FLAG_REGISTER)) return 0; diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c -index 800cb23023..66e5b88f41 100644 +index 800cb23023..6988320fd0 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -372,11 +372,11 @@ static void output_relay_debug( DLLSPEC *spec ) @@ -134,7 +134,7 @@ index 800cb23023..66e5b88f41 100644 { const unsigned int page_size = get_page_size(); int i; -@@ -485,6 +485,155 @@ static void output_syscall_thunks( DLLSPEC *spec ) +@@ -485,6 +485,156 @@ static void output_syscall_thunks( DLLSPEC *spec ) output_function_size( "__wine_syscall_dispatcher" ); } @@ -198,8 +198,9 @@ index 800cb23023..66e5b88f41 100644 + output( "\t.byte 0x65,0xff,0x14,0x25\n" ); /* call qword ptr gs:[0x100] */ + output( "\t.long 0x100\n"); + } -+ /* No need to have a RET here, as we will adjust the return address -+ * later (see below). */ ++ /* This RET is never reached, but Legends of Runeterra demands that it ++ * exist anyway. */ ++ output( "\t.byte 0xc3\n" ); /* ret */ + output_cfi( ".cfi_endproc" ); + output_function_size( name ); + } @@ -290,7 +291,7 @@ index 800cb23023..66e5b88f41 100644 /******************************************************************* * output_exports * -@@ -883,7 +1032,10 @@ void output_spec32_file( DLLSPEC *spec ) +@@ -883,7 +1033,10 @@ void output_spec32_file( DLLSPEC *spec ) open_output_file(); output_standard_file_header(); output_module( spec ); @@ -302,7 +303,7 @@ index 800cb23023..66e5b88f41 100644 output_stubs( spec ); output_exports( spec ); output_imports( spec ); -@@ -896,7 +1048,7 @@ void output_spec32_file( DLLSPEC *spec ) +@@ -896,7 +1049,7 @@ void output_spec32_file( DLLSPEC *spec ) static int needs_stub_exports( DLLSPEC *spec ) { @@ -311,7 +312,7 @@ index 800cb23023..66e5b88f41 100644 return 0; if (!(spec->characteristics & IMAGE_FILE_DLL)) return 0; -@@ -906,7 +1058,7 @@ static int needs_stub_exports( DLLSPEC *spec ) +@@ -906,7 +1059,7 @@ static int needs_stub_exports( DLLSPEC *spec ) } @@ -320,7 +321,7 @@ index 800cb23023..66e5b88f41 100644 { int i, nr_exports = spec->base <= spec->limit ? spec->limit - spec->base + 1 : 0; size_t rva, thunk; -@@ -1064,6 +1216,122 @@ static void create_stub_exports_text( DLLSPEC *spec ) +@@ -1064,6 +1217,122 @@ static void create_stub_exports_text( DLLSPEC *spec ) } @@ -443,7 +444,7 @@ index 800cb23023..66e5b88f41 100644 static void create_stub_exports_data( DLLSPEC *spec ) { int i; -@@ -1263,7 +1531,10 @@ static void output_fake_module_pass( DLLSPEC *spec ) +@@ -1263,7 +1532,10 @@ static void output_fake_module_pass( DLLSPEC *spec ) if (needs_stub_exports( spec )) { put_label( "text_start" );