From 264503d40daa297eac2948b1a392ba4b86215d00 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Thu, 13 Jul 2006 13:06:30 +0100 Subject: [PATCH] include: Add NI_* defines and add a WS(socklen_t) type. --- dlls/ws2_32/socket.c | 2 +- include/ws2tcpip.h | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 8887ae8dd96..4c17f21e806 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -3238,7 +3238,7 @@ int WINAPI GetAddrInfoW(LPCWSTR nodename, LPCWSTR servname, const ADDRINFOW *hin return EAI_FAIL; } -int WINAPI WS_getnameinfo(const SOCKADDR *sa, socklen_t salen, PCHAR host, +int WINAPI WS_getnameinfo(const SOCKADDR *sa, WS_socklen_t salen, PCHAR host, DWORD hostlen, PCHAR serv, DWORD servlen, INT flags) { #if HAVE_GETNAMEINFO diff --git a/include/ws2tcpip.h b/include/ws2tcpip.h index dcdcd4e6d35..8d3c837510c 100644 --- a/include/ws2tcpip.h +++ b/include/ws2tcpip.h @@ -53,6 +53,8 @@ typedef struct WS(addrinfoW) struct WS(addrinfoW)* ai_next; } ADDRINFOW, *PADDRINFOW; +typedef int WS(socklen_t); + typedef ADDRINFOA ADDRINFO, *LPADDRINFO; /* @@ -202,6 +204,21 @@ typedef struct _INTERFACE_INFO # define WS_EAI_SOCKTYPE WSAESOCKTNOSUPPORT #endif +/* Possible Windows flags for getnameinfo() */ +#ifndef USE_WS_PREFIX +# define NI_NOFQDN 0x01 +# define NI_NUMERICHOST 0x02 +# define NI_NAMEREQD 0x04 +# define NI_NUMERICSERV 0x08 +# define NI_DGRAM 0x10 +#else +# define WS_NI_NOFQDN 0x01 +# define WS_NI_NUMERICHOST 0x02 +# define WS_NI_NAMEREQD 0x04 +# define WS_NI_NUMERICSERV 0x08 +# define WS_NI_DGRAM 0x10 +#endif + #ifdef __cplusplus extern "C" { @@ -215,9 +232,9 @@ int WINAPI WS(getaddrinfo)(const char*,const char*,const struct WS(addrinfo)*,s #define GetAddrInfoA WS(getaddrinfo) int WINAPI GetAddrInfoW(PCWSTR,PCWSTR,const ADDRINFOW*,PADDRINFOW*); #define GetAddrInfo WINELIB_NAME_AW(GetAddrInfo) -int WINAPI WS(getnameinfo)(const SOCKADDR*,socklen_t,PCHAR,DWORD,PCHAR,DWORD,INT); +int WINAPI WS(getnameinfo)(const SOCKADDR*,WS(socklen_t),PCHAR,DWORD,PCHAR,DWORD,INT); #define GetNameInfoA WS(getnameinfo) -INT WINAPI GetNameInfoW(const SOCKADDR*,socklen_t,PWCHAR,DWORD,PWCHAR,DWORD,INT); +INT WINAPI GetNameInfoW(const SOCKADDR*,WS(socklen_t),PWCHAR,DWORD,PWCHAR,DWORD,INT); #define GetNameInfo WINELIB_NAME_AW(GetNameInfo) /*