Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- 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;