mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Rebase against 7c18fe17c76efd7d7a2b2648c48e5990c2ae780a.
[ws2_32-DisconnectEx] Removed patch to implement semi-stub for ws2_32 DisconnectEx function (accepted upstream).
This commit is contained in:
parent
ed798c278d
commit
ab065dcd70
@ -51,7 +51,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "00b68720bf32748422e6ccab8629acf04aec9d5a"
|
||||
echo "7c18fe17c76efd7d7a2b2648c48e5990c2ae780a"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
@ -392,7 +392,6 @@ patch_enable_all ()
|
||||
enable_wpcap_Several_Fixes="$1"
|
||||
enable_ws2_32_APC_Performance="$1"
|
||||
enable_ws2_32_Connect_Time="$1"
|
||||
enable_ws2_32_DisconnectEx="$1"
|
||||
enable_ws2_32_Sort_default_route="$1"
|
||||
enable_ws2_32_TransmitFile="$1"
|
||||
enable_ws2_32_WSACleanup="$1"
|
||||
@ -1351,9 +1350,6 @@ patch_enable ()
|
||||
ws2_32-Connect_Time)
|
||||
enable_ws2_32_Connect_Time="$2"
|
||||
;;
|
||||
ws2_32-DisconnectEx)
|
||||
enable_ws2_32_DisconnectEx="$2"
|
||||
;;
|
||||
ws2_32-Sort_default_route)
|
||||
enable_ws2_32_Sort_default_route="$2"
|
||||
;;
|
||||
@ -7711,20 +7707,6 @@ if test "$enable_ws2_32_Connect_Time" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ws2_32-DisconnectEx
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/ws2_32/socket.c, dlls/ws2_32/tests/sock.c
|
||||
# |
|
||||
if test "$enable_ws2_32_DisconnectEx" -eq 1; then
|
||||
patch_apply ws2_32-DisconnectEx/0001-ws2_32-tests-Add-tests-for-DisconnectEx.patch
|
||||
patch_apply ws2_32-DisconnectEx/0002-ws2_32-Add-semi-stub-for-DisconnectEx.patch
|
||||
(
|
||||
echo '+ { "Michael Müller", "ws2_32/tests: Add tests for DisconnectEx.", 1 },';
|
||||
echo '+ { "Michael Müller", "ws2_32: Add semi-stub for DisconnectEx.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ws2_32-Sort_default_route
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
|
@ -1,127 +0,0 @@
|
||||
From 94b9db739d25609e92223e7c58cd11a456e2a231 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 13 Mar 2016 20:28:15 +0100
|
||||
Subject: ws2_32/tests: Add tests for DisconnectEx.
|
||||
|
||||
---
|
||||
dlls/ws2_32/tests/sock.c | 97 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 97 insertions(+)
|
||||
|
||||
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
|
||||
index d5e01c8..80173ed 100644
|
||||
--- a/dlls/ws2_32/tests/sock.c
|
||||
+++ b/dlls/ws2_32/tests/sock.c
|
||||
@@ -7810,6 +7810,102 @@ end:
|
||||
closesocket(connector2);
|
||||
}
|
||||
|
||||
+static void test_DisconnectEx(void)
|
||||
+{
|
||||
+ SOCKET listener, acceptor, connector;
|
||||
+ LPFN_DISCONNECTEX pDisconnectEx;
|
||||
+ GUID disconnectExGuid = WSAID_DISCONNECTEX;
|
||||
+ struct sockaddr_in address;
|
||||
+ DWORD num_bytes, flags;
|
||||
+ OVERLAPPED overlapped;
|
||||
+ int addrlen, iret;
|
||||
+ BOOL bret;
|
||||
+
|
||||
+ connector = socket(AF_INET, SOCK_STREAM, 0);
|
||||
+ ok(connector != INVALID_SOCKET, "failed to create connector socket, error %d\n", WSAGetLastError());
|
||||
+
|
||||
+ iret = WSAIoctl(connector, SIO_GET_EXTENSION_FUNCTION_POINTER, &disconnectExGuid, sizeof(disconnectExGuid),
|
||||
+ &pDisconnectEx, sizeof(pDisconnectEx), &num_bytes, NULL, NULL);
|
||||
+ if (iret)
|
||||
+ {
|
||||
+ skip("WSAIoctl failed to get DisconnectEx, error %d\n", WSAGetLastError());
|
||||
+ closesocket(connector);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ listener = socket(AF_INET, SOCK_STREAM, 0);
|
||||
+ ok(listener != INVALID_SOCKET, "failed to create listener socket, error %d\n", WSAGetLastError());
|
||||
+
|
||||
+ memset(&address, 0, sizeof(address));
|
||||
+ address.sin_family = AF_INET;
|
||||
+ address.sin_addr.s_addr = inet_addr("127.0.0.1");
|
||||
+ iret = bind(listener, (struct sockaddr *)&address, sizeof(address));
|
||||
+ ok(iret == 0, "failed to bind, error %d\n", WSAGetLastError());
|
||||
+
|
||||
+ addrlen = sizeof(address);
|
||||
+ iret = getsockname(listener, (struct sockaddr *)&address, &addrlen);
|
||||
+ ok(iret == 0, "failed to lookup bind address, error %d\n", WSAGetLastError());
|
||||
+
|
||||
+ iret = listen(listener, 1);
|
||||
+ ok(iret == 0, "failed to listen, error %d\n", WSAGetLastError());
|
||||
+
|
||||
+ set_blocking(listener, TRUE);
|
||||
+
|
||||
+ memset(&overlapped, 0, sizeof(overlapped));
|
||||
+ bret = pDisconnectEx(INVALID_SOCKET, &overlapped, 0, 0);
|
||||
+ ok(bret == FALSE, "DisconnectEx unexpectedly succeeded\n");
|
||||
+ ok(WSAGetLastError() == WSAENOTSOCK, "expected WSAENOTSOCK, got %u\n", WSAGetLastError());
|
||||
+
|
||||
+ memset(&overlapped, 0, sizeof(overlapped));
|
||||
+ bret = pDisconnectEx(connector, &overlapped, 0, 0);
|
||||
+ ok(bret == FALSE, "DisconnectEx unexpectedly succeeded\n");
|
||||
+ ok(WSAGetLastError() == WSAENOTCONN, "expected WSAENOTCONN, got %u\n", WSAGetLastError());
|
||||
+
|
||||
+ iret = connect(connector, (struct sockaddr *)&address, addrlen);
|
||||
+ ok(iret == 0, "failed to connect, error %d\n", WSAGetLastError());
|
||||
+
|
||||
+ acceptor = accept(listener, NULL, NULL);
|
||||
+ ok(acceptor != INVALID_SOCKET, "could not accept socket, error %d\n", WSAGetLastError());
|
||||
+
|
||||
+ memset(&overlapped, 0, sizeof(overlapped));
|
||||
+ overlapped.hEvent = WSACreateEvent();
|
||||
+ ok(overlapped.hEvent != WSA_INVALID_EVENT, "WSACreateEvent failed, error %d\n", WSAGetLastError());
|
||||
+ bret = pDisconnectEx(connector, &overlapped, 0, 0);
|
||||
+ if (bret)
|
||||
+ ok(overlapped.Internal == STATUS_PENDING, "expected STATUS_PENDING, got %08lx\n", overlapped.Internal);
|
||||
+ else if (WSAGetLastError() == ERROR_IO_PENDING)
|
||||
+ bret = WSAGetOverlappedResult(connector, &overlapped, &num_bytes, TRUE, &flags);
|
||||
+ ok(bret, "DisconnectEx failed, error %d\n", WSAGetLastError());
|
||||
+ WSACloseEvent(overlapped.hEvent);
|
||||
+
|
||||
+ iret = connect(connector, (struct sockaddr *)&address, sizeof(address));
|
||||
+ ok(iret != 0, "connect unexpectedly succeeded\n");
|
||||
+ ok(WSAGetLastError() == WSAEISCONN, "expected WSAEISCONN, got %d\n", WSAGetLastError());
|
||||
+
|
||||
+ closesocket(acceptor);
|
||||
+ closesocket(connector);
|
||||
+
|
||||
+ connector = socket(AF_INET, SOCK_STREAM, 0);
|
||||
+ ok(connector != INVALID_SOCKET, "failed to create connector socket, error %d\n", WSAGetLastError());
|
||||
+
|
||||
+ iret = connect(connector, (struct sockaddr *)&address, addrlen);
|
||||
+ ok(iret == 0, "failed to connect, error %d\n", WSAGetLastError());
|
||||
+
|
||||
+ acceptor = accept(listener, NULL, NULL);
|
||||
+ ok(acceptor != INVALID_SOCKET, "could not accept socket, error %d\n", WSAGetLastError());
|
||||
+
|
||||
+ bret = pDisconnectEx(connector, NULL, 0, 0);
|
||||
+ ok(bret, "DisconnectEx failed, error %d\n", WSAGetLastError());
|
||||
+
|
||||
+ iret = connect(connector, (struct sockaddr *)&address, sizeof(address));
|
||||
+ ok(iret != 0, "connect unexpectedly succeeded\n");
|
||||
+ ok(WSAGetLastError() == WSAEISCONN, "expected WSAEISCONN, got %d\n", WSAGetLastError());
|
||||
+
|
||||
+ closesocket(acceptor);
|
||||
+ closesocket(connector);
|
||||
+ closesocket(listener);
|
||||
+}
|
||||
+
|
||||
#define compare_file(h,s,o) compare_file2(h,s,o,__FILE__,__LINE__)
|
||||
|
||||
static void compare_file2(HANDLE handle, SOCKET sock, int offset, const char *file, int line)
|
||||
@@ -9588,6 +9684,7 @@ START_TEST( sock )
|
||||
test_getaddrinfo();
|
||||
test_AcceptEx();
|
||||
test_ConnectEx();
|
||||
+ test_DisconnectEx();
|
||||
|
||||
test_sioRoutingInterfaceQuery();
|
||||
test_sioAddressListChange();
|
||||
--
|
||||
2.7.1
|
||||
|
@ -1,74 +0,0 @@
|
||||
From 6c6435011c6cdceb9c3e54f00a2da933ea16e463 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 13 Mar 2016 23:00:49 +0100
|
||||
Subject: ws2_32: Add semi-stub for DisconnectEx.
|
||||
|
||||
---
|
||||
dlls/ws2_32/socket.c | 21 ++++++++++++++++++++-
|
||||
dlls/ws2_32/tests/sock.c | 4 ++--
|
||||
2 files changed, 22 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
|
||||
index f62c9cd..0fea98a 100644
|
||||
--- a/dlls/ws2_32/socket.c
|
||||
+++ b/dlls/ws2_32/socket.c
|
||||
@@ -3552,6 +3552,24 @@ connection_success:
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+/***********************************************************************
|
||||
+ * DisconnectEx
|
||||
+ */
|
||||
+static BOOL WINAPI WS2_DisconnectEx( SOCKET s, LPOVERLAPPED ov, DWORD flags, DWORD reserved )
|
||||
+{
|
||||
+ FIXME( "socket %04lx, ov %p, flags 0x%x, reserved 0x%x: semi-stub\n", s, ov, flags, reserved );
|
||||
+
|
||||
+ if (flags & TF_REUSE_SOCKET)
|
||||
+ FIXME( "Reusing sockets is not supported, problems ahead.\n" );
|
||||
+
|
||||
+ if (ov)
|
||||
+ {
|
||||
+ ov->Internal = STATUS_PENDING;
|
||||
+ ov->InternalHigh = 0;
|
||||
+ }
|
||||
+
|
||||
+ return !WS_shutdown( s, SD_BOTH );
|
||||
+}
|
||||
|
||||
/***********************************************************************
|
||||
* getpeername (WS2_32.5)
|
||||
@@ -4767,7 +4785,8 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
|
||||
}
|
||||
else if ( IsEqualGUID(&disconnectex_guid, in_buff) )
|
||||
{
|
||||
- FIXME("SIO_GET_EXTENSION_FUNCTION_POINTER: unimplemented DisconnectEx\n");
|
||||
+ *(LPFN_DISCONNECTEX *)out_buff = WS2_DisconnectEx;
|
||||
+ break;
|
||||
}
|
||||
else if ( IsEqualGUID(&acceptex_guid, in_buff) )
|
||||
{
|
||||
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
|
||||
index 80173ed..a982e1e 100644
|
||||
--- a/dlls/ws2_32/tests/sock.c
|
||||
+++ b/dlls/ws2_32/tests/sock.c
|
||||
@@ -7828,7 +7828,7 @@ static void test_DisconnectEx(void)
|
||||
&pDisconnectEx, sizeof(pDisconnectEx), &num_bytes, NULL, NULL);
|
||||
if (iret)
|
||||
{
|
||||
- skip("WSAIoctl failed to get DisconnectEx, error %d\n", WSAGetLastError());
|
||||
+ win_skip("WSAIoctl failed to get DisconnectEx, error %d\n", WSAGetLastError());
|
||||
closesocket(connector);
|
||||
return;
|
||||
}
|
||||
@@ -7859,7 +7859,7 @@ static void test_DisconnectEx(void)
|
||||
memset(&overlapped, 0, sizeof(overlapped));
|
||||
bret = pDisconnectEx(connector, &overlapped, 0, 0);
|
||||
ok(bret == FALSE, "DisconnectEx unexpectedly succeeded\n");
|
||||
- ok(WSAGetLastError() == WSAENOTCONN, "expected WSAENOTCONN, got %u\n", WSAGetLastError());
|
||||
+ todo_wine ok(WSAGetLastError() == WSAENOTCONN, "expected WSAENOTCONN, got %u\n", WSAGetLastError());
|
||||
|
||||
iret = connect(connector, (struct sockaddr *)&address, addrlen);
|
||||
ok(iret == 0, "failed to connect, error %d\n", WSAGetLastError());
|
||||
--
|
||||
2.7.1
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: Implement semi-stub for ws2_32 DisconnectEx
|
Loading…
Reference in New Issue
Block a user