Paul Gofman : netio.sys: Implement wsk_bind() function.

Alexandre Julliard julliard at winehq.org
Thu Jun 18 15:33:36 CDT 2020


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

Author: Paul Gofman <pgofman at codeweavers.com>
Date:   Wed Jun 17 20:21:58 2020 +0300

netio.sys: Implement wsk_bind() function.

Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/netio.sys/netio.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/dlls/netio.sys/netio.c b/dlls/netio.sys/netio.c
index 408d75856c..36a6a41b99 100644
--- a/dlls/netio.sys/netio.c
+++ b/dlls/netio.sys/netio.c
@@ -135,10 +135,24 @@ static NTSTATUS WINAPI wsk_close_socket(WSK_SOCKET *socket, IRP *irp)
 
 static NTSTATUS WINAPI wsk_bind(WSK_SOCKET *socket, SOCKADDR *local_address, ULONG flags, IRP *irp)
 {
-    FIXME("socket %p, local_address %p, flags %#x, irp %p stub.\n",
+    struct wsk_socket_internal *s = wsk_socket_internal_from_wsk_socket(socket);
+    NTSTATUS status;
+
+    TRACE("socket %p, local_address %p, flags %#x, irp %p.\n",
             socket, local_address, flags, irp);
 
-    return STATUS_NOT_IMPLEMENTED;
+    if (!irp)
+        return STATUS_INVALID_PARAMETER;
+
+    if (bind(s->s, local_address, sizeof(*local_address)))
+        status = sock_error_to_ntstatus(WSAGetLastError());
+    else
+        status = STATUS_SUCCESS;
+
+    TRACE("status %#x.\n", status);
+    irp->IoStatus.Information = 0;
+    dispatch_irp(irp, status);
+    return STATUS_PENDING;
 }
 
 static NTSTATUS WINAPI wsk_accept(WSK_SOCKET *listen_socket, ULONG flags, void *accept_socket_context,




More information about the wine-cvs mailing list