[1/4] ws2_32: Use the struct information when the parameters are zero in WSASocket

Alexandre Julliard julliard at winehq.org
Tue Sep 17 05:00:53 CDT 2013


Bruno Jesus <00cpxxx at gmail.com> writes:

> @@ -5884,20 +5884,20 @@ SOCKET WINAPI WSASocketW(int af, int type, int protocol,
>        return ret;
>      }
>  
> -    /* convert the socket family and type */
> -    af = convert_af_w2u(af);
> -    type = convert_socktype_w2u(type);
> -
>      if (lpProtocolInfo)
>      {
> -        if (af == FROM_PROTOCOL_INFO)
> +        if (af <= 0)
>              af = lpProtocolInfo->iAddressFamily;
> -        if (type == FROM_PROTOCOL_INFO)
> +        if (type <= 0)
>              type = lpProtocolInfo->iSocketType;
> -        if (protocol == FROM_PROTOCOL_INFO)
> +        if (protocol <= 0)
>              protocol = lpProtocolInfo->iProtocol;

I don't see anything in the tests that would justify checking for
negative values here.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list