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

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-09-24 22:21:04 -05:00 committed by Alexandre Julliard
parent 088b7c5814
commit 2a573c6f48
1 changed files with 7 additions and 1 deletions

View File

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