From 5ddf98affead140b32c9f739d38f5a28a12ef2d9 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Wed, 4 Jan 2006 15:07:34 +0100 Subject: [PATCH] winsock: Map wildcards for socket type and protocol in getaddrinfo(). --- dlls/winsock/socket.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/winsock/socket.c b/dlls/winsock/socket.c index e47b18260f3..6df1c4d9ac8 100644 --- a/dlls/winsock/socket.c +++ b/dlls/winsock/socket.c @@ -3161,8 +3161,14 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr memset(&unixhints, 0, sizeof(unixhints)); punixhints->ai_flags = convert_aiflag_w2u(hints->ai_flags); punixhints->ai_family = convert_af_w2u(hints->ai_family); - punixhints->ai_socktype = convert_socktype_w2u(hints->ai_socktype); - punixhints->ai_protocol = convert_proto_w2u(hints->ai_protocol); + if (hints->ai_socktype == 0) /* wildcard, specific to getaddrinfo() */ + punixhints->ai_socktype = 0; + else + punixhints->ai_socktype = convert_socktype_w2u(hints->ai_socktype); + if (hints->ai_protocol == 0) /* wildcard, specific to getaddrinfo() */ + punixhints->ai_protocol = 0; + else + punixhints->ai_protocol = convert_proto_w2u(hints->ai_protocol); } /* getaddrinfo(3) is thread safe, no need to wrap in CS */