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>
This commit is contained in:
Zebediah Figura 2022-02-01 00:20:51 -06:00 committed by Alexandre Julliard
parent 5efc6369eb
commit a6cbdb7de8
2 changed files with 2 additions and 3 deletions

View File

@ -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 );

View File

@ -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();
}