Connor McAdams : ws2_32: Return WSAEINVAL from GetAddrInfoExOverlappedResult if overlapped is NULL.

Alexandre Julliard julliard at winehq.org
Wed Dec 15 14:25:58 CST 2021


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

Author: Connor McAdams <cmcadams at codeweavers.com>
Date:   Wed Dec 15 13:30:03 2021 -0500

ws2_32: Return WSAEINVAL from GetAddrInfoExOverlappedResult if overlapped is NULL.

Signed-off-by: Connor McAdams <cmcadams at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ws2_32/protocol.c       | 4 ++++
 dlls/ws2_32/tests/protocol.c | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/dlls/ws2_32/protocol.c b/dlls/ws2_32/protocol.c
index 239e4d14cd2..867e9513ca2 100644
--- a/dlls/ws2_32/protocol.c
+++ b/dlls/ws2_32/protocol.c
@@ -514,6 +514,10 @@ int WINAPI GetAddrInfoExW( const WCHAR *name, const WCHAR *servname, DWORD names
 int WINAPI GetAddrInfoExOverlappedResult( OVERLAPPED *overlapped )
 {
     TRACE( "(%p)\n", overlapped );
+
+    if (!overlapped)
+        return WSAEINVAL;
+
     return overlapped->Internal;
 }
 
diff --git a/dlls/ws2_32/tests/protocol.c b/dlls/ws2_32/tests/protocol.c
index 6eebb5f6b4d..881e3a388fd 100644
--- a/dlls/ws2_32/tests/protocol.c
+++ b/dlls/ws2_32/tests/protocol.c
@@ -1904,6 +1904,9 @@ static void test_GetAddrInfoExW(void)
     ok(!ret, "GetAddrInfoExW failed with %d\n", WSAGetLastError());
     pFreeAddrInfoExW(result);
 
+    ret = pGetAddrInfoExOverlappedResult(NULL);
+    ok(ret == WSAEINVAL, "overlapped result is %d\n", ret);
+
     result = (void *)0xdeadbeef;
     memset(&overlapped, 0xcc, sizeof(overlapped));
     overlapped.hEvent = event;




More information about the wine-cvs mailing list