ws2_32: Return 32767 or 0 in the iMaxSockets field.

Depending on reported winsock version.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50352
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:49 -06:00 committed by Alexandre Julliard
parent e078f69881
commit 699643c427
2 changed files with 2 additions and 3 deletions

View File

@ -419,7 +419,6 @@ static BOOL socket_list_remove( SOCKET socket )
return FALSE;
}
#define MAX_SOCKETS_PER_PROCESS 128 /* reasonable guess */
#define MAX_UDP_DATAGRAM 1024
static INT WINAPI WSA_DefaultBlockingHook( FARPROC x );
@ -588,7 +587,7 @@ int WINAPI WSAStartup( WORD version, WSADATA *data )
data->wHighVersion = MAKEWORD(2, 2);
strcpy( data->szDescription, "WinSock 2.0" );
strcpy( data->szSystemStatus, "Running" );
data->iMaxSockets = MAX_SOCKETS_PER_PROCESS;
data->iMaxSockets = (LOBYTE(version) == 1 ? 32767 : 0);
data->iMaxUdpDg = MAX_UDP_DATAGRAM;
/* don't fill lpVendorInfo */
}

View File

@ -2871,7 +2871,7 @@ static void test_startup(void)
ok(data.wHighVersion == 0x202, "got maximum version %#x\n", data.wHighVersion);
ok(!strcmp(data.szDescription, "WinSock 2.0"), "got description %s\n", debugstr_a(data.szDescription));
ok(!strcmp(data.szSystemStatus, "Running"), "got status %s\n", debugstr_a(data.szSystemStatus));
todo_wine ok(data.iMaxSockets == (LOBYTE(tests[i].version) == 1 ? 32767 : 0), "got maximum sockets %u\n", data.iMaxSockets);
ok(data.iMaxSockets == (LOBYTE(tests[i].version) == 1 ? 32767 : 0), "got maximum sockets %u\n", data.iMaxSockets);
todo_wine ok(data.iMaxUdpDg == (LOBYTE(tests[i].version) == 1 ? 65467 : 0), "got maximum datagram size %u\n", data.iMaxUdpDg);
WSASetLastError(0xdeadbeef);