Kimmo Myllyvirta : ws2_32: Set return size when calling WSAIoctl with WS_SIO_GET_EXTENSION_FUNCTION_POINTER.

Alexandre Julliard julliard at winehq.org
Thu Jul 20 12:11:31 CDT 2017


Module: wine
Branch: stable
Commit: 5d41fd0bb4a16c05eba6b83f5630e2e311f0ec5e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5d41fd0bb4a16c05eba6b83f5630e2e311f0ec5e

Author: Kimmo Myllyvirta <kimmo.myllyvirta at gmail.com>
Date:   Wed Jul 12 03:17:18 2017 +0000

ws2_32: Set return size when calling WSAIoctl with WS_SIO_GET_EXTENSION_FUNCTION_POINTER.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 32334704e882eb225b4738a34d46c6407af12514)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/ws2_32/socket.c     | 1 +
 dlls/ws2_32/tests/sock.c | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 340551a..513cbfc 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -4944,6 +4944,7 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
         {
             TRACE("-> got %s\n", guid_funcs[i].name);
             *(void **)out_buff = guid_funcs[i].func_ptr;
+            total = sizeof(void *);
             break;
         }
 
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 8df3f5c..d7e7fff 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -7434,6 +7434,7 @@ static void test_ConnectEx(void)
         goto end;
     }
 
+    bytesReturned = 0xdeadbeef;
     iret = WSAIoctl(connector, SIO_GET_EXTENSION_FUNCTION_POINTER, &connectExGuid, sizeof(connectExGuid),
         &pConnectEx, sizeof(pConnectEx), &bytesReturned, NULL, NULL);
     if (iret) {
@@ -7441,6 +7442,8 @@ static void test_ConnectEx(void)
         goto end;
     }
 
+    ok(bytesReturned == sizeof(pConnectEx), "expected sizeof(pConnectEx), got %u\n", bytesReturned);
+
     bret = pConnectEx(INVALID_SOCKET, (struct sockaddr*)&address, addrlen, NULL, 0, &bytesReturned, &overlapped);
     ok(bret == FALSE && WSAGetLastError() == WSAENOTSOCK, "ConnectEx on invalid socket "
         "returned %d + errno %d\n", bret, WSAGetLastError());




More information about the wine-cvs mailing list