Zebediah Figura : ntdll: Fill the I/O status block with the results of the recv_socket call in sock_recv().

Alexandre Julliard julliard at winehq.org
Mon Jul 26 15:30:29 CDT 2021


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

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Mon Jul 26 11:53:47 2021 -0500

ntdll: Fill the I/O status block with the results of the recv_socket call in sock_recv().

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/unix/socket.c | 11 +++++------
 dlls/ws2_32/tests/afd.c  |  4 ++--
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/dlls/ntdll/unix/socket.c b/dlls/ntdll/unix/socket.c
index e29dc7f66d1..3ea722a48ec 100644
--- a/dlls/ntdll/unix/socket.c
+++ b/dlls/ntdll/unix/socket.c
@@ -615,12 +615,6 @@ static NTSTATUS sock_recv( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, voi
     if (status == STATUS_DEVICE_NOT_READY && force_async)
         status = STATUS_PENDING;
 
-    if (!NT_ERROR(status))
-    {
-        io->Status = status;
-        io->Information = information;
-    }
-
     SERVER_START_REQ( recv_socket )
     {
         req->status = status;
@@ -630,6 +624,11 @@ static NTSTATUS sock_recv( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, voi
         status = wine_server_call( req );
         wait_handle = wine_server_ptr_handle( reply->wait );
         options     = reply->options;
+        if ((!NT_ERROR(status) || wait_handle) && status != STATUS_PENDING)
+        {
+            io->Status = status;
+            io->Information = information;
+        }
     }
     SERVER_END_REQ;
 
diff --git a/dlls/ws2_32/tests/afd.c b/dlls/ws2_32/tests/afd.c
index 50922500859..eb7c8ee50de 100644
--- a/dlls/ws2_32/tests/afd.c
+++ b/dlls/ws2_32/tests/afd.c
@@ -978,8 +978,8 @@ static void test_recv(void)
     ret = NtDeviceIoControlFile((HANDLE)client, event, NULL, NULL, &io,
             IOCTL_AFD_RECV, &params, sizeof(params), NULL, 0);
     ok(ret == STATUS_PENDING, "got %#x\n", ret);
-    todo_wine ok(!io.Status, "got status %#x\n", io.Status);
-    todo_wine ok(!io.Information, "got information %#Ix\n", io.Information);
+    ok(!io.Status, "got status %#x\n", io.Status);
+    ok(!io.Information, "got information %#Ix\n", io.Information);
 
     ret = send(server, "data", 5, 0);
     ok(ret == 5, "got %d\n", ret);




More information about the wine-cvs mailing list