Commit e078f698 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ws2_32: Cap the negotiated winsock version to 1.1 or 2.2.

parent 864bef4f
......@@ -578,7 +578,13 @@ int WINAPI WSAStartup( WORD version, WSADATA *data )
if (data)
{
data->wVersion = version;
if (!LOBYTE(version) || LOBYTE(version) > 2
|| (LOBYTE(version) == 2 && HIBYTE(version) > 2))
data->wVersion = MAKEWORD(2, 2);
else if (LOBYTE(version) == 1 && HIBYTE(version) > 1)
data->wVersion = MAKEWORD(1, 1);
else
data->wVersion = version;
data->wHighVersion = MAKEWORD(2, 2);
strcpy( data->szDescription, "WinSock 2.0" );
strcpy( data->szSystemStatus, "Running" );
......
......@@ -2851,8 +2851,7 @@ static void test_startup(void)
data.lpVendorInfo = (void *)0xdeadbeef;
ret = WSAStartup(tests[i].version, &data);
ok(ret == (LOBYTE(tests[i].version) ? 0 : WSAVERNOTSUPPORTED), "got %d\n", ret);
todo_wine_if (tests[i].version != tests[i].ret_version)
ok(data.wVersion == tests[i].ret_version, "got version %#x\n", data.wVersion);
ok(data.wVersion == tests[i].ret_version, "got version %#x\n", data.wVersion);
if (!ret)
{
ret = WSAStartup(tests[i].version, &data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment