Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/ws2_32/socket.c | 33 ++++++++++++++++----------------- dlls/ws2_32/tests/protocol.c | 9 +++------ 2 files changed, 19 insertions(+), 23 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index fe7e4fb3464..23140529b24 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -572,29 +572,28 @@ BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved ) /*********************************************************************** * WSAStartup (WS2_32.115) */ -int WINAPI WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData) +int WINAPI WSAStartup( WORD version, WSADATA *data ) { - TRACE("verReq=%x\n", wVersionRequested); + TRACE( "version %#x\n", version );
- if (LOBYTE(wVersionRequested) < 1) + if (data) + { + data->wVersion = version; + data->wHighVersion = MAKEWORD(2, 2); + strcpy( data->szDescription, "WinSock 2.0" ); + strcpy( data->szSystemStatus, "Running" ); + data->iMaxSockets = MAX_SOCKETS_PER_PROCESS; + data->iMaxUdpDg = MAX_UDP_DATAGRAM; + /* don't fill lpVendorInfo */ + } + + if (!LOBYTE(version)) return WSAVERNOTSUPPORTED;
- if (!lpWSAData) return WSAEINVAL; + if (!data) return WSAEINVAL;
num_startup++; - - /* that's the whole of the negotiation for now */ - lpWSAData->wVersion = wVersionRequested; - /* return winsock information */ - lpWSAData->wHighVersion = 0x0202; - strcpy(lpWSAData->szDescription, "WinSock 2.0" ); - strcpy(lpWSAData->szSystemStatus, "Running" ); - lpWSAData->iMaxSockets = MAX_SOCKETS_PER_PROCESS; - lpWSAData->iMaxUdpDg = MAX_UDP_DATAGRAM; - /* don't do anything with lpWSAData->lpVendorInfo */ - /* (some apps don't allocate the space for this field) */ - - TRACE("succeeded starts: %d\n", num_startup); + TRACE( "increasing startup count to %d\n", num_startup ); return 0; }
diff --git a/dlls/ws2_32/tests/protocol.c b/dlls/ws2_32/tests/protocol.c index a23cf51a8bd..f859ad40e30 100644 --- a/dlls/ws2_32/tests/protocol.c +++ b/dlls/ws2_32/tests/protocol.c @@ -2869,12 +2869,9 @@ static void test_startup(void) todo_wine ok(!WSAGetLastError(), "got error %u\n", WSAGetLastError()); } ok(data.lpVendorInfo == (void *)0xdeadbeef, "got vendor info %p\n", data.lpVendorInfo); - todo_wine_if (ret) - { - 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)); - } + 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); todo_wine ok(data.iMaxUdpDg == (LOBYTE(tests[i].version) == 1 ? 65467 : 0), "got maximum datagram size %u\n", data.iMaxUdpDg);