From 8321c62f2418380a6b2f1de0cddff8e2a73da2db Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 26 Aug 2020 10:01:53 +1000 Subject: [PATCH] Rebase against a53288e8c95d59b03eefe10f4963b555b04426aa. --- ...ndline-option-patches-to-show-the-pa.patch | 18 ++-- patches/patchinstall.sh | 7 +- ...e-client-side-file-descriptor-cache-.patch | 101 ++++-------------- staging/upstream-commit | 2 +- 4 files changed, 34 insertions(+), 94 deletions(-) diff --git a/patches/Staging/0003-loader-Add-commandline-option-patches-to-show-the-pa.patch b/patches/Staging/0003-loader-Add-commandline-option-patches-to-show-the-pa.patch index c812a976..31c6d8ff 100644 --- a/patches/Staging/0003-loader-Add-commandline-option-patches-to-show-the-pa.patch +++ b/patches/Staging/0003-loader-Add-commandline-option-patches-to-show-the-pa.patch @@ -1,4 +1,4 @@ -From 599c50c9e339fe04e96fdb665b3d7ccb1a7708b7 Mon Sep 17 00:00:00 2001 +From eea7dea0e9488f8afc56b880d3d5f67d0b3d9f5c Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 29 May 2014 23:43:45 +0200 Subject: [PATCH] loader: Add commandline option --patches to show the patch @@ -12,17 +12,17 @@ Subject: [PATCH] loader: Add commandline option --patches to show the patch 4 files changed, 49 insertions(+), 1 deletion(-) diff --git a/include/wine/library.h b/include/wine/library.h -index 090b8349559..b8a4a2df576 100644 +index 405ce0d9da3..eecb770b455 100644 --- a/include/wine/library.h +++ b/include/wine/library.h -@@ -42,6 +42,7 @@ extern "C" { +@@ -41,6 +41,7 @@ extern "C" { + /* configuration */ - extern const char *wine_get_version(void); +extern const void *wine_get_patches(void); - extern const char *wine_get_build_id(void); extern void wine_init_argv0_path( const char *argv0 ); extern void wine_exec_wine_binary( const char *name, char **argv, const char *env_var ); + diff --git a/libs/wine/config.c b/libs/wine/config.c index f5b4c0de9af..e52739d55ad 100644 --- a/libs/wine/config.c @@ -53,10 +53,10 @@ index 1143b129734..55f874d3e74 100644 wine_init_argv0_path; wine_mmap_add_reserved_area; diff --git a/loader/main.c b/loader/main.c -index 0e6b6f66b50..24bcfff8c4c 100644 +index a92276fa412..00b02e23c26 100644 --- a/loader/main.c +++ b/loader/main.c -@@ -55,7 +55,8 @@ static void check_command_line( int argc, char *argv[] ) +@@ -57,7 +57,8 @@ static void check_command_line( int argc, char *argv[] ) static const char usage[] = "Usage: wine PROGRAM [ARGUMENTS...] Run the specified program\n" " wine --help Display this help and exit\n" @@ -66,7 +66,7 @@ index 0e6b6f66b50..24bcfff8c4c 100644 if (argc <= 1) { -@@ -72,6 +73,45 @@ static void check_command_line( int argc, char *argv[] ) +@@ -74,6 +75,45 @@ static void check_command_line( int argc, char *argv[] ) printf( "%s\n", wine_get_build_id() ); exit(0); } @@ -113,5 +113,5 @@ index 0e6b6f66b50..24bcfff8c4c 100644 -- -2.26.2 +2.28.0 diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 8c2cbc7e..c7dcce96 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "aaea13a128b76fa0076b8852187c7d10e5eb5d68" + echo "a53288e8c95d59b03eefe10f4963b555b04426aa" } # Show version information @@ -4274,9 +4274,8 @@ fi # | * [#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 +# | * dlls/ntdll/ntdll.spec, dlls/ntdll/unix/server.c, 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 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 dc0e31f6..7f2da5f8 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,76 +1,41 @@ -From 3a762c7717a2d06b83525fa3f709aa57bf8466d2 Mon Sep 17 00:00:00 2001 +From 68c0e9d7ae4c5c86ee112b991f723aafde57edbb 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 WSACleanup. --- - dlls/ntdll/ntdll.spec | 1 + - dlls/ntdll/server.c | 8 ++++++++ - dlls/ntdll/unix/loader.c | 1 + - dlls/ntdll/unix/server.c | 20 ++++++++++++++++++++ - dlls/ntdll/unix/unix_private.h | 1 + - dlls/ntdll/unixlib.h | 1 + - dlls/ws2_32/socket.c | 1 + - dlls/ws2_32/tests/sock.c | 5 +---- - include/wine/server.h | 1 + - 9 files changed, 35 insertions(+), 4 deletions(-) + dlls/ntdll/ntdll.spec | 1 + + dlls/ntdll/unix/server.c | 20 ++++++++++++++++++++ + dlls/ws2_32/socket.c | 1 + + dlls/ws2_32/tests/sock.c | 5 +---- + include/wine/server.h | 1 + + 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec -index 2d4ced7e63e..598f57404b4 100644 +index fce1c40b56e..79386ba0078 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec -@@ -1582,6 +1582,7 @@ +@@ -1583,6 +1583,7 @@ # Server interface - @ cdecl -norelay wine_server_call(ptr) -+@ cdecl wine_server_close_fds_by_type(long) - @ cdecl wine_server_fd_to_handle(long long long ptr) - @ 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 a3ad3e68871..d6cd0b4ce22 100644 ---- a/dlls/ntdll/server.c -+++ b/dlls/ntdll/server.c -@@ -120,6 +120,14 @@ int CDECL wine_server_handle_to_fd( HANDLE handle, unsigned int access, int *uni - return unix_funcs->server_handle_to_fd( handle, access, unix_fd, options ); - } - -+ /*********************************************************************** -+ * wine_server_close_fds_by_type -+ */ -+void CDECL wine_server_close_fds_by_type( enum server_fd_type type ) -+{ -+ unix_funcs->server_remove_fds_from_cache_by_type( type ); -+} -+ - - /*********************************************************************** - * wine_server_release_fd (NTDLL.@) -diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c -index 8366e3a9989..649c03f116f 100644 ---- a/dlls/ntdll/unix/loader.c -+++ b/dlls/ntdll/unix/loader.c -@@ -1442,6 +1442,7 @@ static struct unix_funcs unix_funcs = - exec_process, - wine_server_call, - server_send_fd, -+ server_remove_fds_from_cache_by_type, - server_fd_to_handle, - server_handle_to_fd, - server_release_fd, + @ cdecl -syscall -norelay wine_server_call(ptr) ++@ cdecl -syscall wine_server_remove_fds_from_cache_by_type(long) + @ cdecl -syscall wine_server_fd_to_handle(long long long ptr) + @ cdecl -syscall wine_server_handle_to_fd(long long ptr ptr) + @ cdecl -syscall wine_server_release_fd(long long) diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c -index cb014c91230..1687d633a4c 100644 +index 912da45956c..62f1cd8997d 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c -@@ -1012,6 +1012,26 @@ static int remove_fd_from_cache( HANDLE handle ) +@@ -1005,6 +1005,26 @@ static int remove_fd_from_cache( HANDLE handle ) return fd; } +/*********************************************************************** + * server_remove_fds_from_cache_by_type + */ -+void CDECL server_remove_fds_from_cache_by_type( enum server_fd_type type ) ++void CDECL wine_server_remove_fds_from_cache_by_type( enum server_fd_type type ) +{ + union fd_cache_entry cache; + unsigned int entry, idx; @@ -90,44 +55,20 @@ index cb014c91230..1687d633a4c 100644 /*********************************************************************** * server_get_unix_fd -diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h -index dad33ee5e9f..00b718dfb7e 100644 ---- a/dlls/ntdll/unix/unix_private.h -+++ b/dlls/ntdll/unix/unix_private.h -@@ -114,6 +114,7 @@ extern ssize_t CDECL virtual_locked_recvmsg( int fd, struct msghdr *hdr, int fla - extern void CDECL virtual_release_address_space(void) DECLSPEC_HIDDEN; - - extern void CDECL server_send_fd( int fd ) DECLSPEC_HIDDEN; -+extern void CDECL server_remove_fds_from_cache_by_type( enum server_fd_type type ) DECLSPEC_HIDDEN; - extern NTSTATUS CDECL server_fd_to_handle( int fd, unsigned int access, unsigned int attributes, - HANDLE *handle ) DECLSPEC_HIDDEN; - extern NTSTATUS CDECL server_handle_to_fd( HANDLE handle, unsigned int access, int *unix_fd, -diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h -index 715af516867..12c2ea15b5c 100644 ---- a/dlls/ntdll/unixlib.h -+++ b/dlls/ntdll/unixlib.h -@@ -100,6 +100,7 @@ struct unix_funcs - /* server functions */ - unsigned int (CDECL *server_call)( void *req_ptr ); - void (CDECL *server_send_fd)( int fd ); -+ void (CDECL *server_remove_fds_from_cache_by_type)( enum server_fd_type type ); - NTSTATUS (CDECL *server_fd_to_handle)( int fd, unsigned int access, unsigned int attributes, - HANDLE *handle ); - NTSTATUS (CDECL *server_handle_to_fd)( HANDLE handle, unsigned int access, int *unix_fd, diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c -index 6bf4140ba00..4f0c3c3adfa 100644 +index ff8c96ab965..a304f4a82c1 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -1740,6 +1740,7 @@ INT WINAPI WSACleanup(void) if (!--num_startup) { -+ wine_server_close_fds_by_type( FD_TYPE_SOCKET ); ++ wine_server_remove_fds_from_cache_by_type( FD_TYPE_SOCKET ); SERVER_START_REQ(socket_cleanup) { wine_server_call( req ); diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c -index 9fe89d9dba3..c2e1379fe6f 100644 +index e550c86516b..cb8559efbf8 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -1250,10 +1250,7 @@ static void test_WithWSAStartup(void) @@ -155,5 +96,5 @@ index ac5dcc6f8bc..5cf52887516 100644 /* do a server call and set the last error code */ static inline unsigned int wine_server_call_err( void *req_ptr ) -- -2.27.0 +2.28.0 diff --git a/staging/upstream-commit b/staging/upstream-commit index d32d53fb..ca876958 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -aaea13a128b76fa0076b8852187c7d10e5eb5d68 +a53288e8c95d59b03eefe10f4963b555b04426aa