Rebase against f5b92137257b9564dca623ee9578c49b4495e220.

This commit is contained in:
Alistair Leslie-Hughes 2022-09-17 08:35:46 +10:00
parent ffaf883b19
commit 1d75f6950a
4 changed files with 2 additions and 152 deletions

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "7feaa6795a26c97b5ce4327a23129eb20a049859"
echo "f5b92137257b9564dca623ee9578c49b4495e220"
}
# Show version information
@ -257,7 +257,6 @@ patch_enable_all ()
enable_winspool_drv_ClosePrinter="$1"
enable_wintab32_improvements="$1"
enable_wintrust_WTHelperGetProvCertFromChain="$1"
enable_ws2_32_SIO_IDEAL_SEND_BACKLOG_QUERY="$1"
enable_wscript_support_d_u_switches="$1"
enable_xactengine_initial="$1"
enable_xactengine3_7_PrepareWave="$1"
@ -792,9 +791,6 @@ patch_enable ()
wintrust-WTHelperGetProvCertFromChain)
enable_wintrust_WTHelperGetProvCertFromChain="$2"
;;
ws2_32-SIO_IDEAL_SEND_BACKLOG_QUERY)
enable_ws2_32_SIO_IDEAL_SEND_BACKLOG_QUERY="$2"
;;
wscript-support-d-u-switches)
enable_wscript_support_d_u_switches="$2"
;;
@ -3780,18 +3776,6 @@ if test "$enable_wintrust_WTHelperGetProvCertFromChain" -eq 1; then
patch_apply wintrust-WTHelperGetProvCertFromChain/0001-wintrust-Add-parameter-check-in-WTHelperGetProvCertF.patch
fi
# Patchset ws2_32-SIO_IDEAL_SEND_BACKLOG_QUERY
# |
# | This patchset fixes the following Wine bugs:
# | * [#49412] ws2_32: Support WSAIoctl SIO_IDEAL_SEND_BACKLOG_QUERY
# |
# | Modified files:
# | * dlls/ntdll/unix/socket.c, dlls/ws2_32/socket.c, dlls/ws2_32/tests/sock.c, include/wine/afd.h
# |
if test "$enable_ws2_32_SIO_IDEAL_SEND_BACKLOG_QUERY" -eq 1; then
patch_apply ws2_32-SIO_IDEAL_SEND_BACKLOG_QUERY/0001-ws2_32-Return-a-valid-value-for-WSAIoctl-SIO_IDEAL_S.patch
fi
# Patchset wscript-support-d-u-switches
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1,133 +0,0 @@
From c04e4fbc278d2e434f7adcd782af094a844ff46a Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 15 Sep 2020 19:44:38 +1000
Subject: [PATCH] ws2_32: Return a valid value for WSAIoctl
SIO_IDEAL_SEND_BACKLOG_QUERY.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/ntdll/unix/socket.c | 19 +++++++++++++++++++
dlls/ws2_32/socket.c | 17 +++++++++++++++++
dlls/ws2_32/tests/sock.c | 13 ++++++++++++-
include/wine/afd.h | 1 +
4 files changed, 49 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/socket.c b/dlls/ntdll/unix/socket.c
index 351028d4983..3aef6d27eb4 100644
--- a/dlls/ntdll/unix/socket.c
+++ b/dlls/ntdll/unix/socket.c
@@ -1461,6 +1461,25 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc
return STATUS_SUCCESS;
}
+ case IOCTL_AFD_WINE_SEND_BACKLOG_QUERY:
+ {
+ if (out_size < sizeof(DWORD))
+ {
+ status = STATUS_BUFFER_TOO_SMALL;
+ break;
+ }
+
+ if(get_sock_type( handle ) != SOCK_STREAM)
+ {
+ status = STATUS_NOT_SUPPORTED;
+ break;
+ }
+
+ *(DWORD*)out_buffer = 0x10000; /* 64k */
+
+ break;
+ }
+
case IOCTL_AFD_WINE_SIOCATMARK:
{
int value, ret;
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 9cc75aacf20..156039b30b9 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -2310,6 +2310,23 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
return ret ? -1 : 0;
}
+ case SIO_IDEAL_SEND_BACKLOG_QUERY:
+ {
+ DWORD ret;
+
+ if (!out_buff)
+ {
+ SetLastError(WSAEFAULT);
+ return SOCKET_ERROR;
+ }
+
+ ret = server_ioctl_sock( s, IOCTL_AFD_WINE_SEND_BACKLOG_QUERY, in_buff, in_size,
+ out_buff, out_size, ret_size, overlapped, completion );
+ SetLastError( ret );
+ if (!ret) *ret_size = sizeof(u_long);
+ return ret ? -1 : 0;
+ }
+
case SIOCATMARK:
{
DWORD ret;
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index af4226e6258..0179feba37f 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -6708,8 +6708,9 @@ static void test_WSASendTo(void)
struct sockaddr_in addr, ret_addr;
char buf[12] = "hello world";
WSABUF data_buf;
- DWORD bytesSent;
+ DWORD bytesSent, size;
int ret, len;
+ ULONG backlog = 0;
addr.sin_family = AF_INET;
addr.sin_port = htons(139);
@@ -6745,6 +6746,11 @@ static void test_WSASendTo(void)
ok(!ret, "got error %u\n", WSAGetLastError());
ok(ret_addr.sin_family == AF_INET, "got family %u\n", ret_addr.sin_family);
ok(ret_addr.sin_port, "expected nonzero port\n");
+
+ ret = WSAIoctl(s, SIO_IDEAL_SEND_BACKLOG_QUERY, NULL, 0, &backlog, sizeof(backlog), &size, NULL, NULL);
+ ok(ret == SOCKET_ERROR && WSAGetLastError() == WSAEOPNOTSUPP,
+ "WSAIoctl() failed: %d/%d\n", ret, WSAGetLastError());
+ closesocket(s);
}
struct recv_thread_apc_param
@@ -6824,6 +6830,7 @@ static void test_WSARecv(void)
DWORD dwret;
BOOL bret;
HANDLE thread, event = NULL, io_port;
+ ULONG backlog = 0, size;
tcp_socketpair(&src, &dest);
@@ -6989,6 +6996,10 @@ static void test_WSARecv(void)
CloseHandle(io_port);
+ iret = WSAIoctl(src, SIO_IDEAL_SEND_BACKLOG_QUERY, NULL, 0, &backlog, sizeof(backlog), &size, NULL, NULL);
+ ok(!iret, "WSAIoctl() failed: %d/%d\n", iret, WSAGetLastError());
+ ok(backlog == 0x10000, "got %08lx\n", backlog);
+
end:
if (server != INVALID_SOCKET)
closesocket(server);
diff --git a/include/wine/afd.h b/include/wine/afd.h
index 993730cacdb..04dad6ace21 100644
--- a/include/wine/afd.h
+++ b/include/wine/afd.h
@@ -283,6 +283,7 @@ C_ASSERT( sizeof(struct afd_get_events_params) == 56 );
#define IOCTL_AFD_WINE_SET_IP_RECVTTL WINE_AFD_IOC(294)
#define IOCTL_AFD_WINE_GET_IP_RECVTOS WINE_AFD_IOC(295)
#define IOCTL_AFD_WINE_SET_IP_RECVTOS WINE_AFD_IOC(296)
+#define IOCTL_AFD_WINE_SEND_BACKLOG_QUERY WINE_AFD_IOC(297)
struct afd_iovec
{
--
2.35.1

View File

@ -1 +0,0 @@
Fixes: [49412] ws2_32: Support WSAIoctl SIO_IDEAL_SEND_BACKLOG_QUERY

View File

@ -1 +1 @@
7feaa6795a26c97b5ce4327a23129eb20a049859
f5b92137257b9564dca623ee9578c49b4495e220