Tweak getnameinfo() prototype

Francois Gouget fgouget at free.fr
Fri Feb 24 08:58:09 CST 2006


The Windows PSDK declares getnameinfo() as taking a const SOCKADDR* 
instead of a 'const struct sockaddr*'. This is pretty practical as it 
avoids conflicts with the Unix types without having to use the WS_ 
prefix, and also makes it match its Unicode variant (GetNameInfoW()).

Changelog:

  * include/ws2tcpip.h
    dlls/winsock/socket.c
    tools/winapi/win32.api

    Francois Gouget <fgouget at free.fr>
    Tweak the getnameinfo() prototype to better match the Windows PSDK 
and the GetNameInfoW() prototype.
    Update win32.api.

-- 
Francois Gouget <fgouget at free.fr>              http://fgouget.free.fr/
In theory, theory and practice are the same, but in practice they're different.
-------------- next part --------------
Index: include/ws2tcpip.h
===================================================================
RCS file: /home/wine/wine/include/ws2tcpip.h,v
retrieving revision 1.10
diff -u -p -r1.10 ws2tcpip.h
--- include/ws2tcpip.h	20 Feb 2006 20:19:40 -0000	1.10
+++ include/ws2tcpip.h	24 Feb 2006 10:57:20 -0000
@@ -215,7 +215,7 @@ int WINAPI  WS(getaddrinfo)(const char*,
 #define     GetAddrInfoA WS(getaddrinfo)
 int WINAPI  GetAddrInfoW(PCWSTR,PCWSTR,const ADDRINFOW*,PADDRINFOW*);
 #define     GetAddrInfo WINELIB_NAME_AW(GetAddrInfo)
-int WINAPI  WS(getnameinfo)(const struct WS(sockaddr)*,socklen_t,char*,DWORD,char*,DWORD,int);
+int WINAPI  WS(getnameinfo)(const SOCKADDR*,socklen_t,PCHAR,DWORD,PCHAR,DWORD,INT);
 #define     GetNameInfoA WS(getnameinfo)
 INT WINAPI  GetNameInfoW(const SOCKADDR*,socklen_t,PWCHAR,DWORD,PWCHAR,DWORD,INT);
 #define     GetNameInfo WINELIB_NAME_AW(GetNameInfo)
Index: dlls/winsock/socket.c
===================================================================
RCS file: /home/wine/wine/dlls/winsock/socket.c,v
retrieving revision 1.209
diff -u -p -r1.209 socket.c
--- dlls/winsock/socket.c	20 Feb 2006 20:19:40 -0000	1.209
+++ dlls/winsock/socket.c	24 Feb 2006 10:57:16 -0000
@@ -3235,8 +3235,8 @@ int WINAPI GetAddrInfoW(LPCWSTR nodename
     return EAI_FAIL;
 }
 
-int WINAPI WS_getnameinfo(const struct WS_sockaddr *sa, socklen_t salen, char *host,
-                          DWORD hostlen, char *serv, DWORD servlen, int flags)
+int WINAPI WS_getnameinfo(const SOCKADDR *sa, socklen_t salen, PCHAR host,
+                          DWORD hostlen, PCHAR serv, DWORD servlen, INT flags)
 {
 #if HAVE_GETNAMEINFO
     int ret;
Index: tools/winapi/win32.api
===================================================================
RCS file: /home/wine/wine/tools/winapi/win32.api,v
retrieving revision 1.68
diff -u -p -r1.68 win32.api
--- tools/winapi/win32.api	7 Feb 2006 20:22:19 -0000	1.68
+++ tools/winapi/win32.api	24 Feb 2006 10:57:23 -0000
@@ -5336,6 +5365,7 @@ WSAESETSERVICEOP
 WSAEVENT
 int
 long
+socklen_t
 u_long
 u_short
 
@@ -5367,6 +5397,7 @@ LPWSAQUERYSETW
 LPWSASERVICECLASSINFOA
 LPWSASERVICECLASSINFOW
 PADDRINFOW *
+SOCKADDR *
 WS_fd_set *
 int *
 struct WS_addrinfo *
@@ -5383,6 +5414,7 @@ u_short *
 
 LPCSTR
 LPSTR
+PCHAR
 char *
 
 %unknown


More information about the wine-patches mailing list