mirror of
https://github.com/reactos/wine.git
synced 2025-02-18 03:48:01 +00:00
ws2_32: Do not allow socket creation if WSAStartup was not called.
This commit is contained in:
parent
0298165bea
commit
2034f51598
@ -5878,6 +5878,12 @@ SOCKET WINAPI WSASocketW(int af, int type, int protocol,
|
||||
TRACE("af=%d type=%d protocol=%d protocol_info=%p group=%d flags=0x%x\n",
|
||||
af, type, protocol, lpProtocolInfo, g, dwFlags );
|
||||
|
||||
if (!num_startup)
|
||||
{
|
||||
err = WSANOTINITIALISED;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* hack for WSADuplicateSocket */
|
||||
if (lpProtocolInfo && lpProtocolInfo->dwServiceFlags4 == 0xff00ff00) {
|
||||
ret = lpProtocolInfo->dwServiceFlags3;
|
||||
|
@ -975,7 +975,6 @@ static void test_WithoutWSAStartup(void)
|
||||
WSASetLastError(0xdeadbeef);
|
||||
ok(WSASocketA(0, 0, 0, NULL, 0, 0) == INVALID_SOCKET, "WSASocketA should have failed\n");
|
||||
err = WSAGetLastError();
|
||||
todo_wine
|
||||
ok(err == WSANOTINITIALISED, "Expected 10093, received %d\n", err);
|
||||
|
||||
WSASetLastError(0xdeadbeef);
|
||||
|
Loading…
x
Reference in New Issue
Block a user