You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-12-15 08:03:15 -08:00
Rebase against bf83d755d987fec552cd1dce30638c31c49ab760.
This commit is contained in:
@@ -1,21 +1,26 @@
|
||||
From 380a706bf10f26de9a1cd1a440b427f01f012285 Mon Sep 17 00:00:00 2001
|
||||
From e5ee1bec04910d5109591ee82177cdddaab60da7 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 6 Sep 2015 12:41:17 +0200
|
||||
Subject: ws2_32: Invalidate client-side file descriptor cache in WSACleanup.
|
||||
Subject: [PATCH] ws2_32: Invalidate client-side file descriptor cache in
|
||||
WSACleanup.
|
||||
|
||||
---
|
||||
dlls/ntdll/ntdll.spec | 1 +
|
||||
dlls/ntdll/server.c | 24 ++++++++++++++++++++++++
|
||||
dlls/ws2_32/socket.c | 1 +
|
||||
dlls/ws2_32/tests/sock.c | 5 +----
|
||||
include/wine/server.h | 1 +
|
||||
5 files changed, 28 insertions(+), 4 deletions(-)
|
||||
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 | 3 ++-
|
||||
dlls/ws2_32/socket.c | 1 +
|
||||
dlls/ws2_32/tests/sock.c | 5 +----
|
||||
include/wine/server.h | 1 +
|
||||
9 files changed, 36 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
|
||||
index c3b6bf0..2b52562 100644
|
||||
index 42532bd9f1c..ba46f170670 100644
|
||||
--- a/dlls/ntdll/ntdll.spec
|
||||
+++ b/dlls/ntdll/ntdll.spec
|
||||
@@ -1458,6 +1458,7 @@
|
||||
@@ -1575,6 +1575,7 @@
|
||||
|
||||
# Server interface
|
||||
@ cdecl -norelay wine_server_call(ptr)
|
||||
@@ -24,19 +29,49 @@ index c3b6bf0..2b52562 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 356d631..381d5aa 100644
|
||||
index ed4e3f25531..ae1e41a485e 100644
|
||||
--- a/dlls/ntdll/server.c
|
||||
+++ b/dlls/ntdll/server.c
|
||||
@@ -915,6 +915,30 @@ int server_remove_fd_from_cache( HANDLE handle )
|
||||
@@ -687,6 +687,14 @@ void CDECL wine_server_release_fd( HANDLE handle, int unix_fd )
|
||||
unix_funcs->server_release_fd( handle, unix_fd );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
+ /***********************************************************************
|
||||
+ * wine_server_close_fds_by_type
|
||||
+ *
|
||||
+ * Needed for a proper implementation of WSACleanup.
|
||||
+ */
|
||||
+void CDECL wine_server_close_fds_by_type( enum server_fd_type type )
|
||||
+{
|
||||
+ unix_funcs->server_remove_fds_from_cache_by_type( type );
|
||||
+}
|
||||
+
|
||||
|
||||
/***********************************************************************
|
||||
* server_init_process
|
||||
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
|
||||
index 4a3f101d301..8b10964603e 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,
|
||||
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
|
||||
--- 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 )
|
||||
return fd;
|
||||
}
|
||||
|
||||
+/***********************************************************************
|
||||
+ * server_remove_fds_from_cache_by_type
|
||||
+ */
|
||||
+void CDECL server_remove_fds_from_cache_by_type( enum server_fd_type type )
|
||||
+{
|
||||
+ union fd_cache_entry cache;
|
||||
+ unsigned int entry, idx;
|
||||
+
|
||||
@@ -52,17 +87,47 @@ index 356d631..381d5aa 100644
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/***********************************************************************
|
||||
|
||||
/***********************************************************************
|
||||
* server_get_unix_fd
|
||||
*
|
||||
* The returned unix_fd should be closed iff needs_close is non-zero.
|
||||
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
|
||||
index 2bf39f85371..32c03fd8983 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;
|
||||
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
|
||||
--- a/dlls/ntdll/unixlib.h
|
||||
+++ b/dlls/ntdll/unixlib.h
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "wine/debug.h"
|
||||
|
||||
/* increment this when you change the function table */
|
||||
-#define NTDLL_UNIXLIB_VERSION 10
|
||||
+#define NTDLL_UNIXLIB_VERSION 11
|
||||
|
||||
struct unix_funcs
|
||||
{
|
||||
@@ -55,6 +55,7 @@ struct unix_funcs
|
||||
unsigned int (CDECL *server_call)( void *req_ptr );
|
||||
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 );
|
||||
NTSTATUS (CDECL *server_fd_to_handle)( int fd, unsigned int access, unsigned int attributes,
|
||||
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
|
||||
index ea45397..c50d2b6 100644
|
||||
index bbc44ca2c20..37d110d216f 100644
|
||||
--- a/dlls/ws2_32/socket.c
|
||||
+++ b/dlls/ws2_32/socket.c
|
||||
@@ -1495,6 +1495,7 @@ INT WINAPI WSACleanup(void)
|
||||
@@ -1729,6 +1729,7 @@ INT WINAPI WSACleanup(void)
|
||||
|
||||
if (!--num_startup)
|
||||
{
|
||||
@@ -71,10 +136,10 @@ index ea45397..c50d2b6 100644
|
||||
{
|
||||
wine_server_call( req );
|
||||
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
|
||||
index e3732a3..9ed71aa 100644
|
||||
index 9fe89d9dba3..c2e1379fe6f 100644
|
||||
--- a/dlls/ws2_32/tests/sock.c
|
||||
+++ b/dlls/ws2_32/tests/sock.c
|
||||
@@ -1179,10 +1179,7 @@ static void test_WithWSAStartup(void)
|
||||
@@ -1250,10 +1250,7 @@ static void test_WithWSAStartup(void)
|
||||
SetLastError(0xdeadbeef);
|
||||
res = getsockname(sock, (struct sockaddr *)&saddr, &size);
|
||||
error = WSAGetLastError();
|
||||
@@ -87,7 +152,7 @@ index e3732a3..9ed71aa 100644
|
||||
}
|
||||
}
|
||||
diff --git a/include/wine/server.h b/include/wine/server.h
|
||||
index d573d1f..02d9c7b 100644
|
||||
index ac5dcc6f8bc..5cf52887516 100644
|
||||
--- a/include/wine/server.h
|
||||
+++ b/include/wine/server.h
|
||||
@@ -54,6 +54,7 @@ extern void CDECL wine_server_send_fd( int fd );
|
||||
@@ -99,5 +164,5 @@ index d573d1f..02d9c7b 100644
|
||||
/* do a server call and set the last error code */
|
||||
static inline unsigned int wine_server_call_err( void *req_ptr )
|
||||
--
|
||||
2.6.2
|
||||
2.26.2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user