Zebediah Figura : ws2_32: Wait for synchronous ioctl completion in server_ioctl_sock().

Alexandre Julliard julliard at winehq.org
Mon Jun 7 16:30:38 CDT 2021


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

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Fri Jun  4 16:24:19 2021 -0500

ws2_32: Wait for synchronous ioctl completion in server_ioctl_sock().

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

---

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

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 3c7bfdf6edb..a425905e5af 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -3188,6 +3188,10 @@ static DWORD server_ioctl_sock( SOCKET s, DWORD code, LPVOID in_buff, DWORD in_s
         if (!((ULONG_PTR)overlapped->hEvent & 1)) cvalue = overlapped;
         event = overlapped->hEvent;
     }
+    else
+    {
+        if (!(event = get_sync_event())) return GetLastError();
+    }
 
     if (completion)
     {
@@ -3198,6 +3202,12 @@ static DWORD server_ioctl_sock( SOCKET s, DWORD code, LPVOID in_buff, DWORD in_s
 
     status = NtDeviceIoControlFile( handle, event, apc, cvalue, piosb, code,
                                     in_buff, in_size, out_buff, out_size );
+    if (status == STATUS_PENDING && !overlapped)
+    {
+        if (WaitForSingleObject( event, INFINITE ) == WAIT_FAILED)
+            return -1;
+        status = piosb->u.Status;
+    }
     if (status == STATUS_NOT_SUPPORTED)
     {
         FIXME("Unsupported ioctl %x (device=%x access=%x func=%x method=%x)\n",




More information about the wine-cvs mailing list