From c81093882b2b9ce4a5830437cecdc58b8807d29b Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 1 Jun 2020 22:31:00 -0500 Subject: [PATCH] Rebase against 3c86adab766e3bc7c91da088c2dd6bc41a917055. --- .../0001-ntdll-Add-dummy-apiset-to-PEB.patch | 14 ++-- ...tectVirtualMemory-and-NtCreateSectio.patch | 16 ++--- patches/ntdll-ForceBottomUpAlloc/definition | 2 +- ...ive-symlinks-before-returning-sectio.patch | 18 ++--- ...0001-ntdll-Implement-NtSetLdtEntries.patch | 24 +++---- ...Allow-to-modify-reserved-LDT-entries.patch | 22 +++--- ...dll-Support-x86_64-syscall-emulation.patch | 29 +++----- ...ss-virtual-memory-counters-in-NtQuer.patch | 22 +++--- ...ondition-when-threads-are-killed-dur.patch | 14 ++-- ...mporary-signal-handler-during-proces.patch | 44 ++++++------ patches/patchinstall.sh | 47 ++----------- ...ate-syscall-thunks-for-ntdll-exports.patch | 68 ++++++++++++------- ...uild-Add-stub-functions-in-fake-dlls.patch | 62 +++++++++-------- ...ebuild-Add-syscall-thunks-for-64-bit.patch | 39 +++-------- ...ice-Load-some-common-drivers-and-fix.patch | 16 ++--- ...e-client-side-file-descriptor-cache-.patch | 42 ++++++------ staging/upstream-commit | 2 +- 17 files changed, 224 insertions(+), 257 deletions(-) diff --git a/patches/ntdll-ApiSetMap/0001-ntdll-Add-dummy-apiset-to-PEB.patch b/patches/ntdll-ApiSetMap/0001-ntdll-Add-dummy-apiset-to-PEB.patch index b4a9bca1..3987c7cd 100644 --- a/patches/ntdll-ApiSetMap/0001-ntdll-Add-dummy-apiset-to-PEB.patch +++ b/patches/ntdll-ApiSetMap/0001-ntdll-Add-dummy-apiset-to-PEB.patch @@ -1,4 +1,4 @@ -From 8c3c4edd9393b71f66501a9972ee6e6b4f60aeb5 Mon Sep 17 00:00:00 2001 +From 708e627172f61b5d0744135e31d4e9e3f7b32536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Mon, 3 Apr 2017 01:06:26 +0200 Subject: [PATCH] ntdll: Add dummy apiset to PEB. @@ -12,19 +12,19 @@ Subject: [PATCH] ntdll: Add dummy apiset to PEB. create mode 100644 include/apiset.h diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index ca8b5e2bf8a..565dea14b39 100644 +index 21e8b0c08f8..24254d4b43c 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c -@@ -75,6 +75,7 @@ static PEB_LDR_DATA ldr; +@@ -71,6 +71,7 @@ static PEB_LDR_DATA ldr; static RTL_BITMAP tls_bitmap; static RTL_BITMAP tls_expansion_bitmap; static RTL_BITMAP fls_bitmap; +static API_SET_NAMESPACE_ARRAY apiset_map; static int nb_threads = 1; - static RTL_CRITICAL_SECTION peb_lock; + struct ldt_copy *__wine_ldt_copy = NULL; @@ -300,6 +301,7 @@ TEB *thread_init(void) - teb = virtual_alloc_first_teb(); + peb = teb->Peb; peb->FastPebLock = &peb_lock; + peb->ApiSetMap = &apiset_map; @@ -32,7 +32,7 @@ index ca8b5e2bf8a..565dea14b39 100644 peb->TlsExpansionBitmap = &tls_expansion_bitmap; peb->FlsBitmap = &fls_bitmap; diff --git a/include/Makefile.in b/include/Makefile.in -index 74db5ee1516..f250ea74d4b 100644 +index 9796dd8e5d9..2bc410f4308 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -15,6 +15,7 @@ SOURCES = \ @@ -87,7 +87,7 @@ index 00000000000..6801cd5f509 + +#endif diff --git a/include/winternl.h b/include/winternl.h -index 87d0bde2955..eab44d1a57a 100644 +index f362790dbca..b33e346885f 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -23,6 +23,7 @@ diff --git a/patches/ntdll-Fix_Alignment/0001-ntdll-Move-NtProtectVirtualMemory-and-NtCreateSectio.patch b/patches/ntdll-Fix_Alignment/0001-ntdll-Move-NtProtectVirtualMemory-and-NtCreateSectio.patch index aa940f9d..270c82fd 100644 --- a/patches/ntdll-Fix_Alignment/0001-ntdll-Move-NtProtectVirtualMemory-and-NtCreateSectio.patch +++ b/patches/ntdll-Fix_Alignment/0001-ntdll-Move-NtProtectVirtualMemory-and-NtCreateSectio.patch @@ -1,20 +1,20 @@ -From 89a4ee827b74d8e4d63ca3e1354d89d75cc0fc19 Mon Sep 17 00:00:00 2001 +From 554f37a5ee79939ba9368e9bd7ea408860a32803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Wed, 20 Aug 2014 19:21:18 +0200 -Subject: ntdll: Move NtProtectVirtualMemory and NtCreateSection to separate - pages on x86. (try 2) +Subject: [PATCH] ntdll: Move NtProtectVirtualMemory and NtCreateSection to + separate pages on x86. (try 2) --- dlls/ntdll/virtual.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c -index ce2469829b0..eb2dbe8a2cd 100644 +index cfe30bbe710..6173846cfb4 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c -@@ -168,6 +168,14 @@ static void *preload_reserve_end; - static BOOL use_locks; - static BOOL force_exec_prot; /* whether to force PROT_EXEC on all PROT_READ mmaps */ +@@ -366,6 +366,14 @@ static void free_ranges_remove_view( struct file_view *view ) + } + +#if defined(__i386__) +NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *size_ptr, @@ -28,5 +28,5 @@ index ce2469829b0..eb2dbe8a2cd 100644 { return !(view->protect & (SEC_FILE | SEC_RESERVE | SEC_COMMIT)); -- -2.14.1 +2.26.2 diff --git a/patches/ntdll-ForceBottomUpAlloc/definition b/patches/ntdll-ForceBottomUpAlloc/definition index fe758c9e..c58d53a5 100644 --- a/patches/ntdll-ForceBottomUpAlloc/definition +++ b/patches/ntdll-ForceBottomUpAlloc/definition @@ -1,3 +1,3 @@ Fixes: [48175] AION (64 bit) - crashes in crysystem.dll.CryFree() due to high memory pointers allocated Fixes: [46568] 64-bit msxml6.dll from Microsoft Core XML Services 6.0 redist package fails to load (Wine doesn't respect 44-bit user-mode VA limitation from Windows < 8.1) - +Disabled: true diff --git a/patches/ntdll-NtQueryVirtualMemory/0008-ntdll-Resolve-drive-symlinks-before-returning-sectio.patch b/patches/ntdll-NtQueryVirtualMemory/0008-ntdll-Resolve-drive-symlinks-before-returning-sectio.patch index 28506cf8..b125f578 100644 --- a/patches/ntdll-NtQueryVirtualMemory/0008-ntdll-Resolve-drive-symlinks-before-returning-sectio.patch +++ b/patches/ntdll-NtQueryVirtualMemory/0008-ntdll-Resolve-drive-symlinks-before-returning-sectio.patch @@ -1,4 +1,4 @@ -From bf09af2ce4e625b3dcc7e8072e822100d80fb3e2 Mon Sep 17 00:00:00 2001 +From 70785e15d5f0344c186714e859595b667dc34a07 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sun, 28 May 2017 11:17:26 +0200 Subject: [PATCH] ntdll: Resolve drive symlinks before returning section name. @@ -11,7 +11,7 @@ Subject: [PATCH] ntdll: Resolve drive symlinks before returning section name. 4 files changed, 34 insertions(+), 12 deletions(-) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c -index eb7f3bc3718..0412824c811 100644 +index 453568d641e..12da4316e88 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -2798,7 +2798,7 @@ static NTSTATUS nt_to_unix_file_name_internal( const UNICODE_STRING *nameW, ANSI @@ -24,19 +24,19 @@ index eb7f3bc3718..0412824c811 100644 OBJECT_ATTRIBUTES attr; UNICODE_STRING targetW; diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index 76e8ec284e8..1defe6c807a 100644 +index 427cdaad441..f92adb0c0dc 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h -@@ -194,6 +194,7 @@ extern NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, ANSI_S +@@ -177,6 +177,7 @@ extern NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, ANSI_S + UINT disposition ) DECLSPEC_HIDDEN; + /* virtual memory */ - extern NTSTATUS virtual_alloc( PVOID *ret, unsigned short zero_bits_64, SIZE_T *size_ptr, - ULONG type, ULONG protect ) DECLSPEC_HIDDEN; +extern NTSTATUS read_nt_symlink( HANDLE root, UNICODE_STRING *name, WCHAR *target, size_t length ) DECLSPEC_HIDDEN; extern NTSTATUS virtual_map_section( HANDLE handle, PVOID *addr_ptr, unsigned short zero_bits_64, SIZE_T commit_size, const LARGE_INTEGER *offset_ptr, SIZE_T *size_ptr, ULONG alloc_type, ULONG protect, pe_image_info_t *image_info ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c -index 01ae8b06dac..ad5759884da 100644 +index fb9a1a57729..89ed3bb3f0b 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -188,6 +188,8 @@ static BYTE **pages_vprot; @@ -48,7 +48,7 @@ index 01ae8b06dac..ad5759884da 100644 static struct file_view *view_block_start, *view_block_end, *next_free_view; static const size_t view_block_size = 0x100000; static void *preload_reserve_start; -@@ -3308,12 +3310,15 @@ static NTSTATUS get_section_name( HANDLE process, LPCVOID addr, +@@ -3471,12 +3473,15 @@ static NTSTATUS get_section_name( HANDLE process, LPCVOID addr, MEMORY_SECTION_NAME *info, SIZE_T len, SIZE_T *res_len ) { @@ -65,7 +65,7 @@ index 01ae8b06dac..ad5759884da 100644 if (!addr || !info || !res_len) return STATUS_INVALID_PARAMETER; -@@ -3372,14 +3377,34 @@ static NTSTATUS get_section_name( HANDLE process, LPCVOID addr, +@@ -3535,14 +3540,34 @@ static NTSTATUS get_section_name( HANDLE process, LPCVOID addr, } found: diff --git a/patches/ntdll-NtSetLdtEntries/0001-ntdll-Implement-NtSetLdtEntries.patch b/patches/ntdll-NtSetLdtEntries/0001-ntdll-Implement-NtSetLdtEntries.patch index 611b5ea6..8b4edd8c 100644 --- a/patches/ntdll-NtSetLdtEntries/0001-ntdll-Implement-NtSetLdtEntries.patch +++ b/patches/ntdll-NtSetLdtEntries/0001-ntdll-Implement-NtSetLdtEntries.patch @@ -1,15 +1,15 @@ -From 8abf5d134499aaf9dc87daa657cfe87586ad8ded Mon Sep 17 00:00:00 2001 +From f444edc19e67ef0a903728804f50e13ccbfac16e Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Thu, 28 Apr 2016 18:14:36 +0800 Subject: [PATCH] ntdll: Implement NtSetLdtEntries. --- - dlls/kernel32/tests/thread.c | 79 ++++++++++++++++++++++++++++++++++++ - dlls/ntdll/signal_i386.c | 2 +- + dlls/kernel32/tests/thread.c | 79 +++++++++++++++++++++++++++++++++++ + dlls/ntdll/unix/signal_i386.c | 2 +- 2 files changed, 80 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c -index 2dd274e0c10..ae67a9aa0a0 100644 +index a9869863b44..2c2a0fda843 100644 --- a/dlls/kernel32/tests/thread.c +++ b/dlls/kernel32/tests/thread.c @@ -99,6 +99,7 @@ static BOOL (WINAPI *pSetThreadGroupAffinity)(HANDLE,const GROUP_AFFINITY*,GROUP @@ -20,7 +20,7 @@ index 2dd274e0c10..ae67a9aa0a0 100644 static HANDLE create_target_process(const char *arg) { -@@ -1276,6 +1277,82 @@ static void test_GetThreadSelectorEntry(void) +@@ -1278,6 +1279,82 @@ static void test_GetThreadSelectorEntry(void) ok(entry.HighWord.Bits.Granularity == 1, "expected 1, got %u\n", entry.HighWord.Bits.Granularity); } @@ -103,7 +103,7 @@ index 2dd274e0c10..ae67a9aa0a0 100644 #endif /* __i386__ */ static HANDLE finish_event; -@@ -2338,6 +2415,7 @@ static void init_funcs(void) +@@ -2340,6 +2417,7 @@ static void init_funcs(void) X(NtQueryInformationThread); X(RtlGetThreadErrorMode); X(NtSetInformationThread); @@ -111,7 +111,7 @@ index 2dd274e0c10..ae67a9aa0a0 100644 } #undef X } -@@ -2393,6 +2471,7 @@ START_TEST(thread) +@@ -2396,6 +2474,7 @@ START_TEST(thread) test_SetThreadContext(); test_GetThreadSelectorEntry(); test_GetThreadContext(); @@ -119,11 +119,11 @@ index 2dd274e0c10..ae67a9aa0a0 100644 #endif test_QueueUserWorkItem(); test_RegisterWaitForSingleObject(); -diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c -index 441ef579609..eb28d668279 100644 ---- a/dlls/ntdll/signal_i386.c -+++ b/dlls/ntdll/signal_i386.c -@@ -2533,7 +2533,7 @@ NTSTATUS get_thread_ldt_entry( HANDLE handle, void *data, ULONG len, ULONG *ret_ +diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c +index 320ffa68407..a52490a096b 100644 +--- a/dlls/ntdll/unix/signal_i386.c ++++ b/dlls/ntdll/unix/signal_i386.c +@@ -480,7 +480,7 @@ NTSTATUS CDECL get_thread_ldt_entry( HANDLE handle, void *data, ULONG len, ULONG if (reply->flags) info->Entry = ldt_make_entry( (void *)reply->base, reply->limit, reply->flags ); else diff --git a/patches/ntdll-NtSetLdtEntries/0002-libs-wine-Allow-to-modify-reserved-LDT-entries.patch b/patches/ntdll-NtSetLdtEntries/0002-libs-wine-Allow-to-modify-reserved-LDT-entries.patch index 9a4adcb0..1b87d3de 100644 --- a/patches/ntdll-NtSetLdtEntries/0002-libs-wine-Allow-to-modify-reserved-LDT-entries.patch +++ b/patches/ntdll-NtSetLdtEntries/0002-libs-wine-Allow-to-modify-reserved-LDT-entries.patch @@ -1,4 +1,4 @@ -From 09846b453dae490f5496a6ca2ac110b712542357 Mon Sep 17 00:00:00 2001 +From f4d2bffd85329aed25b1add735fafd4efa69e7e3 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Thu, 28 Apr 2016 17:01:16 +0200 Subject: [PATCH] libs/wine: Allow to modify reserved LDT entries. @@ -16,16 +16,16 @@ WINE_LDT_FLAGS_ALLOCATED, otherwise get_selector_entry() server call returns entries without that flag set and NtQueryInformationThread(ThreadDescriptorTableEntry) fails. --- - dlls/kernel32/tests/thread.c | 4 ---- - dlls/ntdll/signal_i386.c | 2 -- - libs/wine/ldt.c | 4 +--- + dlls/kernel32/tests/thread.c | 4 ---- + dlls/ntdll/unix/signal_i386.c | 2 -- + libs/wine/ldt.c | 4 +--- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c -index ae67a9aa0a0..6149be8cf4a 100644 +index 2c2a0fda843..dae3d8d97d7 100644 --- a/dlls/kernel32/tests/thread.c +++ b/dlls/kernel32/tests/thread.c -@@ -1339,16 +1339,12 @@ static void test_NtSetLdtEntries(void) +@@ -1341,16 +1341,12 @@ static void test_NtSetLdtEntries(void) { memset(&sel.entry, 0x9a, sizeof(sel.entry)); ret = GetThreadSelectorEntry(GetCurrentThread(), 0x000f, &sel.entry); @@ -42,11 +42,11 @@ index ae67a9aa0a0..6149be8cf4a 100644 ok(!memcmp(&ds_entry, &sel.entry, sizeof(ds_entry)), "entries do not match\n"); } } -diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c -index 98ce76c8e27..e31c3d6b0b8 100644 ---- a/dlls/ntdll/signal_i386.c -+++ b/dlls/ntdll/signal_i386.c -@@ -2534,8 +2534,6 @@ NTSTATUS WINAPI NtSetLdtEntries( ULONG sel1, LDT_ENTRY entry1, ULONG sel2, LDT_E +diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c +index a52490a096b..7b04be577ab 100644 +--- a/dlls/ntdll/unix/signal_i386.c ++++ b/dlls/ntdll/unix/signal_i386.c +@@ -502,8 +502,6 @@ NTSTATUS WINAPI NtSetLdtEntries( ULONG sel1, LDT_ENTRY entry1, ULONG sel2, LDT_E sigset_t sigset; if (sel1 >> 16 || sel2 >> 16) return STATUS_INVALID_LDT_DESCRIPTOR; 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 dbb40f85..f38451b0 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 e193e84b7fb97f6f734b19d5bf2feb403d832abe Mon Sep 17 00:00:00 2001 +From 06b1233cbd6d149b30958e5ff35e8fa82c1896d0 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,10 +15,10 @@ is used for trapping syscalls. 3 files changed, 117 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac -index e6245d8163f..485219e23b3 100644 +index 83c451e0870..d75433751bf 100644 --- a/configure.ac +++ b/configure.ac -@@ -474,6 +474,7 @@ AC_CHECK_HEADERS(\ +@@ -464,6 +464,7 @@ AC_CHECK_HEADERS(\ linux/joystick.h \ linux/major.h \ linux/param.h \ @@ -27,7 +27,7 @@ index e6245d8163f..485219e23b3 100644 linux/types.h \ linux/ucdrom.h \ diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c -index 26d688c3abe..87c5a99a65e 100644 +index d42438f88af..36bc2ef656a 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -24,6 +24,7 @@ @@ -52,7 +52,7 @@ index 26d688c3abe..87c5a99a65e 100644 #define NONAMELESSUNION #define NONAMELESSSTRUCT #include "ntstatus.h" -@@ -3096,6 +3104,38 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *ucontext ) +@@ -3089,6 +3097,104 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *ucontext ) restore_context( &context, ucontext ); } @@ -88,13 +88,7 @@ index 26d688c3abe..87c5a99a65e 100644 + ctx->uc_mcontext.gregs[REG_RIP] = (ULONG64)__wine_syscall_dispatcher; +} +#endif - - /*********************************************************************** - * __wine_set_signal_handler (NTDLL.@) -@@ -3266,6 +3306,72 @@ void signal_init_thread( TEB *teb ) - #endif - } - ++ +#ifdef HAVE_SECCOMP +static int sc_seccomp(unsigned int operation, unsigned int flags, void *args) +{ @@ -160,11 +154,10 @@ index 26d688c3abe..87c5a99a65e 100644 + WARN("Built without seccomp.\n"); +#endif +} -+ - /********************************************************************** - * signal_init_process - */ -@@ -3298,6 +3404,9 @@ void signal_init_process(void) + + /*********************************************************************** + * __wine_set_signal_handler (NTDLL.@) +@@ -3134,6 +3240,9 @@ void signal_init_process(void) sig_act.sa_sigaction = trap_handler; if (sigaction( SIGTRAP, &sig_act, NULL ) == -1) goto error; #endif @@ -216,5 +209,5 @@ index 9cc4698d0d7..c572fe49923 100644 put_byte( 0x08 ); put_byte( 0x03 ); put_byte( 0xfe ); put_byte( 0x7f ); put_byte( 0x01 ); -- -2.25.3 +2.26.2 diff --git a/patches/ntdll-ThreadTime/0006-ntdll-Fill-process-virtual-memory-counters-in-NtQuer.patch b/patches/ntdll-ThreadTime/0006-ntdll-Fill-process-virtual-memory-counters-in-NtQuer.patch index f74a81b3..4656891e 100644 --- a/patches/ntdll-ThreadTime/0006-ntdll-Fill-process-virtual-memory-counters-in-NtQuer.patch +++ b/patches/ntdll-ThreadTime/0006-ntdll-Fill-process-virtual-memory-counters-in-NtQuer.patch @@ -1,4 +1,4 @@ -From abdcbf6355b7f8d353ea15bf7d9c49c54e35910b Mon Sep 17 00:00:00 2001 +From e1ff2fee38b602ff500c35f1eb589162c0d166d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 9 Mar 2017 22:56:45 +0100 Subject: [PATCH] ntdll: Fill process virtual memory counters in @@ -13,10 +13,10 @@ FIXME: fill_VM_COUNTERS now uses a different method ... which one is better? 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index a21a8bcceee..608525347ca 100644 +index 7c2945f0a73..abb2d2176d6 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c -@@ -2703,8 +2703,11 @@ NTSTATUS WINAPI NtQuerySystemInformation( +@@ -2686,8 +2686,11 @@ NTSTATUS WINAPI NtQuerySystemInformation( /* spi->ti will be set later on */ if (reply->unix_pid != -1) @@ -29,10 +29,10 @@ index a21a8bcceee..608525347ca 100644 } len += procstructlen; diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index b4e3c7d5c83..15f72631f55 100644 +index e85f3a3b900..b45b9a02bb1 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h -@@ -297,6 +297,7 @@ void WINAPI LdrInitializeThunk(CONTEXT*,void**,ULONG_PTR,ULONG_PTR); +@@ -285,6 +285,7 @@ void WINAPI LdrInitializeThunk(CONTEXT*,void**,ULONG_PTR,ULONG_PTR); /* process / thread time */ extern BOOL read_process_time(int unix_pid, int unix_tid, unsigned long clk_tck, LARGE_INTEGER *kernel, LARGE_INTEGER *user) DECLSPEC_HIDDEN; @@ -41,10 +41,10 @@ index b4e3c7d5c83..15f72631f55 100644 /* string functions */ int __cdecl NTDLL_tolower( int c ); diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c -index e59c255e327..71233f92853 100644 +index c066610ebca..f2dddb18052 100644 --- a/dlls/ntdll/process.c +++ b/dlls/ntdll/process.c -@@ -186,7 +186,7 @@ static void fill_VM_COUNTERS(VM_COUNTERS* pvmi) +@@ -192,7 +192,7 @@ static void fill_VM_COUNTERS(VM_COUNTERS* pvmi) static void fill_VM_COUNTERS(VM_COUNTERS* pvmi) { @@ -54,11 +54,11 @@ index e59c255e327..71233f92853 100644 #endif diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index a2a999f8996..f5f932ae703 100644 +index b7d4e399f62..21e8b0c08f8 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c -@@ -366,6 +366,42 @@ TEB *thread_init(void) - return teb; +@@ -385,6 +385,42 @@ void WINAPI RtlExitUserThread( ULONG status ) + for (;;) unix_funcs->exit_thread( status ); } +BOOL read_process_memory_stats(int unix_pid, VM_COUNTERS *pvmi) @@ -99,7 +99,7 @@ index a2a999f8996..f5f932ae703 100644 +} /*********************************************************************** - * abort_thread + * start_thread -- 2.26.2 diff --git a/patches/ntdll-Threading/0001-ntdll-Fix-race-condition-when-threads-are-killed-dur.patch b/patches/ntdll-Threading/0001-ntdll-Fix-race-condition-when-threads-are-killed-dur.patch index e463ba9e..9f370c21 100644 --- a/patches/ntdll-Threading/0001-ntdll-Fix-race-condition-when-threads-are-killed-dur.patch +++ b/patches/ntdll-Threading/0001-ntdll-Fix-race-condition-when-threads-are-killed-dur.patch @@ -1,4 +1,4 @@ -From f8e12f51bebca8cda3be339bcc216ca8cc60a718 Mon Sep 17 00:00:00 2001 +From 5f34c6a4429025ee71616e677e0e59342bee17b0 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 25 Feb 2015 22:45:42 +0100 Subject: [PATCH] ntdll: Fix race-condition when threads are killed during @@ -19,10 +19,10 @@ fix the most critical one (messed up refcounting of threads) for now. 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index b25f87e437..5fbd9e06c3 100644 +index bb11521cf69..fee26ccd21d 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c -@@ -336,6 +336,7 @@ void exit_thread( int status ) +@@ -298,6 +298,7 @@ TEB *thread_init(void) void WINAPI RtlExitUserThread( ULONG status ) { static void *prev_teb; @@ -30,7 +30,7 @@ index b25f87e437..5fbd9e06c3 100644 TEB *teb; if (status) /* send the exit code to the server (0 is already the default) */ -@@ -349,7 +350,7 @@ void WINAPI RtlExitUserThread( ULONG status ) +@@ -311,7 +312,7 @@ void WINAPI RtlExitUserThread( ULONG status ) SERVER_END_REQ; } @@ -38,8 +38,8 @@ index b25f87e437..5fbd9e06c3 100644 + if (InterlockedCompareExchange( &nb_threads, 0, 0 ) <= 0) { LdrShutdownProcess(); - pthread_sigmask( SIG_BLOCK, &server_block_set, NULL ); -@@ -372,6 +373,11 @@ void WINAPI RtlExitUserThread( ULONG status ) + unix_funcs->exit_process( status ); +@@ -333,6 +334,11 @@ void WINAPI RtlExitUserThread( ULONG status ) } } @@ -48,7 +48,7 @@ index b25f87e437..5fbd9e06c3 100644 + pthread_sigmask( SIG_BLOCK, &sigset, NULL ); + if (!InterlockedDecrement( &nb_threads )) _exit( status ); + - signal_exit_thread( status ); + for (;;) unix_funcs->exit_thread( status ); } -- 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 27278da6..c5f33485 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 3ecd352d441ac2d596508cd693431abdd7128ec6 Mon Sep 17 00:00:00 2001 +From dcd95cc3f7ef19b34669ebfeb92c29da16ac2387 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 @@ -15,22 +15,22 @@ Subject: [PATCH] ntdll: Setup a temporary signal handler during process 7 files changed, 79 insertions(+) diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index 58b688d06bd..f3ebfb72d32 100644 +index 427cdaad441..562f5ec8d4c 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h -@@ -84,6 +84,7 @@ extern NTSTATUS signal_alloc_thread( TEB *teb ) DECLSPEC_HIDDEN; - extern void signal_free_thread( TEB *teb ) DECLSPEC_HIDDEN; - extern void signal_init_thread( TEB *teb ) DECLSPEC_HIDDEN; +@@ -80,6 +80,7 @@ extern LPCSTR debugstr_ObjectAttributes(const OBJECT_ATTRIBUTES *oa) DECLSPEC_HI + extern SIZE_T signal_stack_size DECLSPEC_HIDDEN; + extern SIZE_T signal_stack_mask DECLSPEC_HIDDEN; extern void signal_init_process(void) DECLSPEC_HIDDEN; +extern void signal_init_early(void) DECLSPEC_HIDDEN; extern void signal_start_thread( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend ) DECLSPEC_HIDDEN; extern void signal_start_process( LPTHREAD_START_ROUTINE entry, BOOL suspend ) DECLSPEC_HIDDEN; - extern void DECLSPEC_NORETURN signal_exit_thread( int status ) DECLSPEC_HIDDEN; + extern void version_init(void) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c -index 31280edce47..f903eb93434 100644 +index e66cf922f91..dcfdeaa83ad 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c -@@ -1031,6 +1031,12 @@ void signal_init_process(void) +@@ -988,6 +988,12 @@ void signal_init_process(void) exit(1); } @@ -44,11 +44,11 @@ index 31280edce47..f903eb93434 100644 /*********************************************************************** * RtlUnwind (NTDLL.@) diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c -index 9f84d3fbfd1..8ab83a1d142 100644 +index c87f99f0c4c..fed76574dbc 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c -@@ -1293,6 +1293,12 @@ void signal_init_thread( TEB *teb ) - pthread_setspecific( teb_key, teb ); +@@ -1303,6 +1303,12 @@ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) + return 0; } +/********************************************************************** @@ -61,10 +61,10 @@ index 9f84d3fbfd1..8ab83a1d142 100644 /********************************************************************** * signal_init_process diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c -index 238d4eacf63..32c6eba0e51 100644 +index 2f2db70b57f..12771552a5d 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c -@@ -2051,6 +2051,31 @@ static BOOL handle_interrupt( unsigned int interrupt, ucontext_t *sigcontext, st +@@ -1988,6 +1988,31 @@ static BOOL handle_interrupt( unsigned int interrupt, ucontext_t *sigcontext, st } @@ -88,7 +88,7 @@ index 238d4eacf63..32c6eba0e51 100644 + /* fall-through */ + default: + WINE_ERR( "Got unexpected trap %d during process initialization\n", get_trap_code(context) ); -+ abort_thread(1); ++ unix_funcs->abort_thread(1); + break; + } +} @@ -96,7 +96,7 @@ index 238d4eacf63..32c6eba0e51 100644 /********************************************************************** * segv_handler * -@@ -2689,6 +2714,34 @@ void signal_init_process(void) +@@ -2315,6 +2340,34 @@ void signal_init_process(void) exit(1); } @@ -132,11 +132,11 @@ index 238d4eacf63..32c6eba0e51 100644 /******************************************************************* * RtlUnwind (NTDLL.@) diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c -index 9df6eff31f4..e79fca3abce 100644 +index a23f6b6e4d5..c3b4b6ffd42 100644 --- a/dlls/ntdll/signal_powerpc.c +++ b/dlls/ntdll/signal_powerpc.c -@@ -1047,6 +1047,12 @@ void signal_init_thread( TEB *teb ) - pthread_setspecific( teb_key, teb ); +@@ -1009,6 +1009,12 @@ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) + return 0; } +/********************************************************************** @@ -149,10 +149,10 @@ index 9df6eff31f4..e79fca3abce 100644 /********************************************************************** * signal_init_process diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c -index 324a92b41a9..29829bfb1c6 100644 +index d42438f88af..b4c11ed66ed 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c -@@ -3286,6 +3286,12 @@ void signal_init_process(void) +@@ -3141,6 +3141,12 @@ void signal_init_process(void) exit(1); } @@ -166,10 +166,10 @@ index 324a92b41a9..29829bfb1c6 100644 static ULONG64 get_int_reg( CONTEXT *context, int reg ) { diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index 125280ba257..af6861f6000 100644 +index bb11521cf69..ff18b119232 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c -@@ -284,6 +284,7 @@ TEB *thread_init(void) +@@ -228,6 +228,7 @@ TEB *thread_init(void) struct ntdll_thread_data *thread_data; virtual_init(); diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 82c5545d..6e38522a 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "bf83d755d987fec552cd1dce30638c31c49ab760" + echo "3c86adab766e3bc7c91da088c2dd6bc41a917055" } # Show version information @@ -175,7 +175,6 @@ patch_enable_all () enable_ntdll_FileDispositionInformation="$1" enable_ntdll_FileFsFullSizeInformation="$1" enable_ntdll_Fix_Alignment="$1" - enable_ntdll_ForceBottomUpAlloc="$1" enable_ntdll_HashLinks="$1" enable_ntdll_Heap_Improvements="$1" enable_ntdll_Hide_Wine_Exports="$1" @@ -626,9 +625,6 @@ patch_enable () ntdll-Fix_Alignment) enable_ntdll_Fix_Alignment="$2" ;; - ntdll-ForceBottomUpAlloc) - enable_ntdll_ForceBottomUpAlloc="$2" - ;; ntdll-HashLinks) enable_ntdll_HashLinks="$2" ;; @@ -3867,35 +3863,6 @@ if test "$enable_ntdll_Fix_Alignment" -eq 1; then ) >> "$patchlist" fi -# Patchset ntdll-ForceBottomUpAlloc -# | -# | This patchset fixes the following Wine bugs: -# | * [#48175] AION (64 bit) - crashes in crysystem.dll.CryFree() due to high memory pointers allocated -# | * [#46568] 64-bit msxml6.dll from Microsoft Core XML Services 6.0 redist package fails to load (Wine doesn't respect -# | 44-bit user-mode VA limitation from Windows < 8.1) -# | -# | Modified files: -# | * dlls/ntdll/virtual.c, include/wine/library.h, libs/wine/mmap.c, libs/wine/wine.map -# | -if test "$enable_ntdll_ForceBottomUpAlloc" -eq 1; then - patch_apply ntdll-ForceBottomUpAlloc/0001-ntdll-Stop-search-on-mmap-error-in-try_map_free_area.patch - patch_apply ntdll-ForceBottomUpAlloc/0002-ntdll-Use-MAP_FIXED_NOREPLACE-flag-in-try_map_free_a.patch - patch_apply ntdll-ForceBottomUpAlloc/0003-ntdll-Force-bottom-up-allocation-order-for-64-bit-ar.patch - patch_apply ntdll-ForceBottomUpAlloc/0004-ntdll-Increase-step-after-failed-map-attempt-in-try_.patch - patch_apply ntdll-ForceBottomUpAlloc/0005-libs-wine-Add-functions-for-managing-free-area-list.patch - patch_apply ntdll-ForceBottomUpAlloc/0006-ntdll-Use-free-area-list-for-virtual-memory-allocati.patch - patch_apply ntdll-ForceBottomUpAlloc/0007-ntdll-Permanently-exclude-natively-mapped-areas-from.patch - ( - printf '%s\n' '+ { "Paul Gofman", "ntdll: Stop search on mmap() error in try_map_free_area().", 1 },'; - printf '%s\n' '+ { "Paul Gofman", "ntdll: Use MAP_FIXED_NOREPLACE flag in try_map_free_area() if available.", 1 },'; - printf '%s\n' '+ { "Paul Gofman", "ntdll: Force bottom up allocation order for 64 bit arch unless top down is requested.", 1 },'; - printf '%s\n' '+ { "Paul Gofman", "ntdll: Increase step after failed map attempt in try_map_free_area().", 1 },'; - printf '%s\n' '+ { "Paul Gofman", "libs/wine: Add functions for managing free area list.", 1 },'; - printf '%s\n' '+ { "Paul Gofman", "ntdll: Use free area list for virtual memory allocation.", 1 },'; - printf '%s\n' '+ { "Paul Gofman", "ntdll: Permanently exclude natively mapped areas from free areas list.", 1 },'; - ) >> "$patchlist" -fi - # Patchset ntdll-HashLinks # | # | Modified files: @@ -4002,11 +3969,11 @@ fi # | 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/signal_x86_64.c, dlls/ntdll/tests/exception.c, -# | dlls/ntdll/thread.c, 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 +# | dlls/ntdll/process.c, dlls/ntdll/signal_i386.c, dlls/ntdll/tests/exception.c, dlls/ntdll/thread.c, +# | 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 @@ -4149,7 +4116,7 @@ fi # Patchset ntdll-NtSetLdtEntries # | # | Modified files: -# | * dlls/kernel32/tests/thread.c, dlls/ntdll/signal_i386.c, libs/wine/ldt.c +# | * dlls/kernel32/tests/thread.c, dlls/ntdll/unix/signal_i386.c, libs/wine/ldt.c # | if test "$enable_ntdll_NtSetLdtEntries" -eq 1; then patch_apply ntdll-NtSetLdtEntries/0001-ntdll-Implement-NtSetLdtEntries.patch 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 b7d57bff..8203ef16 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,12 +1,13 @@ -From 43c4595226819c7b5993937fc8f088b8b6ffa545 Mon Sep 17 00:00:00 2001 +From 505b2a7167d4b0ea533663ef30663f21b0ab9863 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. Based on a patch by Erich E. Hoover. --- - dlls/ntdll/signal_i386.c | 7 ++- + dlls/ntdll/signal_i386.c | 4 +- dlls/ntdll/tests/exception.c | 2 + + dlls/ntdll/thread.c | 4 ++ include/winternl.h | 2 +- tools/winebuild/build.h | 7 +++ tools/winebuild/import.c | 10 ++-- @@ -14,23 +15,22 @@ Based on a patch by Erich E. Hoover. tools/winebuild/spec16.c | 22 +------- tools/winebuild/spec32.c | 104 +++++++++++++++++++++++++++++++++++ tools/winebuild/utils.c | 21 +++++++ - 9 files changed, 207 insertions(+), 27 deletions(-) + 10 files changed, 208 insertions(+), 27 deletions(-) diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c -index 5353ab4df2ce..527ba01672e1 100644 +index 5fd54071ffd..950408cbc38 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c -@@ -476,6 +476,9 @@ static ULONG first_ldt_entry = 32; +@@ -449,6 +449,8 @@ static ULONG first_ldt_entry = 32; static wine_signal_handler handlers[256]; -+extern void DECLSPEC_NORETURN __wine_syscall_dispatcher( void ); +extern NTSTATUS WINAPI __syscall_NtGetContextThread( HANDLE handle, CONTEXT *context ); + enum i386_trap_code { TRAP_x86_UNKNOWN = -1, /* Unknown fault (TRAP_sig not defined) */ -@@ -1514,7 +1517,7 @@ NTSTATUS CDECL DECLSPEC_HIDDEN __regs_NtGetContextThread( DWORD edi, DWORD esi, +@@ -1487,7 +1489,7 @@ NTSTATUS CDECL DECLSPEC_HIDDEN __regs_NtGetContextThread( DWORD edi, DWORD esi, { context->Ebp = ebp; context->Esp = (DWORD)&retaddr; @@ -39,17 +39,8 @@ index 5353ab4df2ce..527ba01672e1 100644 context->SegCs = get_cs(); context->SegSs = get_ds(); context->EFlags = eflags; -@@ -2561,6 +2564,8 @@ NTSTATUS signal_alloc_thread( TEB *teb ) - } - else thread_data->fs = gdt_fs_sel; - -+ teb->WOW32Reserved = __wine_syscall_dispatcher; -+ - return STATUS_SUCCESS; - } - diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c -index a5e6faa461a3..51938bf84cc1 100644 +index a5e6faa461a..51938bf84cc 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -1643,6 +1643,8 @@ static void test_thread_context(void) @@ -61,8 +52,37 @@ index a5e6faa461a3..51938bf84cc1 100644 /* segment registers clear the high word */ 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 bb11521cf69..edd6c4dfa99 100644 +--- a/dlls/ntdll/thread.c ++++ b/dlls/ntdll/thread.c +@@ -212,6 +212,8 @@ void map_user_shared_data(void) + NtClose( section ); + } + ++extern void DECLSPEC_NORETURN __wine_syscall_dispatcher( void ); ++ + /*********************************************************************** + * thread_init + * +@@ -248,6 +250,7 @@ TEB *thread_init(void) + unix_funcs->init_threading( &nb_threads, &__wine_ldt_copy ); + unix_funcs->alloc_thread( teb ); + unix_funcs->init_thread( teb ); ++ teb->WOW32Reserved = __wine_syscall_dispatcher; + + peb = teb->Peb; + peb->FastPebLock = &peb_lock; +@@ -493,6 +496,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, SECURITY_DESCRIPTOR *descr, + teb->Tib.StackBase = stack.StackBase; + teb->Tib.StackLimit = stack.StackLimit; + teb->DeallocationStack = stack.DeallocationStack; ++ teb->WOW32Reserved = __wine_syscall_dispatcher; + + thread_data = (struct ntdll_thread_data *)&teb->GdiTebBatch; + thread_data->request_fd = request_pipe[1]; diff --git a/include/winternl.h b/include/winternl.h -index 0f808d71dd33..d641ed1436ad 100644 +index 44a58cadc7a..065f3d24f52 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -359,7 +359,7 @@ typedef struct _TEB @@ -75,7 +95,7 @@ index 0f808d71dd33..d641ed1436ad 100644 ULONG FpSoftwareStatusRegister; /* 0c8/010c */ PVOID SystemReserved1[54]; /* 0cc/0110 used for krnl386.exe16 private data in Wine */ diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h -index c162888a0356..55d5b0b9dc28 100644 +index c162888a035..55d5b0b9dc2 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -105,6 +105,7 @@ typedef struct @@ -123,7 +143,7 @@ index c162888a0356..55d5b0b9dc28 100644 extern int byte_swapped; diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c -index 04ab433dd65a..0c6bafed8e54 100644 +index 04ab433dd65..0c6bafed8e5 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -531,6 +531,7 @@ static void check_undefined_forwards( DLLSPEC *spec ) @@ -163,7 +183,7 @@ index 04ab433dd65a..0c6bafed8e54 100644 } } diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c -index 0f2b9c1e10ad..74216f8bb6e7 100644 +index 0f2b9c1e10a..74216f8bb6e 100644 --- a/tools/winebuild/parser.c +++ b/tools/winebuild/parser.c @@ -543,6 +543,24 @@ static const char *parse_spec_flags( DLLSPEC *spec, ORDDEF *odp ) @@ -254,7 +274,7 @@ index 0f2b9c1e10ad..74216f8bb6e7 100644 } diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c -index a52c03aaa6a7..15ef9a3f8930 100644 +index a52c03aaa6a..15ef9a3f893 100644 --- a/tools/winebuild/spec16.c +++ b/tools/winebuild/spec16.c @@ -495,27 +495,6 @@ static int relay_type_compare( const void *e1, const void *e2 ) @@ -294,7 +314,7 @@ index a52c03aaa6a7..15ef9a3f8930 100644 entry_point->u.func.nb_args = 0; assert( !spec->ordinals[0] ); diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c -index b1e20e0484dc..22dd399cb2b4 100644 +index b1e20e0484d..22dd399cb2b 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -374,6 +374,109 @@ static void output_relay_debug( DLLSPEC *spec ) @@ -416,7 +436,7 @@ index b1e20e0484dc..22dd399cb2b4 100644 output_exports( spec ); output_imports( spec ); diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c -index 2a1fc960926b..07a579004adc 100644 +index 2a1fc960926..07a579004ad 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c @@ -860,6 +860,7 @@ void free_dll_spec( DLLSPEC *spec ) diff --git a/patches/winebuild-Fake_Dlls/0005-winebuild-Add-stub-functions-in-fake-dlls.patch b/patches/winebuild-Fake_Dlls/0005-winebuild-Add-stub-functions-in-fake-dlls.patch index 1575836a..edbed0e5 100644 --- a/patches/winebuild-Fake_Dlls/0005-winebuild-Add-stub-functions-in-fake-dlls.patch +++ b/patches/winebuild-Fake_Dlls/0005-winebuild-Add-stub-functions-in-fake-dlls.patch @@ -1,22 +1,22 @@ -From 49daa93dd311ff1b28e2878852b6337140b4d499 Mon Sep 17 00:00:00 2001 +From 22a245956909fc1cd3a733d460441bb05d09c775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Mon, 15 May 2017 16:27:56 +0200 Subject: [PATCH] winebuild: Add stub functions in fake dlls. --- dlls/kernel32/tests/loader.c | 8 +- - dlls/ntdll/signal_i386.c | 34 ++++++ + dlls/ntdll/thread.c | 35 ++++++ include/winternl.h | 2 +- tools/winebuild/build.h | 1 + tools/winebuild/spec32.c | 209 +++++++++++++++++++++++++++++++++-- tools/winebuild/utils.c | 10 +- - 6 files changed, 249 insertions(+), 15 deletions(-) + 6 files changed, 250 insertions(+), 15 deletions(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c -index 4e7a15970cb..ec173c94a8e 100644 +index 926fa913866..902907329c0 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c -@@ -1560,9 +1560,7 @@ static void test_FakeDLL(void) +@@ -1596,9 +1596,7 @@ static void test_FakeDLL(void) ok(ptr != NULL, "MapViewOfFile failed with error %u\n", GetLastError()); dir = RtlImageDirectoryEntryToData(ptr, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &size); @@ -26,7 +26,7 @@ index 4e7a15970cb..ec173c94a8e 100644 names = RVAToAddr(dir->AddressOfNames, ptr); ordinals = RVAToAddr(dir->AddressOfNameOrdinals, ptr); -@@ -1591,17 +1589,20 @@ todo_wine +@@ -1627,17 +1625,20 @@ todo_wine /* check position in memory */ dll_rva = (DWORD_PTR)dll_func - (DWORD_PTR)module; map_rva = funcs[ordinals[i]]; @@ -47,7 +47,7 @@ index 4e7a15970cb..ec173c94a8e 100644 ok(!memcmp(map_func, dll_func, 0x20), "%s: Function content does not match!\n", func_name); if (!strcmp(func_name, "NtSetEvent")) -@@ -1615,10 +1616,11 @@ todo_wine +@@ -1651,10 +1652,11 @@ todo_wine ok(event != NULL, "CreateEvent failed with error %u\n", GetLastError()); pNtSetEvent(event, 0); ok(WaitForSingleObject(event, 0) == WAIT_OBJECT_0, "Event was not signaled\n"); @@ -60,15 +60,15 @@ index 4e7a15970cb..ec173c94a8e 100644 UnmapViewOfFile(ptr); CloseHandle(map); CloseHandle(file); -diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c -index 04fdaf564b3..1dcc54895dc 100644 ---- a/dlls/ntdll/signal_i386.c -+++ b/dlls/ntdll/signal_i386.c -@@ -479,6 +479,39 @@ static wine_signal_handler handlers[256]; - extern void DECLSPEC_NORETURN __wine_syscall_dispatcher( void ); - extern NTSTATUS WINAPI __syscall_NtGetContextThread( HANDLE handle, CONTEXT *context ); +diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c +index edd6c4dfa99..678af513264 100644 +--- a/dlls/ntdll/thread.c ++++ b/dlls/ntdll/thread.c +@@ -214,6 +214,39 @@ void map_user_shared_data(void) -+static void* WINAPI __wine_fakedll_dispatcher( const char *module, ULONG ord ) + extern void DECLSPEC_NORETURN __wine_syscall_dispatcher( void ); + ++static void *WINAPI __wine_fakedll_dispatcher( const char *module, ULONG ord ) +{ + UNICODE_STRING name; + NTSTATUS status; @@ -101,19 +101,27 @@ index 04fdaf564b3..1dcc54895dc 100644 + return proc; +} + - enum i386_trap_code - { - TRAP_x86_UNKNOWN = -1, /* Unknown fault (TRAP_sig not defined) */ -@@ -2565,6 +2598,7 @@ NTSTATUS signal_alloc_thread( TEB *teb ) - else thread_data->fs = gdt_fs_sel; - + /*********************************************************************** + * thread_init + * +@@ -251,6 +284,7 @@ TEB *thread_init(void) + unix_funcs->alloc_thread( teb ); + unix_funcs->init_thread( teb ); teb->WOW32Reserved = __wine_syscall_dispatcher; -+ teb->Spare2 = __wine_fakedll_dispatcher; ++ teb->Spare2 = (ULONG_PTR)__wine_fakedll_dispatcher; - return STATUS_SUCCESS; - } + peb = teb->Peb; + peb->FastPebLock = &peb_lock; +@@ -497,6 +531,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, SECURITY_DESCRIPTOR *descr, + teb->Tib.StackLimit = stack.StackLimit; + teb->DeallocationStack = stack.DeallocationStack; + teb->WOW32Reserved = __wine_syscall_dispatcher; ++ teb->Spare2 = (ULONG_PTR)__wine_fakedll_dispatcher; + + thread_data = (struct ntdll_thread_data *)&teb->GdiTebBatch; + thread_data->request_fd = request_pipe[1]; diff --git a/include/winternl.h b/include/winternl.h -index 26ee5b601fb..03f86dae253 100644 +index 065f3d24f52..199b8fc52f2 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -398,7 +398,7 @@ typedef struct _TEB @@ -126,7 +134,7 @@ index 26ee5b601fb..03f86dae253 100644 PVOID ReservedForPerf; /* f7c/1750 */ PVOID ReservedForOle; /* f80/1758 */ diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h -index 210324406a9..1d296d42463 100644 +index 8930df408d3..44113bad28a 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -358,6 +358,7 @@ extern void put_word( unsigned short val ); @@ -394,7 +402,7 @@ index c38f1fe663c..bf82ca497c0 100644 /* .reloc contents */ align_output_rva( file_align, section_align ); diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c -index 64e1fa51455..edb983a65c9 100644 +index 80dec6db29e..d394a1382c6 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c @@ -549,7 +549,7 @@ size_t output_buffer_size; 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 6ea842a8..eac18791 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,23 +1,22 @@ -From c605ff6f4bcab597bd9769f49b95d009d561b68d Mon Sep 17 00:00:00 2001 +From fa2f2b41cb6af594457b76ba90c042387c368ef6 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. --- dlls/kernel32/tests/loader.c | 7 +- - dlls/ntdll/signal_x86_64.c | 2 + dlls/ntdll/thread.c | 13 +- libs/wine/loader.c | 4 + server/mapping.c | 6 +- tools/winebuild/parser.c | 2 +- tools/winebuild/spec32.c | 285 ++++++++++++++++++++++++++++++++++- - 7 files changed, 308 insertions(+), 11 deletions(-) + 6 files changed, 306 insertions(+), 11 deletions(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c -index 1f525194ce7..21af7b4ce7a 100644 +index 95939ba6bde..ae5462f6e55 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c -@@ -1574,7 +1574,7 @@ static void test_filenames(void) +@@ -1573,7 +1573,7 @@ static void test_filenames(void) static void test_FakeDLL(void) { @@ -26,7 +25,7 @@ index 1f525194ce7..21af7b4ce7a 100644 NTSTATUS (WINAPI *pNtSetEvent)(HANDLE, ULONG *) = NULL; IMAGE_EXPORT_DIRECTORY *dir; HMODULE module = GetModuleHandleA("ntdll.dll"); -@@ -1616,8 +1616,13 @@ static void test_FakeDLL(void) +@@ -1615,8 +1615,13 @@ static void test_FakeDLL(void) dll_func = (BYTE *)GetProcAddress(module, func_name); ok(dll_func != NULL, "%s: GetProcAddress returned NULL\n", func_name); @@ -40,31 +39,11 @@ index 1f525194ce7..21af7b4ce7a 100644 { todo_wine ok(0, "%s: Export is a stub-function, skipping\n", func_name); continue; -diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c -index 5defcd6a7af..c2936045c5d 100644 ---- a/dlls/ntdll/signal_x86_64.c -+++ b/dlls/ntdll/signal_x86_64.c -@@ -354,6 +354,7 @@ static inline void set_sigcontext( const CONTEXT *context, ucontext_t *sigcontex - #endif - } - -+extern void DECLSPEC_NORETURN __wine_syscall_dispatcher( void ); - - /*********************************************************************** - * Definitions for Win32 unwind tables -@@ -3142,6 +3143,7 @@ void signal_init_threading(void) - */ - NTSTATUS signal_alloc_thread( TEB *teb ) - { -+ teb->WOW32Reserved = __wine_syscall_dispatcher; - return STATUS_SUCCESS; - } - diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index e5ff24f34f1..ddaf41637d0 100644 +index 678af513264..297893d8898 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c -@@ -56,6 +56,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(thread); +@@ -54,6 +54,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(thread); struct _KUSER_SHARED_DATA *user_shared_data = NULL; @@ -73,7 +52,7 @@ index e5ff24f34f1..ddaf41637d0 100644 void (WINAPI *kernel32_start_process)(LPTHREAD_START_ROUTINE,void*) = NULL; /* info passed to a starting thread */ -@@ -281,9 +283,9 @@ TEB *thread_init(void) +@@ -267,9 +269,9 @@ TEB *thread_init(void) /* reserve space for shared user data */ addr = (void *)0x7ffe0000; @@ -85,7 +64,7 @@ index e5ff24f34f1..ddaf41637d0 100644 if (status) { MESSAGE( "wine: failed to map the shared user data: %08x\n", status ); -@@ -291,6 +293,13 @@ TEB *thread_init(void) +@@ -277,6 +279,13 @@ TEB *thread_init(void) } user_shared_data = addr; diff --git a/patches/winedevice-Default_Drivers/0004-programs-winedevice-Load-some-common-drivers-and-fix.patch b/patches/winedevice-Default_Drivers/0004-programs-winedevice-Load-some-common-drivers-and-fix.patch index aac25919..a145bffa 100644 --- a/patches/winedevice-Default_Drivers/0004-programs-winedevice-Load-some-common-drivers-and-fix.patch +++ b/patches/winedevice-Default_Drivers/0004-programs-winedevice-Load-some-common-drivers-and-fix.patch @@ -1,4 +1,4 @@ -From 06fef705b2735f358f64443c2c3f5c1904eae273 Mon Sep 17 00:00:00 2001 +From 86c0ddea979a6124a4e60a970501102b83664a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 8 Jun 2017 23:50:03 +0200 Subject: [PATCH] programs/winedevice: Load some common drivers and fix ldr @@ -10,7 +10,7 @@ Subject: [PATCH] programs/winedevice: Load some common drivers and fix ldr 2 files changed, 76 insertions(+) diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c -index 356c60a2e78d..bdc69c16f448 100644 +index f51064986b5..d34db7c5828 100644 --- a/dlls/ntoskrnl.exe/tests/driver.c +++ b/dlls/ntoskrnl.exe/tests/driver.c @@ -44,6 +44,7 @@ static const WCHAR driver_link[] = {'\\','D','o','s','D','e','v','i','c','e','s' @@ -21,7 +21,7 @@ index 356c60a2e78d..bdc69c16f448 100644 static HANDLE okfile; static LONG successes; -@@ -1504,6 +1505,7 @@ static void test_resource(void) +@@ -1681,6 +1682,7 @@ static void test_resource(void) ok(status == STATUS_SUCCESS, "got status %#x\n", status); } @@ -29,8 +29,8 @@ index 356c60a2e78d..bdc69c16f448 100644 static void test_lookup_thread(void) { NTSTATUS status; -@@ -1779,6 +1781,52 @@ static void test_affinity(void) - KeRevertToUserAffinityThread(); +@@ -2132,6 +2134,52 @@ static void test_process_memory(const struct test_input *test_input) + ObDereferenceObject(process); } +static void test_default_modules(void) @@ -82,7 +82,7 @@ index 356c60a2e78d..bdc69c16f448 100644 static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *stack) { ULONG length = stack->Parameters.DeviceIoControl.OutputBufferLength; -@@ -1825,6 +1873,7 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st +@@ -2178,6 +2226,7 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st test_stack_callout(); test_lookaside_list(); test_ob_reference(test_input->path); @@ -90,7 +90,7 @@ index 356c60a2e78d..bdc69c16f448 100644 test_resource(); test_lookup_thread(); test_IoAttachDeviceToDeviceStack(); -@@ -2076,6 +2125,7 @@ NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, PUNICODE_STRING registry) +@@ -2431,6 +2480,7 @@ NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, PUNICODE_STRING registry) DbgPrint("loading driver\n"); driver_obj = driver; @@ -99,7 +99,7 @@ index 356c60a2e78d..bdc69c16f448 100644 /* Allow unloading of the driver */ driver->DriverUnload = driver_Unload; diff --git a/programs/winedevice/device.c b/programs/winedevice/device.c -index 0755caaafb01..6595788053e8 100644 +index 0755caaafb0..6595788053e 100644 --- a/programs/winedevice/device.c +++ b/programs/winedevice/device.c @@ -120,7 +120,33 @@ static DWORD WINAPI service_handler( DWORD ctrl, DWORD event_type, LPVOID event_ 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 384fc90a..8d92e376 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 e5ee1bec04910d5109591ee82177cdddaab60da7 Mon Sep 17 00:00:00 2001 +From 9d0ef7cd2af3c8ca34f24247a7927c24c7086741 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 @@ -29,10 +29,10 @@ index 42532bd9f1c..ba46f170670 100644 @ cdecl wine_server_handle_to_fd(long long ptr ptr) @ cdecl wine_server_release_fd(long long) diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c -index ed4e3f25531..ae1e41a485e 100644 +index c7788b99e2d..54291d0a909 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c -@@ -687,6 +687,14 @@ void CDECL wine_server_release_fd( HANDLE handle, int unix_fd ) +@@ -239,6 +239,14 @@ void CDECL wine_server_release_fd( HANDLE handle, int unix_fd ) unix_funcs->server_release_fd( handle, unix_fd ); } @@ -48,22 +48,22 @@ index ed4e3f25531..ae1e41a485e 100644 /*********************************************************************** * server_init_process diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c -index 4a3f101d301..8b10964603e 100644 +index aa020845bb9..0ef08edc474 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c -@@ -1000,6 +1000,7 @@ static struct unix_funcs unix_funcs = - wine_server_call, +@@ -1014,6 +1014,7 @@ static struct unix_funcs unix_funcs = + server_wait, + server_queue_process_apc, server_send_fd, - server_remove_fd_from_cache, + server_remove_fds_from_cache_by_type, server_get_unix_fd, server_fd_to_handle, server_handle_to_fd, diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c -index 8dc3f33bc80..dd2cb6cf5e2 100644 +index 8889c5d4b12..929ff354d65 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c -@@ -559,6 +559,26 @@ int CDECL server_remove_fd_from_cache( HANDLE handle ) +@@ -983,6 +983,26 @@ static int remove_fd_from_cache( HANDLE handle ) return fd; } @@ -91,34 +91,34 @@ index 8dc3f33bc80..dd2cb6cf5e2 100644 /*********************************************************************** * server_get_unix_fd diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h -index 2bf39f85371..32c03fd8983 100644 +index 0694426dddb..5c13dce0b0a 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h -@@ -63,6 +63,7 @@ extern void CDECL dbg_init(void) DECLSPEC_HIDDEN; - extern unsigned int CDECL server_call_unlocked( void *req_ptr ) DECLSPEC_HIDDEN; +@@ -68,6 +68,7 @@ extern unsigned int CDECL server_wait( const select_op_t *select_op, data_size_t + const LARGE_INTEGER *timeout ) DECLSPEC_HIDDEN; + extern unsigned int CDECL server_queue_process_apc( HANDLE process, const apc_call_t *call, apc_result_t *result ) DECLSPEC_HIDDEN; extern void CDECL server_send_fd( int fd ) DECLSPEC_HIDDEN; - extern int CDECL server_remove_fd_from_cache( HANDLE handle ) DECLSPEC_HIDDEN; +extern void CDECL server_remove_fds_from_cache_by_type( enum server_fd_type type ) DECLSPEC_HIDDEN; extern int CDECL server_get_unix_fd( HANDLE handle, unsigned int wanted_access, int *unix_fd, 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 142e8956e7e..452c725dfde 100644 +index 323141d3840..0189c247b7a 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h -@@ -25,7 +25,7 @@ - #include "wine/debug.h" +@@ -27,7 +27,7 @@ + struct ldt_copy; /* increment this when you change the function table */ --#define NTDLL_UNIXLIB_VERSION 10 -+#define NTDLL_UNIXLIB_VERSION 11 +-#define NTDLL_UNIXLIB_VERSION 13 ++#define NTDLL_UNIXLIB_VERSION 14 struct unix_funcs { -@@ -55,6 +55,7 @@ struct unix_funcs - unsigned int (CDECL *server_call)( void *req_ptr ); +@@ -80,6 +80,7 @@ struct unix_funcs + const LARGE_INTEGER *timeout ); + unsigned int (CDECL *server_queue_process_apc)( HANDLE process, const apc_call_t *call, apc_result_t *result ); void (CDECL *server_send_fd)( int fd ); - int (CDECL *server_remove_fd_from_cache)( HANDLE handle ); + void (CDECL *server_remove_fds_from_cache_by_type)( enum server_fd_type type ); int (CDECL *server_get_unix_fd)( HANDLE handle, unsigned int wanted_access, int *unix_fd, int *needs_close, enum server_fd_type *type, unsigned int *options ); diff --git a/staging/upstream-commit b/staging/upstream-commit index 3c361cae..f6aa5e47 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -bf83d755d987fec552cd1dce30638c31c49ab760 +3c86adab766e3bc7c91da088c2dd6bc41a917055