Zebediah Figura : ws2_32: Use IOCTL_AFD_WINE_DEFER.

Alexandre Julliard julliard at winehq.org
Fri Jun 18 14:45:52 CDT 2021


Module: wine
Branch: master
Commit: 5a20e0878eae0327b62d2152ba33c81e0f5a085e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=5a20e0878eae0327b62d2152ba33c81e0f5a085e

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu Jun 17 20:58:23 2021 -0500

ws2_32: Use IOCTL_AFD_WINE_DEFER.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ws2_32/socket.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 3c3eef72f51..bfc4bb6c09d 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -4564,18 +4564,16 @@ SOCKET WINAPI WSAAccept( SOCKET s, struct WS_sockaddr *addr, int *addrlen,
         return cs;
 
     case CF_DEFER:
-        SERVER_START_REQ( set_socket_deferred )
-        {
-            req->handle = wine_server_obj_handle( SOCKET2HANDLE(s) );
-            req->deferred = wine_server_obj_handle( SOCKET2HANDLE(cs) );
-            if ( !wine_server_call_err ( req ) )
-            {
-                SetLastError( WSATRY_AGAIN );
-                WS_closesocket( cs );
-            }
-        }
-        SERVER_END_REQ;
-        return SOCKET_ERROR;
+    {
+        obj_handle_t server_handle = cs;
+        IO_STATUS_BLOCK io;
+        NTSTATUS status;
+
+        status = NtDeviceIoControlFile( (HANDLE)s, NULL, NULL, NULL, &io, IOCTL_AFD_WINE_DEFER,
+                                        &server_handle, sizeof(server_handle), NULL, 0 );
+        SetLastError( status ? RtlNtStatusToDosError( status ) : WSATRY_AGAIN );
+        return -1;
+    }
 
     case CF_REJECT:
         WS_closesocket( cs );




More information about the wine-cvs mailing list