ChangeSet ID: 21421 CVSROOT: /opt/cvs-commit Module name: wine Changes by: julliard@winehq.org 2005/11/23 13:25:16
Modified files: dlls/winsock : socket.c include : ws2tcpip.h tools/winapi : win32.api
Log message: Francois Gouget fgouget@free.fr Add LPADDRINFO, missing IP_* defines and missing APIs. Enclose the API definitions in an extern "C" section. Define function pointer types if INCL_WINSOCK_API_TYPEDEFS is defined. Better stick to the types defined by the PSDK. Update win32.api.
Patch: http://cvs.winehq.org/patch.py?id=21421
Old revision New revision Changes Path 1.197 1.198 +2 -2 wine/dlls/winsock/socket.c 1.7 1.8 +77 -23 wine/include/ws2tcpip.h 1.56 1.57 +7 -0 wine/tools/winapi/win32.api
Index: wine/dlls/winsock/socket.c diff -u -p wine/dlls/winsock/socket.c:1.197 wine/dlls/winsock/socket.c:1.198 --- wine/dlls/winsock/socket.c:1.197 23 Nov 2005 19:25:16 -0000 +++ wine/dlls/winsock/socket.c 23 Nov 2005 19:25:16 -0000 @@ -3123,7 +3123,7 @@ static int convert_eai_u2w(int unixret) /*********************************************************************** * getaddrinfo (WS2_32.@) */ -int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const ADDRINFOA *hints, ADDRINFOA **res) +int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addrinfo *hints, struct WS_addrinfo **res) { #if HAVE_GETADDRINFO struct addrinfo *unixaires = NULL; @@ -3223,7 +3223,7 @@ outofmem: /*********************************************************************** * GetAddrInfoW (WS2_32.@) */ -int WINAPI GetAddrInfoW(LPCWSTR nodename, LPCWSTR servname, const ADDRINFOW *hints, ADDRINFOW **res) +int WINAPI GetAddrInfoW(LPCWSTR nodename, LPCWSTR servname, const ADDRINFOW *hints, PADDRINFOW *res) { FIXME("empty stub!\n"); return EAI_FAIL; Index: wine/include/ws2tcpip.h diff -u -p wine/include/ws2tcpip.h:1.7 wine/include/ws2tcpip.h:1.8 --- wine/include/ws2tcpip.h:1.7 23 Nov 2005 19:25:16 -0000 +++ wine/include/ws2tcpip.h 23 Nov 2005 19:25:16 -0000 @@ -53,7 +53,7 @@ typedef struct WS(addrinfoW) struct WS(addrinfoW)* ai_next; } ADDRINFOW, *PADDRINFOW;
-typedef ADDRINFOA ADDRINFO; +typedef ADDRINFOA ADDRINFO, *LPADDRINFO;
/* * Multicast group information @@ -136,27 +136,39 @@ typedef struct _INTERFACE_INFO #endif /* USE_WS_PREFIX */
#ifndef USE_WS_PREFIX -#define IP_OPTIONS 1 -#define IP_HDRINCL 2 -#define IP_TOS 3 -#define IP_TTL 4 -#define IP_MULTICAST_IF 9 -#define IP_MULTICAST_TTL 10 -#define IP_MULTICAST_LOOP 11 -#define IP_ADD_MEMBERSHIP 12 -#define IP_DROP_MEMBERSHIP 13 -#define IP_DONTFRAGMENT 14 +#define IP_OPTIONS 1 +#define IP_HDRINCL 2 +#define IP_TOS 3 +#define IP_TTL 4 +#define IP_MULTICAST_IF 9 +#define IP_MULTICAST_TTL 10 +#define IP_MULTICAST_LOOP 11 +#define IP_ADD_MEMBERSHIP 12 +#define IP_DROP_MEMBERSHIP 13 +#define IP_DONTFRAGMENT 14 +#define IP_ADD_SOURCE_MEMBERSHIP 15 +#define IP_DROP_SOURCE_MEMBERSHIP 16 +#define IP_BLOCK_SOURCE 17 +#define IP_UNBLOCK_SOURCE 18 +#define IP_PKTINFO 19 +#define IP_RECEIVE_BROADCAST 22 #else -#define WS_IP_OPTIONS 1 -#define WS_IP_HDRINCL 2 -#define WS_IP_TOS 3 -#define WS_IP_TTL 4 -#define WS_IP_MULTICAST_IF 9 -#define WS_IP_MULTICAST_TTL 10 -#define WS_IP_MULTICAST_LOOP 11 -#define WS_IP_ADD_MEMBERSHIP 12 -#define WS_IP_DROP_MEMBERSHIP 13 -#define WS_IP_DONTFRAGMENT 14 +#define WS_IP_OPTIONS 1 +#define WS_IP_HDRINCL 2 +#define WS_IP_TOS 3 +#define WS_IP_TTL 4 +#define WS_IP_MULTICAST_IF 9 +#define WS_IP_MULTICAST_TTL 10 +#define WS_IP_MULTICAST_LOOP 11 +#define WS_IP_ADD_MEMBERSHIP 12 +#define WS_IP_DROP_MEMBERSHIP 13 +#define WS_IP_DONTFRAGMENT 14 +#define WS_IP_ADD_SOURCE_MEMBERSHIP 15 +#define WS_IP_DROP_SOURCE_MEMBERSHIP 16 +#define WS_IP_BLOCK_SOURCE 17 +#define WS_IP_UNBLOCK_SOURCE 18 +#define WS_IP_PKTINFO 19 +#define WS_IP_RECEIVE_BROADCAST 22 #endif /* USE_WS_PREFIX */
/* Possible Windows flags for getaddrinfo() */ @@ -190,7 +202,49 @@ typedef struct _INTERFACE_INFO # define WS_EAI_SOCKTYPE WSAESOCKTNOSUPPORT #endif
-int WINAPI WS(getaddrinfo)(LPCSTR,LPCSTR,const ADDRINFOA *,ADDRINFOA **); -int WINAPI GetAddrInfoW(LPCWSTR,LPCWSTR,const ADDRINFOW *,ADDRINFOW **); + +#ifdef __cplusplus +extern "C" { +#endif + +void WINAPI WS(freeaddrinfo)(LPADDRINFO); +#define FreeAddrInfoA WS(freeaddrinfo) +void WINAPI FreeAddrInfoW(PADDRINFOW); +#define FreeAddrInfo WINELIB_NAME_AW(FreeAddrInfo) +int WINAPI WS(getaddrinfo)(const char*,const char*,const struct WS(addrinfo)*,struct WS(addrinfo)**); +#define GetAddrInfoA WS(getaddrinfo) +int WINAPI GetAddrInfoW(PCWSTR,PCWSTR,const ADDRINFOW*,PADDRINFOW*); +#define GetAddrInfo WINELIB_NAME_AW(GetAddrInfo) +int WINAPI WS(getnameinfo)(const struct sockaddr*,socklen_t,char*,DWORD,char*,DWORD,int); +#define GetNameInfoA WS(getnameinfo) +INT WINAPI GetNameInfoW(const SOCKADDR*,socklen_t,PWCHAR,DWORD,PWCHAR,DWORD,INT); +#define GetNameInfo WINELIB_NAME_AW(GetNameInfo) + +/* + * Ws2tcpip Function Typedefs + * + * Remember to keep this section in sync with the + * prototypes above. + */ +#if INCL_WINSOCK_API_TYPEDEFS + +typedef void (WINAPI *LPFN_FREEADDRINFO)(LPADDRINFO); +#define LPFN_FREEADDRINFOA LPFN_FREEADDRINFO +typedef void (WINAPI *LPFN_FREEADDRINFOW)(PADDRINFOW); +#define LPFN_FREEADDRINFOT WINELIB_NAME_AW(LPFN_FREEADDRINFO) +typedef int (WINAPI *LPFN_GETADDRINFO)(const char*,const char*,const struct WS(addrinfo)*,struct WS(addrinfo)**); +#define LPFN_GETADDRINFOA LPFN_GETADDRINFO +typedef int (WINAPI *LPFN_GETADDRINFOW)(PCWSTR,PCWSTR,const ADDRINFOW*,PADDRINFOW*); +#define LPFN_GETADDRINFOT WINELIB_NAME_AW(LPFN_GETADDRINFO) +typedef int (WINAPI *LPFN_GETNAMEINFO)(const struct sockaddr*,socklen_t,char*,DWORD,char*,DWORD,int); +#define LPFN_GETNAMEINFOA LPFN_GETNAMEINFO +typedef int (WINAPI *LPFN_GETNAMEINFOW)(const SOCKADDR*,socklen_t,PWCHAR,DWORD,PWCHAR,DWORD,INT); +#define LPFN_GETNAMEINFOT WINELIB_NAME_AW(LPFN_GETNAMEINFO) + +#endif + +#ifdef __cplusplus +} +#endif
#endif /* __WS2TCPIP__ */ Index: wine/tools/winapi/win32.api diff -u -p wine/tools/winapi/win32.api:1.56 wine/tools/winapi/win32.api:1.57 --- wine/tools/winapi/win32.api:1.56 23 Nov 2005 19:25:16 -0000 +++ wine/tools/winapi/win32.api 23 Nov 2005 19:25:16 -0000 @@ -2431,13 +2431,16 @@ SOCKET %ptr
LPDWORD +LPINT LPOVERLAPPED LPTRANSMIT_FILE_BUFFERS PVOID +struct sockaddr **
%void
void +VOID
%%msxml3.dll
@@ -5185,6 +5188,7 @@ u_short
%ptr
+ADDRINFOW * FARPROC INT * LPCONDITIONPROC @@ -5209,8 +5213,11 @@ LPWSASERVICECLASSINFOA LPWSASERVICECLASSINFOW LPWSAQUERYSETA LPWSAQUERYSETW +PADDRINFOW * WS_fd_set * int * +struct WS_addrinfo * +struct WS_addrinfo ** struct WS_hostent * struct WS_protoent * struct WS_servent *