Updated ws2_32-WSACleanup patch

This commit is contained in:
Alistair Leslie-Hughes 2018-02-20 20:43:52 +11:00
parent 08182c7af0
commit c35053e845

View File

@ -1,21 +1,21 @@
From 2a08bedec6070b9001315dc6a7505de150c48a88 Mon Sep 17 00:00:00 2001
From 74d113bd4472d42dec951a6340dc98f9719c0e2f Mon Sep 17 00:00:00 2001
From: Matt Durgavich <mattdurgavich@gmail.com>
Date: Sun, 30 Aug 2015 11:04:08 -0400
Subject: ws2_32: Proper WSACleanup implementation using wineserver function
(try 2)
Subject: [PATCH] ws2_32: Proper WSACleanup implementation using wineserver
function (try 2)
---
dlls/ws2_32/socket.c | 22 ++++++++++++++++------
dlls/ws2_32/tests/sock.c | 14 +++++++-------
dlls/ws2_32/tests/sock.c | 13 +++++++------
server/protocol.def | 3 +++
server/sock.c | 9 +++++++++
4 files changed, 35 insertions(+), 13 deletions(-)
4 files changed, 35 insertions(+), 12 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index d31f0b4..ea45397 100644
index 058b12d..6bdfd8b 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -1487,13 +1487,23 @@ int WINAPI WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData)
@@ -1692,13 +1692,23 @@ int WINAPI WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData)
*/
INT WINAPI WSACleanup(void)
{
@ -46,10 +46,10 @@ index d31f0b4..ea45397 100644
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 00fac77..ccd5790 100644
index be2a02d..a9788b9 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -1149,18 +1149,17 @@ static void test_WithWSAStartup(void)
@@ -1222,18 +1222,17 @@ static void test_WithWSAStartup(void)
ok(res == 0, "WSAStartup() failed unexpectedly: %d\n", res);
/* show that sockets are destroyed automatically after WSACleanup */
@ -70,12 +70,13 @@ index 00fac77..ccd5790 100644
/* Check that all sockets were destroyed */
for (i = 0; i < socks; i++)
@@ -1180,13 +1179,14 @@ static void test_WithWSAStartup(void)
@@ -1253,9 +1252,11 @@ static void test_WithWSAStartup(void)
SetLastError(0xdeadbeef);
res = getsockname(sock, (struct sockaddr *)&saddr, &size);
error = WSAGetLastError();
- ok(res == SOCKET_ERROR, "Test[%d]: getsockname should have failed\n", i);
- ok(error == WSAENOTSOCK, "Test[%d]: expected 10038, got %d\n", i, error);
- if (res == SOCKET_ERROR)
- ok(error == WSAENOTSOCK, "Test[%d]: expected 10038, got %d\n", i, error);
+ if (j == 2 || (j == 0 && i == 0))
+ todo_wine ok(res == SOCKET_ERROR, "Test[%d]: getsockname should have failed\n", i);
+ else
@ -84,16 +85,11 @@ index 00fac77..ccd5790 100644
}
}
- }
-
/* While wine is not fixed, close all sockets manually */
for (i = 0; i < socks; i++)
{
diff --git a/server/protocol.def b/server/protocol.def
index 04814c9..cfd40a0 100644
index 88fec87..fd9d2d8 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -942,6 +942,9 @@ struct rawinput_device
@@ -1015,6 +1015,9 @@ struct rawinput_device
obj_handle_t handle; /* handle to close */
@END
@ -104,10 +100,10 @@ index 04814c9..cfd40a0 100644
/* Set a handle information */
@REQ(set_handle_info)
diff --git a/server/sock.c b/server/sock.c
index 57d3d93..4e95911 100644
index 0a7d4c0..f8920fc 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -1390,3 +1390,12 @@ DECL_HANDLER(get_socket_info)
@@ -1405,3 +1405,12 @@ DECL_HANDLER(get_socket_info)
release_object( &sock->obj );
}
@ -121,5 +117,5 @@ index 57d3d93..4e95911 100644
+ close_handle(current->process, sock);
+}
--
2.6.2
1.9.1