Module: wine Branch: stable Commit: ac95629d35622ab13f78f3acd235c8bf4de199e2 URL: https://gitlab.winehq.org/wine/wine/-/commit/ac95629d35622ab13f78f3acd235c8b...
Author: Zebediah Figura zfigura@codeweavers.com Date: Tue Feb 1 00:20:51 2022 -0600
ws2_32: Return WSAEFAULT instead of WSAEINVAL from WSAStartup() if "data" is NULL.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit a6cbdb7de82387e1a75bfdb77fa66310a322e6c8) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/ws2_32/socket.c | 2 +- dlls/ws2_32/tests/protocol.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 7a1483f140f..a75aaee68be 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -594,7 +594,7 @@ int WINAPI WSAStartup( WORD version, WSADATA *data ) if (!LOBYTE(version)) return WSAVERNOTSUPPORTED;
- if (!data) return WSAEINVAL; + if (!data) return WSAEFAULT;
num_startup++; TRACE( "increasing startup count to %d\n", num_startup ); diff --git a/dlls/ws2_32/tests/protocol.c b/dlls/ws2_32/tests/protocol.c index 9273c23b73f..43c3fa58c88 100644 --- a/dlls/ws2_32/tests/protocol.c +++ b/dlls/ws2_32/tests/protocol.c @@ -2880,8 +2880,7 @@ static void test_startup(void) ok(WSAGetLastError() == WSANOTINITIALISED, "got error %u\n", WSAGetLastError());
ret = WSAStartup(tests[i].version, NULL); - todo_wine_if (LOBYTE(tests[i].version)) - ok(ret == (LOBYTE(tests[i].version) ? WSAEFAULT : WSAVERNOTSUPPORTED), "got %d\n", ret); + ok(ret == (LOBYTE(tests[i].version) ? WSAEFAULT : WSAVERNOTSUPPORTED), "got %d\n", ret);
winetest_pop_context(); }