From e1141d482fdb1aaa711f637ee76b6ad58c996543 Mon Sep 17 00:00:00 2001 From: Michael Cronenworth Date: Thu, 11 Jun 2020 08:55:00 -0500 Subject: [PATCH] ARM patchset requires a previous patch I may back out this patchset if this fails again --- wine-staging-5.10-ntdll-arm0.patch | 964 ++++++++++++++++++ ...atch => wine-staging-5.10-ntdll-arm1.patch | 0 wine.spec | 6 +- 3 files changed, 968 insertions(+), 2 deletions(-) create mode 100644 wine-staging-5.10-ntdll-arm0.patch rename wine-staging-5.10-ntdll-arm.patch => wine-staging-5.10-ntdll-arm1.patch (100%) diff --git a/wine-staging-5.10-ntdll-arm0.patch b/wine-staging-5.10-ntdll-arm0.patch new file mode 100644 index 0000000..74f1f00 --- /dev/null +++ b/wine-staging-5.10-ntdll-arm0.patch @@ -0,0 +1,964 @@ +From 9a4c8c5631101f8571dbdce726ae864060e446c9 Mon Sep 17 00:00:00 2001 +From: Zebediah Figura +Date: Mon, 8 Jun 2020 15:59:31 -0500 +Subject: [PATCH] Rebase against 17529582402ebe27ef975fc7dcb8353f4f95e629. + +--- + ...ase-Maintain-FLS-storage-list-in-PEB.patch | 44 ++-- + .../0001-ntdll-Add-stub-for-NtContinue.patch | 63 ------ + ...o-continue-execution-after-exception.patch | 82 -------- + patches/ntdll-NtContinue/definition | 3 - + ...dll-Support-x86_64-syscall-emulation.patch | 14 +- + ...mporary-signal-handler-during-proces.patch | 32 +-- + patches/patchinstall.sh | 198 ++++++++---------- + ...ate-syscall-thunks-for-ntdll-exports.patch | 34 +-- + ...e-client-side-file-descriptor-cache-.patch | 20 +- + staging/upstream-commit | 2 +- + 10 files changed, 156 insertions(+), 336 deletions(-) + delete mode 100644 patches/ntdll-NtContinue/0001-ntdll-Add-stub-for-NtContinue.patch + delete mode 100644 patches/ntdll-NtContinue/0002-Use-NtContinue-to-continue-execution-after-exception.patch + delete mode 100644 patches/ntdll-NtContinue/definition + +diff --git a/patches/ntdll-FLS_Callbacks/0001-kernelbase-Maintain-FLS-storage-list-in-PEB.patch b/patches/ntdll-FLS_Callbacks/0001-kernelbase-Maintain-FLS-storage-list-in-PEB.patch +index 1d5434bf6..40f2a0b86 100644 +--- a/patches/ntdll-FLS_Callbacks/0001-kernelbase-Maintain-FLS-storage-list-in-PEB.patch ++++ b/patches/ntdll-FLS_Callbacks/0001-kernelbase-Maintain-FLS-storage-list-in-PEB.patch +@@ -1,4 +1,4 @@ +-From 5c370d9f0be803d89302da7471ef0b93b45a0d75 Mon Sep 17 00:00:00 2001 ++From 3fe24d6e3b216c21b6a7b68766414213fdd2ff2d Mon Sep 17 00:00:00 2001 + From: Paul Gofman + Date: Thu, 23 Apr 2020 14:32:23 +0300 + Subject: [PATCH] kernelbase: Maintain FLS storage list in PEB. +@@ -73,10 +73,10 @@ index 7501165dc87..2bcc3ee60c4 100644 + * FlsFree should fail + * FlsGetValue and FlsSetValue should succeed + diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c +-index a454bf118cc..dac30959734 100644 ++index a9869863b44..b24f9e98bc7 100644 + --- a/dlls/kernel32/tests/thread.c + +++ b/dlls/kernel32/tests/thread.c +-@@ -2435,7 +2435,6 @@ START_TEST(thread) ++@@ -2377,7 +2377,6 @@ START_TEST(thread) + } + return; + } +@@ -84,7 +84,7 @@ index a454bf118cc..dac30959734 100644 + test_thread_info(); + test_reserved_tls(); + test_CreateRemoteThread(); +-@@ -2463,6 +2462,5 @@ START_TEST(thread) ++@@ -2405,6 +2404,5 @@ START_TEST(thread) + test_thread_fpu_cw(); + test_thread_actctx(); + test_thread_description(); +@@ -92,7 +92,7 @@ index a454bf118cc..dac30959734 100644 + test_threadpool(); + } + diff --git a/dlls/kernelbase/thread.c b/dlls/kernelbase/thread.c +-index 03b16da95bb..4409f120491 100644 ++index f20d460d07d..3c77b6a42f4 100644 + --- a/dlls/kernelbase/thread.c + +++ b/dlls/kernelbase/thread.c + @@ -38,6 +38,10 @@ +@@ -106,7 +106,7 @@ index 03b16da95bb..4409f120491 100644 + + /*********************************************************************** + * Threads +-@@ -916,6 +920,19 @@ static void init_fiber_context( struct fiber_data *fiber ) ++@@ -915,6 +919,19 @@ static void init_fiber_context( struct fiber_data *fiber ) + #endif + } + +@@ -126,7 +126,7 @@ index 03b16da95bb..4409f120491 100644 + + /*********************************************************************** + * CreateFiber (kernelbase.@) +-@@ -1023,7 +1040,16 @@ void WINAPI DECLSPEC_HOTPATCH DeleteFiber( LPVOID fiber_ptr ) ++@@ -1022,7 +1039,16 @@ void WINAPI DECLSPEC_HOTPATCH DeleteFiber( LPVOID fiber_ptr ) + RtlExitUserThread( 1 ); + } + RtlFreeUserStack( fiber->stack_allocation ); +@@ -144,7 +144,7 @@ index 03b16da95bb..4409f120491 100644 + HeapFree( GetProcessHeap(), 0, fiber ); + } + +-@@ -1045,6 +1071,19 @@ void WINAPI DECLSPEC_HOTPATCH SwitchToFiber( LPVOID fiber ) ++@@ -1044,6 +1070,19 @@ void WINAPI DECLSPEC_HOTPATCH SwitchToFiber( LPVOID fiber ) + struct fiber_data *new_fiber = fiber; + struct fiber_data *current_fiber = NtCurrentTeb()->Tib.u.FiberData; + +@@ -164,7 +164,7 @@ index 03b16da95bb..4409f120491 100644 + current_fiber->except = NtCurrentTeb()->Tib.ExceptionList; + current_fiber->stack_limit = NtCurrentTeb()->Tib.StackLimit; + current_fiber->fls_slots = NtCurrentTeb()->FlsSlots; +-@@ -1070,9 +1109,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH FlsAlloc( PFLS_CALLBACK_FUNCTION callback ) ++@@ -1069,9 +1108,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH FlsAlloc( PFLS_CALLBACK_FUNCTION callback ) + PEB * const peb = NtCurrentTeb()->Peb; + + RtlAcquirePebLock(); +@@ -175,7 +175,7 @@ index 03b16da95bb..4409f120491 100644 + { + SetLastError( ERROR_NOT_ENOUGH_MEMORY ); + index = FLS_OUT_OF_INDEXES; +-@@ -1082,9 +1119,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH FlsAlloc( PFLS_CALLBACK_FUNCTION callback ) ++@@ -1081,9 +1118,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH FlsAlloc( PFLS_CALLBACK_FUNCTION callback ) + index = RtlFindClearBitsAndSet( peb->FlsBitmap, 1, 1 ); + if (index != ~0U) + { +@@ -186,7 +186,7 @@ index 03b16da95bb..4409f120491 100644 + { + RtlClearBits( peb->FlsBitmap, index, 1 ); + index = FLS_OUT_OF_INDEXES; +-@@ -1092,8 +1127,8 @@ DWORD WINAPI DECLSPEC_HOTPATCH FlsAlloc( PFLS_CALLBACK_FUNCTION callback ) ++@@ -1091,8 +1126,8 @@ DWORD WINAPI DECLSPEC_HOTPATCH FlsAlloc( PFLS_CALLBACK_FUNCTION callback ) + } + else + { +@@ -197,7 +197,7 @@ index 03b16da95bb..4409f120491 100644 + } + } + else SetLastError( ERROR_NO_MORE_ITEMS ); +-@@ -1117,7 +1152,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH FlsFree( DWORD index ) ++@@ -1116,7 +1151,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH FlsFree( DWORD index ) + { + /* FIXME: call Fls callback */ + /* FIXME: add equivalent of ThreadZeroTlsCell here */ +@@ -206,7 +206,7 @@ index 03b16da95bb..4409f120491 100644 + } + else SetLastError( ERROR_INVALID_PARAMETER ); + RtlReleasePebLock(); +-@@ -1136,7 +1171,7 @@ PVOID WINAPI DECLSPEC_HOTPATCH FlsGetValue( DWORD index ) ++@@ -1135,7 +1170,7 @@ PVOID WINAPI DECLSPEC_HOTPATCH FlsGetValue( DWORD index ) + return NULL; + } + SetLastError( ERROR_SUCCESS ); +@@ -215,7 +215,7 @@ index 03b16da95bb..4409f120491 100644 + } + + +-@@ -1150,14 +1185,12 @@ BOOL WINAPI DECLSPEC_HOTPATCH FlsSetValue( DWORD index, PVOID data ) ++@@ -1149,14 +1184,12 @@ BOOL WINAPI DECLSPEC_HOTPATCH FlsSetValue( DWORD index, PVOID data ) + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } +@@ -233,10 +233,10 @@ index 03b16da95bb..4409f120491 100644 + } + + diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c +-index 5e8de8821dd..71ef1cfea0a 100644 ++index ffbc9fabb23..be53d98e5b8 100644 + --- a/dlls/ntdll/loader.c + +++ b/dlls/ntdll/loader.c +-@@ -179,6 +179,15 @@ static CRITICAL_SECTION_DEBUG dlldir_critsect_debug = ++@@ -169,6 +169,15 @@ static CRITICAL_SECTION_DEBUG dlldir_critsect_debug = + }; + static CRITICAL_SECTION dlldir_section = { &dlldir_critsect_debug, -1, 0, 0, 0, 0 }; + +@@ -252,7 +252,7 @@ index 5e8de8821dd..71ef1cfea0a 100644 + static WINE_MODREF *cached_modref; + static WINE_MODREF *current_modref; + static WINE_MODREF *last_failed_modref; +-@@ -219,6 +228,16 @@ static RTL_UNLOAD_EVENT_TRACE unload_traces[RTL_UNLOAD_EVENT_TRACE_NUMBER]; ++@@ -209,6 +218,16 @@ static RTL_UNLOAD_EVENT_TRACE unload_traces[RTL_UNLOAD_EVENT_TRACE_NUMBER]; + static RTL_UNLOAD_EVENT_TRACE *unload_trace_ptr; + static unsigned int unload_trace_seq; + +@@ -269,7 +269,7 @@ index 5e8de8821dd..71ef1cfea0a 100644 + static void module_push_unload_trace( const LDR_DATA_TABLE_ENTRY *ldr ) + { + RTL_UNLOAD_EVENT_TRACE *ptr = &unload_traces[unload_trace_seq]; +-@@ -3913,6 +3932,13 @@ void WINAPI LdrShutdownThread(void) ++@@ -3610,6 +3629,13 @@ void WINAPI LdrShutdownThread(void) + /* don't do any detach calls if process is exiting */ + if (process_detaching) return; + +@@ -283,15 +283,15 @@ index 5e8de8821dd..71ef1cfea0a 100644 + RtlEnterCriticalSection( &loader_section ); + + mark = &NtCurrentTeb()->Peb->LdrData->InInitializationOrderModuleList; +-@@ -4153,6 +4179,7 @@ static void user_shared_data_init(void) ++@@ -3819,6 +3845,7 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule) + */ + void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknown3, ULONG_PTR unknown4 ) + { + + static const unsigned int fls_slot_count = 8 * sizeof(NtCurrentTeb()->Peb->FlsBitmapBits); +- static const LARGE_INTEGER zero; + static int attach_done; + int i; +-@@ -4191,6 +4218,25 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow ++ NTSTATUS status; ++@@ -3856,6 +3883,25 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow + InsertHeadList( &tls_links, &NtCurrentTeb()->TlsLinks ); + RtlReleasePebLock(); + +@@ -318,5 +318,5 @@ index 5e8de8821dd..71ef1cfea0a 100644 + { + attach_done = 1; + -- +-2.25.3 ++2.26.2 + +diff --git a/patches/ntdll-NtContinue/0001-ntdll-Add-stub-for-NtContinue.patch b/patches/ntdll-NtContinue/0001-ntdll-Add-stub-for-NtContinue.patch +deleted file mode 100644 +index 7145857bd..000000000 +--- a/patches/ntdll-NtContinue/0001-ntdll-Add-stub-for-NtContinue.patch ++++ /dev/null +@@ -1,63 +0,0 @@ +-From 9ea4f081689959bd393eab2caaa0ed8237846117 Mon Sep 17 00:00:00 2001 +-From: =?UTF-8?q?Michael=20M=C3=BCller?= +-Date: Thu, 25 May 2017 05:04:26 +0200 +-Subject: [PATCH] ntdll: Add stub for NtContinue. +- +---- +- dlls/ntdll/exception.c | 10 +++++++++- +- dlls/ntdll/ntdll.spec | 4 ++-- +- 2 files changed, 11 insertions(+), 3 deletions(-) +- +-diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c +-index c35312fd1d1..3b85f1efa04 100644 +---- a/dlls/ntdll/exception.c +-+++ b/dlls/ntdll/exception.c +-@@ -328,7 +328,6 @@ LONG WINAPI call_unhandled_exception_filter( PEXCEPTION_POINTERS eptr ) +- return unhandled_exception_filter( eptr ); +- } +- +-- +- #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) +- +- struct dynamic_unwind_entry +-@@ -667,6 +666,15 @@ PRUNTIME_FUNCTION WINAPI RtlLookupFunctionEntry( ULONG_PTR pc, ULONG_PTR *base, +- +- #endif /* __x86_64__ || __arm__ || __aarch64__ */ +- +-+/********************************************************************* +-+ * NtContinue (NTDLL.@) +-+ */ +-+NTSTATUS WINAPI NtContinue( CONTEXT *context, BOOLEAN alert ) +-+{ +-+ FIXME( "(%p, %d) stub!\n", context, alert ); +-+ return STATUS_NOT_IMPLEMENTED; +-+} +-+ +- /************************************************************* +- * __wine_spec_unimplemented_stub +- * +-diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec +-index 81faf7fc280..d21a6f08ac2 100644 +---- a/dlls/ntdll/ntdll.spec +-+++ b/dlls/ntdll/ntdll.spec +-@@ -150,7 +150,7 @@ +- @ stdcall NtCompleteConnectPort(ptr) +- # @ stub NtCompressKey +- @ stdcall NtConnectPort(ptr ptr ptr ptr ptr ptr ptr ptr) +--@ stub NtContinue +-+@ stdcall NtContinue(ptr long) +- # @ stub NtCreateDebugObject +- @ stdcall NtCreateDirectoryObject(ptr long ptr) +- @ stdcall NtCreateEvent(ptr long ptr long long) +-@@ -1105,7 +1105,7 @@ +- @ stdcall -private ZwCompleteConnectPort(ptr) NtCompleteConnectPort +- # @ stub ZwCompressKey +- @ stdcall -private ZwConnectPort(ptr ptr ptr ptr ptr ptr ptr ptr) NtConnectPort +--@ stub ZwContinue +-+@ stdcall -private ZwContinue(ptr long) NtContinue +- # @ stub ZwCreateDebugObject +- @ stdcall -private ZwCreateDirectoryObject(ptr long ptr) NtCreateDirectoryObject +- @ stdcall -private ZwCreateEvent(ptr long ptr long long) NtCreateEvent +--- +-2.17.1 +- +diff --git a/patches/ntdll-NtContinue/0002-Use-NtContinue-to-continue-execution-after-exception.patch b/patches/ntdll-NtContinue/0002-Use-NtContinue-to-continue-execution-after-exception.patch +deleted file mode 100644 +index 902940977..000000000 +--- a/patches/ntdll-NtContinue/0002-Use-NtContinue-to-continue-execution-after-exception.patch ++++ /dev/null +@@ -1,82 +0,0 @@ +-From 812de54c6fc8f93e8fda01f0802397b183adab59 Mon Sep 17 00:00:00 2001 +-From: Andrew Wesie +-Date: Fri, 27 Jul 2018 01:26:56 -0500 +-Subject: [PATCH] ntdll: Use NtContinue to continue execution after exceptions. +- +-NtContinue is exported by ntdll and some programs expect it to be used to +-restore the thread context after an exception handler returns +-EXCEPTION_CONTINUE_EXECUTION. It must take a context as its first argument +-and restore that context. +- +-Current implementation is a simple wrapper around NtSetContextThread. It is +-unlikely that it has the correct behavior if called by an external caller. +- +-The __syscall_NtContinue wrapper is used so that it can be hooked by a +-third-party. +---- +- dlls/ntdll/exception.c | 5 +++-- +- dlls/ntdll/signal_i386.c | 3 ++- +- dlls/ntdll/signal_x86_64.c | 3 ++- +- 3 files changed, 7 insertions(+), 4 deletions(-) +- +-diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c +-index 3b85f1efa..bc972254f 100644 +---- a/dlls/ntdll/exception.c +-+++ b/dlls/ntdll/exception.c +-@@ -671,8 +671,9 @@ PRUNTIME_FUNCTION WINAPI RtlLookupFunctionEntry( ULONG_PTR pc, ULONG_PTR *base, +- */ +- NTSTATUS WINAPI NtContinue( CONTEXT *context, BOOLEAN alert ) +- { +-- FIXME( "(%p, %d) stub!\n", context, alert ); +-- return STATUS_NOT_IMPLEMENTED; +-+ TRACE( "(%p, %d) stub!\n", context, alert ); +-+ +-+ return NtSetContextThread( GetCurrentThread(), context ); +- } +- +- /************************************************************* +-diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c +-index e55164630..8fc885ed4 100644 +---- a/dlls/ntdll/signal_i386.c +-+++ b/dlls/ntdll/signal_i386.c +-@@ -730,6 +730,7 @@ static NTSTATUS call_stack_handlers( EXCEPTION_RECORD *rec, CONTEXT *context ) +- return STATUS_UNHANDLED_EXCEPTION; +- } +- +-+NTSTATUS WINAPI __syscall_NtContinue( CONTEXT *context, BOOLEAN alert ); +- +- /******************************************************************* +- * raise_exception +-@@ -794,7 +795,7 @@ static NTSTATUS raise_exception( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL f +- NtTerminateProcess( NtCurrentProcess(), rec->ExceptionCode ); +- } +- done: +-- return NtSetContextThread( GetCurrentThread(), context ); +-+ return __syscall_NtContinue( context, FALSE ); +- } +- +- +-diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c +-index e48529d73..0e74fda43 100644 +---- a/dlls/ntdll/signal_x86_64.c +-+++ b/dlls/ntdll/signal_x86_64.c +-@@ -2520,6 +2520,7 @@ static NTSTATUS call_stack_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_contex +- return STATUS_UNHANDLED_EXCEPTION; +- } +- +-+NTSTATUS WINAPI __syscall_NtContinue( CONTEXT *context, BOOLEAN alert ); +- +- static NTSTATUS raise_exception( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance ) +- { +-@@ -2582,7 +2583,7 @@ static NTSTATUS raise_exception( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL f +- } +- +- done: +-- return NtSetContextThread( GetCurrentThread(), context ); +-+ return __syscall_NtContinue( context, FALSE ); +- } +- +- +--- +-2.23.0 +- +diff --git a/patches/ntdll-NtContinue/definition b/patches/ntdll-NtContinue/definition +deleted file mode 100644 +index 06c2ebf9e..000000000 +--- a/patches/ntdll-NtContinue/definition ++++ /dev/null +@@ -1,3 +0,0 @@ +-Fixes: [31910] Add stub for NtContinue +-Fixes: [45572] League of Legends 8.12+ fails to start a game (anticheat engine, hooking of NtContinue) +-Depends: winebuild-Fake_Dlls +\ No newline at end of file +diff --git a/patches/ntdll-Syscall_Emulation/0001-ntdll-Support-x86_64-syscall-emulation.patch b/patches/ntdll-Syscall_Emulation/0001-ntdll-Support-x86_64-syscall-emulation.patch +index 4ae5fcdfa..0a39d4355 100644 +--- a/patches/ntdll-Syscall_Emulation/0001-ntdll-Support-x86_64-syscall-emulation.patch ++++ b/patches/ntdll-Syscall_Emulation/0001-ntdll-Support-x86_64-syscall-emulation.patch +@@ -1,4 +1,4 @@ +-From 20298be5a42af52be27c56f88ad6a8a0304b55b6 Mon Sep 17 00:00:00 2001 ++From cd04d1910294b035bb3858b3ef1bb295aec3a732 Mon Sep 17 00:00:00 2001 + From: Paul Gofman + Date: Mon, 30 Dec 2019 13:27:53 +0300 + Subject: [PATCH] ntdll: Support x86_64 syscall emulation. +@@ -15,7 +15,7 @@ is used for trapping syscalls. + 3 files changed, 119 insertions(+), 2 deletions(-) + + diff --git a/configure.ac b/configure.ac +-index e3d63ed7501..2fbec4129df 100644 ++index e61a98455c3..4adeb52d225 100644 + --- a/configure.ac + +++ b/configure.ac + @@ -464,6 +464,7 @@ AC_CHECK_HEADERS(\ +@@ -27,7 +27,7 @@ index e3d63ed7501..2fbec4129df 100644 + linux/types.h \ + linux/ucdrom.h \ + diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c +-index 0ccc7cbceb6..149ad1bf5e7 100644 ++index dd8b45fa907..a5612abf2b1 100644 + --- a/dlls/ntdll/signal_x86_64.c + +++ b/dlls/ntdll/signal_x86_64.c + @@ -24,6 +24,7 @@ +@@ -61,8 +61,8 @@ index 0ccc7cbceb6..149ad1bf5e7 100644 + typedef struct _SCOPE_TABLE + { + ULONG Count; +-@@ -2797,6 +2807,104 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *ucontext ) +- restore_context( &context, ucontext ); ++@@ -2480,6 +2490,104 @@ static inline DWORD is_privileged_instr( CONTEXT *context ) ++ return 0; + } + + +extern unsigned int __wine_nb_syscalls; +@@ -165,8 +165,8 @@ index 0ccc7cbceb6..149ad1bf5e7 100644 + +} + + /*********************************************************************** +- * __wine_set_signal_handler (NTDLL.@) +-@@ -2842,6 +2950,9 @@ void signal_init_process(void) ++ * handle_interrupt ++@@ -2793,6 +2901,9 @@ void signal_init_process(void) + sig_act.sa_sigaction = trap_handler; + if (sigaction( SIGTRAP, &sig_act, NULL ) == -1) goto error; + #endif +diff --git a/patches/ntdll-WRITECOPY/0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch b/patches/ntdll-WRITECOPY/0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch +index d6e9a6824..db0631234 100644 +--- a/patches/ntdll-WRITECOPY/0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch ++++ b/patches/ntdll-WRITECOPY/0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch +@@ -1,4 +1,4 @@ +-From 46968c583a30476a86463530d0047699e64529b5 Mon Sep 17 00:00:00 2001 ++From bd60a4308f3ec1df20328887335b4c95f9be215d Mon Sep 17 00:00:00 2001 + From: =?UTF-8?q?Michael=20M=C3=BCller?= + Date: Sat, 4 Oct 2014 02:53:22 +0200 + Subject: [PATCH] ntdll: Setup a temporary signal handler during process +@@ -27,10 +27,10 @@ index 65c65cc02d8..63a4b597872 100644 + extern void debug_init(void) DECLSPEC_HIDDEN; + extern TEB *thread_init( SIZE_T *info_size, BOOL *suspend ) DECLSPEC_HIDDEN; + diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c +-index 8ff9f66d3f0..44e3d2df523 100644 ++index a09848449a6..c6f7231fec6 100644 + --- a/dlls/ntdll/signal_arm.c + +++ b/dlls/ntdll/signal_arm.c +-@@ -773,6 +773,12 @@ void signal_init_process(void) ++@@ -792,6 +792,12 @@ void signal_init_process(void) + exit(1); + } + +@@ -44,11 +44,11 @@ index 8ff9f66d3f0..44e3d2df523 100644 + /*********************************************************************** + * RtlUnwind (NTDLL.@) + diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c +-index 104ffbf6df9..e7c6abd0046 100644 ++index a9a58a2e7ad..a9c6614794e 100644 + --- a/dlls/ntdll/signal_arm64.c + +++ b/dlls/ntdll/signal_arm64.c +-@@ -1100,6 +1100,12 @@ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) +- return 0; ++@@ -1047,6 +1047,12 @@ static void usr2_handler( int signal, siginfo_t *siginfo, void *sigcontext ) ++ restore_context( context, sigcontext ); + } + + +/********************************************************************** +@@ -61,10 +61,10 @@ index 104ffbf6df9..e7c6abd0046 100644 + /********************************************************************** + * signal_init_process + diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c +-index 1b0b9352a87..0fe9f7a3c84 100644 ++index 83868f25121..b048b2bc688 100644 + --- a/dlls/ntdll/signal_i386.c + +++ b/dlls/ntdll/signal_i386.c +-@@ -1621,6 +1621,31 @@ static BOOL handle_interrupt( unsigned int interrupt, ucontext_t *sigcontext, st ++@@ -1575,6 +1575,31 @@ static BOOL handle_interrupt( unsigned int interrupt, ucontext_t *sigcontext, st + } + + +@@ -96,7 +96,7 @@ index 1b0b9352a87..0fe9f7a3c84 100644 + /********************************************************************** + * segv_handler + * +-@@ -1948,6 +1973,34 @@ void signal_init_process(void) ++@@ -1883,6 +1908,34 @@ void signal_init_process(void) + exit(1); + } + +@@ -132,11 +132,11 @@ index 1b0b9352a87..0fe9f7a3c84 100644 + /******************************************************************* + * RtlUnwind (NTDLL.@) + diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c +-index 7e73322cbeb..07f0b89f30a 100644 ++index 879b2b58c49..f17d6267102 100644 + --- a/dlls/ntdll/signal_powerpc.c + +++ b/dlls/ntdll/signal_powerpc.c +-@@ -637,6 +637,12 @@ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) +- return 0; ++@@ -634,6 +634,12 @@ static void quit_handler( int signal, siginfo_t *siginfo, void *sigcontext ) ++ unix_funcs->abort_thread(0); + } + + +/********************************************************************** +@@ -147,12 +147,12 @@ index 7e73322cbeb..07f0b89f30a 100644 + +} + + /********************************************************************** +- * signal_init_process ++ * usr1_handler + diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c +-index 0ccc7cbceb6..dc8a1a987c5 100644 ++index c6b0fbf618d..bb481ba1b81 100644 + --- a/dlls/ntdll/signal_x86_64.c + +++ b/dlls/ntdll/signal_x86_64.c +-@@ -2849,6 +2849,12 @@ void signal_init_process(void) ++@@ -2777,6 +2777,12 @@ void signal_init_process(void) + exit(1); + } + +@@ -166,7 +166,7 @@ index 0ccc7cbceb6..dc8a1a987c5 100644 + static ULONG64 get_int_reg( CONTEXT *context, int reg ) + { + diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c +-index 8918b39a9c5..a2f5df1b1c2 100644 ++index d045466f6d2..49daa33ca58 100644 + --- a/dlls/ntdll/thread.c + +++ b/dlls/ntdll/thread.c + @@ -186,6 +186,7 @@ TEB *thread_init( SIZE_T *info_size, BOOL *suspend ) +diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh +index c5ff8c0b3..9c2ce4ce0 100755 +--- a/patches/patchinstall.sh ++++ b/patches/patchinstall.sh +@@ -52,7 +52,7 @@ usage() + # Get the upstream commit sha + upstream_commit() + { +- echo "3cc3b445752902e07231900befc296f74ad6576e" ++ echo "17529582402ebe27ef975fc7dcb8353f4f95e629" + } + + # Show version information +@@ -183,7 +183,6 @@ patch_enable_all () + enable_ntdll_Junction_Points="$1" + enable_ntdll_Manifest_Range="$1" + enable_ntdll_NtAccessCheck="$1" +- enable_ntdll_NtContinue="$1" + enable_ntdll_NtDevicePath="$1" + enable_ntdll_NtQueryEaFile="$1" + enable_ntdll_NtQuerySection="$1" +@@ -648,9 +647,6 @@ patch_enable () + ntdll-NtAccessCheck) + enable_ntdll_NtAccessCheck="$2" + ;; +- ntdll-NtContinue) +- enable_ntdll_NtContinue="$2" +- ;; + ntdll-NtDevicePath) + enable_ntdll_NtDevicePath="$2" + ;; +@@ -1672,6 +1668,17 @@ if test "$enable_ntdll_Syscall_Emulation" -eq 1; then + enable_winebuild_Fake_Dlls=1 + fi + ++if test "$enable_winebuild_Fake_Dlls" -eq 1; then ++ if test "$enable_ntdll_WRITECOPY" -gt 1; then ++ abort "Patchset ntdll-WRITECOPY disabled, but winebuild-Fake_Dlls depends on that." ++ fi ++ if test "$enable_ws2_32_WSACleanup" -gt 1; then ++ abort "Patchset ws2_32-WSACleanup disabled, but winebuild-Fake_Dlls depends on that." ++ fi ++ enable_ntdll_WRITECOPY=1 ++ enable_ws2_32_WSACleanup=1 ++fi ++ + if test "$enable_ntdll_NtQueryEaFile" -eq 1; then + if test "$enable_ntdll_Junction_Points" -gt 1; then + abort "Patchset ntdll-Junction_Points disabled, but ntdll-NtQueryEaFile depends on that." +@@ -1686,24 +1693,6 @@ if test "$enable_ntdll_NtDevicePath" -eq 1; then + enable_ntdll_Pipe_SpecialCharacters=1 + fi + +-if test "$enable_ntdll_NtContinue" -eq 1; then +- if test "$enable_winebuild_Fake_Dlls" -gt 1; then +- abort "Patchset winebuild-Fake_Dlls disabled, but ntdll-NtContinue depends on that." +- fi +- enable_winebuild_Fake_Dlls=1 +-fi +- +-if test "$enable_winebuild_Fake_Dlls" -eq 1; then +- if test "$enable_ntdll_WRITECOPY" -gt 1; then +- abort "Patchset ntdll-WRITECOPY disabled, but winebuild-Fake_Dlls depends on that." +- fi +- if test "$enable_ws2_32_WSACleanup" -gt 1; then +- abort "Patchset ws2_32-WSACleanup disabled, but winebuild-Fake_Dlls depends on that." +- fi +- enable_ntdll_WRITECOPY=1 +- enable_ws2_32_WSACleanup=1 +-fi +- + if test "$enable_ntdll_Hide_Wine_Exports" -eq 1; then + if test "$enable_advapi32_Token_Integrity_Level" -gt 1; then + abort "Patchset advapi32-Token_Integrity_Level disabled, but ntdll-Hide_Wine_Exports depends on that." +@@ -3977,98 +3966,6 @@ if test "$enable_ntdll_NtAccessCheck" -eq 1; then + ) >> "$patchlist" + fi + +-# Patchset ws2_32-WSACleanup +-# | +-# | This patchset fixes the following Wine bugs: +-# | * [#18670] Properly close sockets when WSACleanup is called +-# | +-# | Modified files: +-# | * dlls/ntdll/ntdll.spec, dlls/ntdll/server.c, dlls/ntdll/unix/loader.c, dlls/ntdll/unix/server.c, +-# | dlls/ntdll/unix/unix_private.h, dlls/ntdll/unixlib.h, dlls/ws2_32/socket.c, dlls/ws2_32/tests/sock.c, +-# | include/wine/server.h, server/protocol.def, server/sock.c +-# | +-if test "$enable_ws2_32_WSACleanup" -eq 1; then +- patch_apply ws2_32-WSACleanup/0001-ws2_32-Proper-WSACleanup-implementation-using-winese.patch +- patch_apply ws2_32-WSACleanup/0002-ws2_32-Invalidate-client-side-file-descriptor-cache-.patch +- ( +- printf '%s\n' '+ { "Matt Durgavich", "ws2_32: Proper WSACleanup implementation using wineserver function.", 2 },'; +- printf '%s\n' '+ { "Sebastian Lackner", "ws2_32: Invalidate client-side file descriptor cache in WSACleanup.", 1 },'; +- ) >> "$patchlist" +-fi +- +-# Patchset winebuild-Fake_Dlls +-# | +-# | This patchset has the following (direct or indirect) dependencies: +-# | * ntdll-WRITECOPY, ws2_32-WSACleanup +-# | +-# | This patchset fixes the following Wine bugs: +-# | * [#21232] Chromium-based browser engines (Chrome, Opera, Comodo Dragon, SRWare Iron) crash on startup unless '--no- +-# | sandbox' is used (native API sandboxing/hooking scheme incompatible with Wine) +-# | * [#42741] StarCraft I: 1.18 PTR fails to initialize ClientSdk.dll +-# | * [#45349] Multiple applications and games crash due to missing support for 64-bit syscall thunks (StreetFighter V) +-# | * [#45573] League of Legends 8.12+ fails to start a game (anticheat engine, hooking of syscall return instructions) +-# | * [#45650] chromium 32-bit sandbox expects different syscall thunks depending on Windows version +-# | +-# | Modified files: +-# | * dlls/dbghelp/cpu_i386.c, dlls/kernel32/tests/loader.c, dlls/krnl386.exe16/kernel.c, +-# | dlls/krnl386.exe16/kernel16_private.h, dlls/krnl386.exe16/ne_module.c, dlls/krnl386.exe16/ne_segment.c, +-# | dlls/krnl386.exe16/task.c, dlls/krnl386.exe16/thunk.c, dlls/krnl386.exe16/wowthunk.c, dlls/ntdll/actctx.c, +-# | dlls/ntdll/directory.c, dlls/ntdll/loader.c, dlls/ntdll/locale.c, dlls/ntdll/ntdll_misc.h, dlls/ntdll/path.c, +-# | dlls/ntdll/process.c, dlls/ntdll/signal_i386.c, dlls/ntdll/tests/exception.c, dlls/ntdll/thread.c, +-# | dlls/ntdll/unix/thread.c, dlls/ntdll/unix/unix_private.h, dlls/ntdll/unix/virtual.c, dlls/ntdll/unixlib.h, +-# | dlls/system.drv16/system.c, dlls/toolhelp.dll16/toolhelp.c, dlls/user.exe16/message.c, dlls/user.exe16/user.c, +-# | dlls/user.exe16/window.c, include/winternl.h, libs/wine/loader.c, server/mapping.c, tools/winebuild/build.h, +-# | tools/winebuild/import.c, tools/winebuild/parser.c, tools/winebuild/relay.c, tools/winebuild/res32.c, +-# | tools/winebuild/spec16.c, tools/winebuild/spec32.c, tools/winebuild/utils.c +-# | +-if test "$enable_winebuild_Fake_Dlls" -eq 1; then +- patch_apply winebuild-Fake_Dlls/0001-kernel32-tests-Add-basic-tests-for-fake-dlls.patch +- patch_apply winebuild-Fake_Dlls/0002-krnl386.exe16-Do-not-abuse-WOW32Reserved-field-for-1.patch +- patch_apply winebuild-Fake_Dlls/0003-winebuild-Generate-syscall-thunks-for-ntdll-exports.patch +- patch_apply winebuild-Fake_Dlls/0004-winebuild-Use-multipass-label-system-to-generate-fak.patch +- patch_apply winebuild-Fake_Dlls/0005-winebuild-Add-stub-functions-in-fake-dlls.patch +- patch_apply winebuild-Fake_Dlls/0006-winebuild-Add-syscall-thunks-in-fake-dlls.patch +- patch_apply winebuild-Fake_Dlls/0007-winebuild-Fix-size-of-relocation-information-in-fake.patch +- patch_apply winebuild-Fake_Dlls/0008-winebuild-Try-to-make-sure-RVA-matches-between-fake-.patch +- patch_apply winebuild-Fake_Dlls/0009-libs-wine-Use-same-file-alignment-for-fake-and-built.patch +- patch_apply winebuild-Fake_Dlls/0010-tools-winebuild-Add-syscall-thunks-for-64-bit.patch +- patch_apply winebuild-Fake_Dlls/0011-ntdll-Call-NtOpenFile-through-syscall-thunk.patch +- ( +- printf '%s\n' '+ { "Michael Müller", "kernel32/tests: Add basic tests for fake dlls.", 1 },'; +- printf '%s\n' '+ { "Sebastian Lackner", "krnl386.exe16: Do not abuse WOW32Reserved field for 16-bit stack address.", 1 },'; +- printf '%s\n' '+ { "Michael Müller", "winebuild: Generate syscall thunks for ntdll exports.", 1 },'; +- printf '%s\n' '+ { "Michael Müller", "winebuild: Use multipass label system to generate fake dlls.", 1 },'; +- printf '%s\n' '+ { "Michael Müller", "winebuild: Add stub functions in fake dlls.", 1 },'; +- printf '%s\n' '+ { "Michael Müller", "winebuild: Add syscall thunks in fake dlls.", 1 },'; +- printf '%s\n' '+ { "Michael Müller", "winebuild: Fix size of relocation information in fake dlls.", 1 },'; +- printf '%s\n' '+ { "Michael Müller", "winebuild: Try to make sure RVA matches between fake and builtin DLLs.", 1 },'; +- printf '%s\n' '+ { "Michael Müller", "libs/wine: Use same file alignment for fake and builtin DLLs.", 1 },'; +- printf '%s\n' '+ { "Michael Müller", "tools/winebuild: Add syscall thunks for 64 bit.", 1 },'; +- printf '%s\n' '+ { "Paul Gofman", "ntdll: Call NtOpenFile through syscall thunk.", 1 },'; +- ) >> "$patchlist" +-fi +- +-# Patchset ntdll-NtContinue +-# | +-# | This patchset has the following (direct or indirect) dependencies: +-# | * ntdll-WRITECOPY, ws2_32-WSACleanup, winebuild-Fake_Dlls +-# | +-# | This patchset fixes the following Wine bugs: +-# | * [#31910] Add stub for NtContinue +-# | * [#45572] League of Legends 8.12+ fails to start a game (anticheat engine, hooking of NtContinue) +-# | +-# | Modified files: +-# | * dlls/ntdll/exception.c, dlls/ntdll/ntdll.spec, dlls/ntdll/signal_i386.c, dlls/ntdll/signal_x86_64.c +-# | +-if test "$enable_ntdll_NtContinue" -eq 1; then +- patch_apply ntdll-NtContinue/0001-ntdll-Add-stub-for-NtContinue.patch +- patch_apply ntdll-NtContinue/0002-Use-NtContinue-to-continue-execution-after-exception.patch +- ( +- printf '%s\n' '+ { "Michael Müller", "ntdll: Add stub for NtContinue.", 1 },'; +- printf '%s\n' '+ { "Andrew Wesie", "ntdll: Use NtContinue to continue execution after exceptions.", 1 },'; +- ) >> "$patchlist" +-fi +- + # Patchset ntdll-Pipe_SpecialCharacters + # | + # | This patchset fixes the following Wine bugs: +@@ -4213,6 +4110,77 @@ if test "$enable_ntdll_Status_Mapping" -eq 1; then + ) >> "$patchlist" + fi + ++# Patchset ws2_32-WSACleanup ++# | ++# | This patchset fixes the following Wine bugs: ++# | * [#18670] Properly close sockets when WSACleanup is called ++# | ++# | Modified files: ++# | * dlls/ntdll/ntdll.spec, dlls/ntdll/server.c, dlls/ntdll/unix/loader.c, dlls/ntdll/unix/server.c, ++# | dlls/ntdll/unix/unix_private.h, dlls/ntdll/unixlib.h, dlls/ws2_32/socket.c, dlls/ws2_32/tests/sock.c, ++# | include/wine/server.h, server/protocol.def, server/sock.c ++# | ++if test "$enable_ws2_32_WSACleanup" -eq 1; then ++ patch_apply ws2_32-WSACleanup/0001-ws2_32-Proper-WSACleanup-implementation-using-winese.patch ++ patch_apply ws2_32-WSACleanup/0002-ws2_32-Invalidate-client-side-file-descriptor-cache-.patch ++ ( ++ printf '%s\n' '+ { "Matt Durgavich", "ws2_32: Proper WSACleanup implementation using wineserver function.", 2 },'; ++ printf '%s\n' '+ { "Sebastian Lackner", "ws2_32: Invalidate client-side file descriptor cache in WSACleanup.", 1 },'; ++ ) >> "$patchlist" ++fi ++ ++# Patchset winebuild-Fake_Dlls ++# | ++# | This patchset has the following (direct or indirect) dependencies: ++# | * ntdll-WRITECOPY, ws2_32-WSACleanup ++# | ++# | This patchset fixes the following Wine bugs: ++# | * [#21232] Chromium-based browser engines (Chrome, Opera, Comodo Dragon, SRWare Iron) crash on startup unless '--no- ++# | sandbox' is used (native API sandboxing/hooking scheme incompatible with Wine) ++# | * [#42741] StarCraft I: 1.18 PTR fails to initialize ClientSdk.dll ++# | * [#45349] Multiple applications and games crash due to missing support for 64-bit syscall thunks (StreetFighter V) ++# | * [#45573] League of Legends 8.12+ fails to start a game (anticheat engine, hooking of syscall return instructions) ++# | * [#45650] chromium 32-bit sandbox expects different syscall thunks depending on Windows version ++# | ++# | Modified files: ++# | * dlls/dbghelp/cpu_i386.c, dlls/kernel32/tests/loader.c, dlls/krnl386.exe16/kernel.c, ++# | dlls/krnl386.exe16/kernel16_private.h, dlls/krnl386.exe16/ne_module.c, dlls/krnl386.exe16/ne_segment.c, ++# | dlls/krnl386.exe16/task.c, dlls/krnl386.exe16/thunk.c, dlls/krnl386.exe16/wowthunk.c, dlls/ntdll/actctx.c, ++# | dlls/ntdll/directory.c, dlls/ntdll/loader.c, dlls/ntdll/locale.c, dlls/ntdll/ntdll_misc.h, dlls/ntdll/path.c, ++# | dlls/ntdll/process.c, dlls/ntdll/signal_i386.c, dlls/ntdll/tests/exception.c, dlls/ntdll/thread.c, ++# | dlls/ntdll/unix/thread.c, dlls/ntdll/unix/unix_private.h, dlls/ntdll/unix/virtual.c, dlls/ntdll/unixlib.h, ++# | dlls/system.drv16/system.c, dlls/toolhelp.dll16/toolhelp.c, dlls/user.exe16/message.c, dlls/user.exe16/user.c, ++# | dlls/user.exe16/window.c, include/winternl.h, libs/wine/loader.c, server/mapping.c, tools/winebuild/build.h, ++# | tools/winebuild/import.c, tools/winebuild/parser.c, tools/winebuild/relay.c, tools/winebuild/res32.c, ++# | tools/winebuild/spec16.c, tools/winebuild/spec32.c, tools/winebuild/utils.c ++# | ++if test "$enable_winebuild_Fake_Dlls" -eq 1; then ++ patch_apply winebuild-Fake_Dlls/0001-kernel32-tests-Add-basic-tests-for-fake-dlls.patch ++ patch_apply winebuild-Fake_Dlls/0002-krnl386.exe16-Do-not-abuse-WOW32Reserved-field-for-1.patch ++ patch_apply winebuild-Fake_Dlls/0003-winebuild-Generate-syscall-thunks-for-ntdll-exports.patch ++ patch_apply winebuild-Fake_Dlls/0004-winebuild-Use-multipass-label-system-to-generate-fak.patch ++ patch_apply winebuild-Fake_Dlls/0005-winebuild-Add-stub-functions-in-fake-dlls.patch ++ patch_apply winebuild-Fake_Dlls/0006-winebuild-Add-syscall-thunks-in-fake-dlls.patch ++ patch_apply winebuild-Fake_Dlls/0007-winebuild-Fix-size-of-relocation-information-in-fake.patch ++ patch_apply winebuild-Fake_Dlls/0008-winebuild-Try-to-make-sure-RVA-matches-between-fake-.patch ++ patch_apply winebuild-Fake_Dlls/0009-libs-wine-Use-same-file-alignment-for-fake-and-built.patch ++ patch_apply winebuild-Fake_Dlls/0010-tools-winebuild-Add-syscall-thunks-for-64-bit.patch ++ patch_apply winebuild-Fake_Dlls/0011-ntdll-Call-NtOpenFile-through-syscall-thunk.patch ++ ( ++ printf '%s\n' '+ { "Michael Müller", "kernel32/tests: Add basic tests for fake dlls.", 1 },'; ++ printf '%s\n' '+ { "Sebastian Lackner", "krnl386.exe16: Do not abuse WOW32Reserved field for 16-bit stack address.", 1 },'; ++ printf '%s\n' '+ { "Michael Müller", "winebuild: Generate syscall thunks for ntdll exports.", 1 },'; ++ printf '%s\n' '+ { "Michael Müller", "winebuild: Use multipass label system to generate fake dlls.", 1 },'; ++ printf '%s\n' '+ { "Michael Müller", "winebuild: Add stub functions in fake dlls.", 1 },'; ++ printf '%s\n' '+ { "Michael Müller", "winebuild: Add syscall thunks in fake dlls.", 1 },'; ++ printf '%s\n' '+ { "Michael Müller", "winebuild: Fix size of relocation information in fake dlls.", 1 },'; ++ printf '%s\n' '+ { "Michael Müller", "winebuild: Try to make sure RVA matches between fake and builtin DLLs.", 1 },'; ++ printf '%s\n' '+ { "Michael Müller", "libs/wine: Use same file alignment for fake and builtin DLLs.", 1 },'; ++ printf '%s\n' '+ { "Michael Müller", "tools/winebuild: Add syscall thunks for 64 bit.", 1 },'; ++ printf '%s\n' '+ { "Paul Gofman", "ntdll: Call NtOpenFile through syscall thunk.", 1 },'; ++ ) >> "$patchlist" ++fi ++ + # Patchset ntdll-Syscall_Emulation + # | + # | This patchset has the following (direct or indirect) dependencies: +diff --git a/patches/winebuild-Fake_Dlls/0003-winebuild-Generate-syscall-thunks-for-ntdll-exports.patch b/patches/winebuild-Fake_Dlls/0003-winebuild-Generate-syscall-thunks-for-ntdll-exports.patch +index 751b497da..684c28e16 100644 +--- a/patches/winebuild-Fake_Dlls/0003-winebuild-Generate-syscall-thunks-for-ntdll-exports.patch ++++ b/patches/winebuild-Fake_Dlls/0003-winebuild-Generate-syscall-thunks-for-ntdll-exports.patch +@@ -1,4 +1,4 @@ +-From 1fec139d96f32869fc0c8d15219fff493d9951d8 Mon Sep 17 00:00:00 2001 ++From e60eb454ecfb4c043a585c1ecd2970c92be1c664 Mon Sep 17 00:00:00 2001 + From: =?UTF-8?q?Michael=20M=C3=BCller?= + Date: Thu, 11 May 2017 05:32:55 +0200 + Subject: [PATCH] winebuild: Generate syscall thunks for ntdll exports. +@@ -22,7 +22,7 @@ Based on a patch by Erich E. Hoover. + 14 files changed, 214 insertions(+), 32 deletions(-) + + diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c +-index 45d32399adf..b42cff8bcd4 100644 ++index ffbc9fabb23..a633099877d 100644 + --- a/dlls/ntdll/loader.c + +++ b/dlls/ntdll/loader.c + @@ -3810,6 +3810,7 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule) +@@ -33,7 +33,7 @@ index 45d32399adf..b42cff8bcd4 100644 + + /****************************************************************** + * LdrInitializeThunk (NTDLL.@) +-@@ -3827,6 +3828,8 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow ++@@ -3826,6 +3827,8 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow + WINE_MODREF *wm; + LPCWSTR load_path = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer; + +@@ -43,19 +43,19 @@ index 45d32399adf..b42cff8bcd4 100644 + + if (process_detaching) return; + diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c +-index be88d9bf3c7..84ab7991886 100644 ++index 3be6342a945..85329be4f42 100644 + --- a/dlls/ntdll/signal_i386.c + +++ b/dlls/ntdll/signal_i386.c +-@@ -448,6 +448,8 @@ static ULONG first_ldt_entry = 32; ++@@ -444,6 +444,8 @@ struct stack_layout + +- static wine_signal_handler handlers[256]; ++ static ULONG first_ldt_entry = 32; + + +extern NTSTATUS WINAPI __syscall_NtGetContextThread( HANDLE handle, CONTEXT *context ); + + + enum i386_trap_code + { + TRAP_x86_UNKNOWN = -1, /* Unknown fault (TRAP_sig not defined) */ +-@@ -1159,7 +1161,7 @@ NTSTATUS CDECL DECLSPEC_HIDDEN __regs_NtGetContextThread( DWORD edi, DWORD esi, ++@@ -1127,7 +1129,7 @@ NTSTATUS CDECL DECLSPEC_HIDDEN __regs_NtGetContextThread( DWORD edi, DWORD esi, + { + context->Ebp = ebp; + context->Esp = (DWORD)&retaddr; +@@ -78,7 +78,7 @@ index a5e6faa461a..51938bf84cc 100644 + ok( context.SegCs == LOWORD(expect.SegCs), "wrong SegCs %08x/%08x\n", context.SegCs, expect.SegCs ); + ok( context.SegDs == LOWORD(expect.SegDs), "wrong SegDs %08x/%08x\n", context.SegDs, expect.SegDs ); + diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c +-index 79d13a01a86..94eb6d1252d 100644 ++index 49daa33ca58..17b5d40215a 100644 + --- a/dlls/ntdll/thread.c + +++ b/dlls/ntdll/thread.c + @@ -173,6 +173,7 @@ int __cdecl __wine_dbg_output( const char *str ) +@@ -99,10 +99,10 @@ index 79d13a01a86..94eb6d1252d 100644 + peb = teb->Peb; + peb->FastPebLock = &peb_lock; + diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c +-index b6458da61ad..a158ec20a6a 100644 ++index d4b7a51a627..bdc87e4b9cf 100644 + --- a/dlls/ntdll/unix/thread.c + +++ b/dlls/ntdll/unix/thread.c +-@@ -83,7 +83,7 @@ static void pthread_exit_wrapper( int status ) ++@@ -85,7 +85,7 @@ static void pthread_exit_wrapper( int status ) + * init_threading + */ + TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, BOOL *suspend, +@@ -111,7 +111,7 @@ index b6458da61ad..a158ec20a6a 100644 + { + TEB *teb; + SIZE_T info_size; +-@@ -95,6 +95,7 @@ TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZ ++@@ -97,6 +97,7 @@ TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZ + nb_threads = nb_threads_ptr; + + teb = virtual_alloc_first_teb(); +@@ -120,10 +120,10 @@ index b6458da61ad..a158ec20a6a 100644 + thread_data->request_fd = -1; + thread_data->reply_fd = -1; + diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h +-index 880e3aacf33..6c7b961e95a 100644 ++index 19104f0f5cc..bdf8bc99e3f 100644 + --- a/dlls/ntdll/unix/unix_private.h + +++ b/dlls/ntdll/unix/unix_private.h +-@@ -96,7 +96,7 @@ extern void CDECL server_release_fd( HANDLE handle, int unix_fd ) DECLSPEC_HIDDE ++@@ -101,7 +101,7 @@ extern void CDECL server_release_fd( HANDLE handle, int unix_fd ) DECLSPEC_HIDDE + extern void CDECL server_init_process_done(void) DECLSPEC_HIDDEN; + extern TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, + BOOL *suspend, unsigned int *cpus, BOOL *wow64, +@@ -133,19 +133,19 @@ index 880e3aacf33..6c7b961e95a 100644 + extern void CDECL DECLSPEC_NORETURN abort_thread( int status ) DECLSPEC_HIDDEN; + extern void CDECL DECLSPEC_NORETURN exit_thread( int status ) DECLSPEC_HIDDEN; + diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h +-index 83c9f3a163b..63728b1c071 100644 ++index 6a751993421..4e39ed53786 100644 + --- a/dlls/ntdll/unixlib.h + +++ b/dlls/ntdll/unixlib.h + @@ -28,7 +28,7 @@ struct ldt_copy; + struct msghdr; + + /* increment this when you change the function table */ +--#define NTDLL_UNIXLIB_VERSION 31 +-+#define NTDLL_UNIXLIB_VERSION 32 ++-#define NTDLL_UNIXLIB_VERSION 33 +++#define NTDLL_UNIXLIB_VERSION 34 + + struct unix_funcs + { +-@@ -172,7 +172,7 @@ struct unix_funcs ++@@ -174,7 +174,7 @@ struct unix_funcs + + /* thread/process functions */ + TEB * (CDECL *init_threading)( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, +diff --git a/patches/ws2_32-WSACleanup/0002-ws2_32-Invalidate-client-side-file-descriptor-cache-.patch b/patches/ws2_32-WSACleanup/0002-ws2_32-Invalidate-client-side-file-descriptor-cache-.patch +index 25c315648..0861f99c0 100644 +--- a/patches/ws2_32-WSACleanup/0002-ws2_32-Invalidate-client-side-file-descriptor-cache-.patch ++++ b/patches/ws2_32-WSACleanup/0002-ws2_32-Invalidate-client-side-file-descriptor-cache-.patch +@@ -1,4 +1,4 @@ +-From 1bb20ff5903d8d5e81e8a2b7b22bf67b189b16ec Mon Sep 17 00:00:00 2001 ++From 20661308a50202350a3a2887cbd558b1e931aad1 Mon Sep 17 00:00:00 2001 + From: Sebastian Lackner + Date: Sun, 6 Sep 2015 12:41:17 +0200 + Subject: [PATCH] ws2_32: Invalidate client-side file descriptor cache in +@@ -17,7 +17,7 @@ Subject: [PATCH] ws2_32: Invalidate client-side file descriptor cache in + 9 files changed, 36 insertions(+), 5 deletions(-) + + diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec +-index c4d78128758..3d6c8850086 100644 ++index ce5c580bd54..279845ae830 100644 + --- a/dlls/ntdll/ntdll.spec + +++ b/dlls/ntdll/ntdll.spec + @@ -1576,6 +1576,7 @@ +@@ -48,10 +48,10 @@ index 6fb86a68d6f..2f95e190963 100644 + /*********************************************************************** + * server_init_process + diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c +-index b5ee692024c..d8827b147df 100644 ++index 618e3d6adb3..bdda739897b 100644 + --- a/dlls/ntdll/unix/loader.c + +++ b/dlls/ntdll/unix/loader.c +-@@ -1074,6 +1074,7 @@ static struct unix_funcs unix_funcs = ++@@ -1076,6 +1076,7 @@ static struct unix_funcs unix_funcs = + server_select, + server_wait, + server_send_fd, +@@ -91,10 +91,10 @@ index fb3f98dd579..0754928cfe8 100644 + /*********************************************************************** + * server_get_unix_fd + diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h +-index a422fd825ed..880e3aacf33 100644 ++index 03b92f9e912..19104f0f5cc 100644 + --- a/dlls/ntdll/unix/unix_private.h + +++ b/dlls/ntdll/unix/unix_private.h +-@@ -84,6 +84,7 @@ extern unsigned int CDECL server_select( const select_op_t *select_op, data_size ++@@ -89,6 +89,7 @@ extern unsigned int CDECL server_select( const select_op_t *select_op, data_size + extern unsigned int CDECL server_wait( const select_op_t *select_op, data_size_t size, UINT flags, + const LARGE_INTEGER *timeout ) DECLSPEC_HIDDEN; + extern void CDECL server_send_fd( int fd ) DECLSPEC_HIDDEN; +@@ -103,19 +103,19 @@ index a422fd825ed..880e3aacf33 100644 + int *needs_close, enum server_fd_type *type, + unsigned int *options ) DECLSPEC_HIDDEN; + diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h +-index 58bdad19397..83c9f3a163b 100644 ++index 017a0a71b3f..6a751993421 100644 + --- a/dlls/ntdll/unixlib.h + +++ b/dlls/ntdll/unixlib.h + @@ -28,7 +28,7 @@ struct ldt_copy; + struct msghdr; + + /* increment this when you change the function table */ +--#define NTDLL_UNIXLIB_VERSION 30 +-+#define NTDLL_UNIXLIB_VERSION 31 ++-#define NTDLL_UNIXLIB_VERSION 32 +++#define NTDLL_UNIXLIB_VERSION 33 + + struct unix_funcs + { +-@@ -187,6 +187,7 @@ struct unix_funcs ++@@ -189,6 +189,7 @@ struct unix_funcs + unsigned int (CDECL *server_wait)( const select_op_t *select_op, data_size_t size, UINT flags, + const LARGE_INTEGER *timeout ); + void (CDECL *server_send_fd)( int fd ); +diff --git a/staging/upstream-commit b/staging/upstream-commit +index f51939b28..8b37e5310 100644 +--- a/staging/upstream-commit ++++ b/staging/upstream-commit +@@ -1 +1 @@ +-3cc3b445752902e07231900befc296f74ad6576e ++17529582402ebe27ef975fc7dcb8353f4f95e629 diff --git a/wine-staging-5.10-ntdll-arm.patch b/wine-staging-5.10-ntdll-arm1.patch similarity index 100% rename from wine-staging-5.10-ntdll-arm.patch rename to wine-staging-5.10-ntdll-arm1.patch diff --git a/wine.spec b/wine.spec index a2d6c1f..4308871 100644 --- a/wine.spec +++ b/wine.spec @@ -76,7 +76,8 @@ Source150: wine.appdata.xml # wine bugs Patch100: wine-staging-5.10-ntdll.patch -Patch101: wine-staging-5.10-ntdll-arm.patch +Patch101: wine-staging-5.10-ntdll-arm0.patch +Patch102: wine-staging-5.10-ntdll-arm1.patch # desktop dir Source200: wine.menu @@ -695,7 +696,8 @@ This package adds the opencl driver for wine. # setup and apply wine-staging patches gzip -dc %{SOURCE900} | tar -xf - --strip-components=1 %patch100 -p1 -b.ntdll -%patch101 -p1 -b.ntdll-arm +%patch101 -p1 -b.ntdll-arm0 +%patch102 -p1 -b.ntdll-arm1 patches/patchinstall.sh DESTDIR="`pwd`" --all