From bd48a9ccc2758dd17a77a270ca7ba300def06880 Mon Sep 17 00:00:00 2001 From: Denis Robert Date: Sat, 29 Mar 2025 21:29:28 +0100 Subject: [PATCH 1/3] The socket created by accept has the same properties as the listening socket --- dll/win32/msafd/misc/dllmain.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/dll/win32/msafd/misc/dllmain.c b/dll/win32/msafd/misc/dllmain.c index 79623a142c0..e9b922fdcf4 100644 --- a/dll/win32/msafd/misc/dllmain.c +++ b/dll/win32/msafd/misc/dllmain.c @@ -1821,6 +1821,17 @@ WSPAccept( if (lpErrno) *lpErrno = NO_ERROR; + /* AcceptSocket Async Events */ + if (Socket->SharedData->NonBlocking) + { + /* The socket created by the accept function has the same + * properties as the listening socket used to accept it. */ + WSAAsyncSelect(AcceptSocket, + Socket->SharedData->hWnd, + Socket->SharedData->wMsg, + Socket->SharedData->AsyncEvents); + } + /* Return Socket */ return AcceptSocket; } @@ -1974,12 +1985,6 @@ WSPConnect(SOCKET Handle, ConnectInfo->UseSAN = FALSE; ConnectInfo->Unknown = 0; - /* FIXME: Handle Async Connect */ - if (Socket->SharedData->NonBlocking) - { - ERR("Async Connect UNIMPLEMENTED!\n"); - } - /* Send IOCTL */ Status = NtDeviceIoControlFile((HANDLE)Handle, SockEvent, From 6a6060f43d88b2d070296a04e1eebdcf5783d0ff Mon Sep 17 00:00:00 2001 From: Denis Robert Date: Sun, 30 Mar 2025 14:56:24 +0200 Subject: [PATCH 2/3] This line should stay before return --- dll/win32/msafd/misc/dllmain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/win32/msafd/misc/dllmain.c b/dll/win32/msafd/misc/dllmain.c index e9b922fdcf4..d56d7096b13 100644 --- a/dll/win32/msafd/misc/dllmain.c +++ b/dll/win32/msafd/misc/dllmain.c @@ -1819,8 +1819,6 @@ WSPAccept( } } - if (lpErrno) *lpErrno = NO_ERROR; - /* AcceptSocket Async Events */ if (Socket->SharedData->NonBlocking) { @@ -1832,6 +1830,8 @@ WSPAccept( Socket->SharedData->AsyncEvents); } + if (lpErrno) *lpErrno = NO_ERROR; + /* Return Socket */ return AcceptSocket; } From 2572d1d279ad75d8786d95cc9955d0b8d55d556a Mon Sep 17 00:00:00 2001 From: Denis Robert Date: Sun, 30 Mar 2025 14:59:37 +0200 Subject: [PATCH 3/3] Resolve conflict with PR6349 --- dll/win32/msafd/misc/dllmain.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dll/win32/msafd/misc/dllmain.c b/dll/win32/msafd/misc/dllmain.c index d56d7096b13..5e3bcefdb23 100644 --- a/dll/win32/msafd/misc/dllmain.c +++ b/dll/win32/msafd/misc/dllmain.c @@ -1985,6 +1985,12 @@ WSPConnect(SOCKET Handle, ConnectInfo->UseSAN = FALSE; ConnectInfo->Unknown = 0; + /* FIXME: Handle Async Connect */ + if (Socket->SharedData->NonBlocking) + { + ERR("Async Connect UNIMPLEMENTED!\n"); + } + /* Send IOCTL */ Status = NtDeviceIoControlFile((HANDLE)Handle, SockEvent,