Commit 2a573c6f authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ws2_32: Always return WSAEINVAL if AF_UNSPEC is used with a zero protocol.

parent 088b7c58
...@@ -7648,7 +7648,13 @@ SOCKET WINAPI WSASocketW(int af, int type, int protocol, ...@@ -7648,7 +7648,13 @@ SOCKET WINAPI WSASocketW(int af, int type, int protocol,
protocol = lpProtocolInfo->iProtocol; protocol = lpProtocolInfo->iProtocol;
} }
if (!type && (af || protocol)) if (!af && !protocol)
{
WSASetLastError(WSAEINVAL);
return INVALID_SOCKET;
}
if (!type)
{ {
int autoproto = protocol; int autoproto = protocol;
WSAPROTOCOL_INFOW infow; WSAPROTOCOL_INFOW infow;
......
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