Zebediah Figura : ws2_32: Return WSAEFAULT instead of WSAEINVAL from WSAStartup() if "data" is NULL.

Alexandre Julliard julliard at winehq.org
Tue Feb 1 15:21:34 CST 2022


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

Author: Zebediah Figura <zfigura at 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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at 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 8b429e5c914..1ff335f7fe2 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();
     }




More information about the wine-cvs mailing list