[PATCH 2/3] ws2_32: Implement get socket option SO_PROTOCOL_INFO (try 3)

Alexandre Julliard julliard at winehq.org
Fri Sep 6 05:16:01 CDT 2013


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

> +static int ws_protocol_info(SOCKET s, int unicode, WSAPROTOCOL_INFOW *buffer)
> +{
> +    int size;
> +    union _info
> +    {
> +        WSAPROTOCOL_INFOA *a;
> +        WSAPROTOCOL_INFOW *w;
> +    } info;
> +    info.w = buffer;
> +
> +    size = unicode ? sizeof(WSAPROTOCOL_INFOW) : sizeof(WSAPROTOCOL_INFOA);
> +    memset(buffer, 0, size);
> +    info.w->iAddressFamily = WS_AF_UNSPEC;
> +
> +    SERVER_START_REQ( get_socket_info )
> +    {
> +        req->handle  = wine_server_obj_handle( SOCKET2HANDLE(s) );
> +        wine_server_call( req );
> +        info.w->iAddressFamily = convert_af_u2w(reply->family);
> +        info.w->iSocketType = convert_socktype_u2w(reply->type);
> +        info.w->iProtocol = convert_proto_u2w(reply->protocol);
> +    }
> +    SERVER_END_REQ;

You need to check the server return status and set the correct error
code.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list