Make winsock.h and winsock2.h independent from the Unix headers.
Make them compatible with both the Unix C headers and the MSVCRT
headers.
Ensure compatibility with the Unix headers via the USE_WS_PREFIX
macro.
Add WINE_NOWINSOCK: prevents winsock.h from being included from
windows.h when defined.
Add ws2tcpip.h, move definitions to the right header.
diff --git a/include/winsock2.h b/include/winsock2.h
index cb97ea0..e060bf4 100644
--- a/include/winsock2.h
+++ b/include/winsock2.h
@@ -3,166 +3,143 @@
*
* FIXME: Still missing required Winsock 2 definitions.
*/
-
-#ifndef __WINSOCK2API__
-#define __WINSOCK2API__
+#ifndef _WINSOCK2API_
+#define _WINSOCK2API_
+
+/*
+ * Setup phase
+ */
+
+/* Everything common between winsock.h and winsock2.h */
+#ifndef INCL_WINSOCK_API_PROTOTYPES
+#define INCL_WINSOCK_API_PROTOTYPES 1
+#define WS_API_PROTOTYPES 1
+#else
+#define WS_API_PROTOTYPES INCL_WINSOCK_API_PROTOTYPES
+#endif
+
+#ifndef INCL_WINSOCK_API_TYPEDEFS
+#define INCL_WINSOCK_API_TYPEDEFS 0
+#define WS_API_TYPEDEFS 0
+#else
+#define WS_API_TYPEDEFS INCL_WINSOCK_API_TYPEDEFS
+#endif
+
+#define __WINE_WINSOCK2__
#include "winsock.h"
+#undef __WINE_WINSOCK2__
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* defined(__cplusplus) */
/* proper 4-byte packing */
#include "pshpack4.h"
-#define WS_SO_GROUP_ID 0x2001
-#define WS_SO_GROUP_PRIORITY 0x2002
-#define WS_SO_MAX_MSG_SIZE 0x2003
-#define WS_SO_PROTOCOL_INFOA 0x2004
-#define WS_SO_PROTOCOL_INFOW 0x2005
-#define WS_SO_PROTOCOL_INFO WINELIB_NAME_AW(WS_SO_PROTOCOL_INFO)
-#define PVD_CONFIG 0x3001
-#define SO_CONDITIONAL_ACCEPT 0x3002
+#ifndef USE_WS_PREFIX
+#define SO_GROUP_ID 0x2001
+#define SO_GROUP_PRIORITY 0x2002
+#define SO_MAX_MSG_SIZE 0x2003
+#define SO_PROTOCOL_INFOA 0x2004
+#define SO_PROTOCOL_INFOW 0x2005
+#define SO_PROTOCOL_INFO WINELIB_NAME_AW(WS_SO_PROTOCOL_INFO)
+#define PVD_CONFIG 0x3001
+#define SO_CONDITIONAL_ACCEPT 0x3002
+#else
+#define WS_SO_GROUP_ID 0x2001
+#define WS_SO_GROUP_PRIORITY 0x2002
+#define WS_SO_MAX_MSG_SIZE 0x2003
+#define WS_SO_PROTOCOL_INFOA 0x2004
+#define WS_SO_PROTOCOL_INFOW 0x2005
+#define WS_SO_PROTOCOL_INFO WINELIB_NAME_AW(WS_SO_PROTOCOL_INFO)
+#define WS_PVD_CONFIG 0x3001
+#define WS_SO_CONDITIONAL_ACCEPT 0x3002
+#endif
/* option flags per socket */
-#define FD_MAX_EVENTS 10
-#define FD_READ_BIT 0
-#define FD_WRITE_BIT 1
-#define FD_OOB_BIT 2
-#define FD_ACCEPT_BIT 3
-#define FD_CONNECT_BIT 4
-#define FD_CLOSE_BIT 5
+#define FD_MAX_EVENTS 10
+#define FD_READ_BIT 0
+#define FD_WRITE_BIT 1
+#define FD_OOB_BIT 2
+#define FD_ACCEPT_BIT 3
+#define FD_CONNECT_BIT 4
+#define FD_CLOSE_BIT 5
-/*
- * Constants for WSAIoctl()
- */
-#define IOC_UNIX 0x00000000
-#define IOC_WS2 0x08000000
-#define IOC_PROTOCOL 0x10000000
-#define IOC_VENDOR 0x18000000
-#define _WSAIO(x,y) (IOC_VOID|(x)|(y))
-#define _WSAIOR(x,y) (IOC_OUT|(x)|(y))
-#define _WSAIOW(x,y) (IOC_IN|(x)|(y))
-#define _WSAIORW(x,y) (IOC_INOUT|(x)|(y))
-#define SIO_ASSOCIATE_HANDLE _WSAIOW(IOC_WS2,1)
-#define SIO_ENABLE_CIRCULAR_QUEUEING _WSAIO(IOC_WS2,2)
-#define SIO_FIND_ROUTE _WSAIOR(IOC_WS2,3)
-#define SIO_FLUSH _WSAIO(IOC_WS2,4)
-#define SIO_GET_BROADCAST_ADDRESS _WSAIOR(IOC_WS2,5)
+/* Constants for LPCONDITIONPROC */
+#define CF_ACCEPT 0x0000
+#define CF_REJECT 0x0001
+#define CF_DEFER 0x0002
+
+/* Constants for shutdown() */
+#define SD_RECEIVE 0x00
+#define SD_SEND 0x01
+#define SD_BOTH 0x02
+
+/* Constants for WSAIoctl() */
+#define IOC_UNIX 0x00000000
+#define IOC_WS2 0x08000000
+#define IOC_PROTOCOL 0x10000000
+#define IOC_VENDOR 0x18000000
+#define _WSAIO(x,y) (IOC_VOID|(x)|(y))
+#define _WSAIOR(x,y) (IOC_OUT|(x)|(y))
+#define _WSAIOW(x,y) (IOC_IN|(x)|(y))
+#define _WSAIORW(x,y) (IOC_INOUT|(x)|(y))
+#define SIO_ASSOCIATE_HANDLE _WSAIOW(IOC_WS2,1)
+#define SIO_ENABLE_CIRCULAR_QUEUEING _WSAIO(IOC_WS2,2)
+#define SIO_FIND_ROUTE _WSAIOR(IOC_WS2,3)
+#define SIO_FLUSH _WSAIO(IOC_WS2,4)
+#define SIO_GET_BROADCAST_ADDRESS _WSAIOR(IOC_WS2,5)
#define SIO_GET_EXTENSION_FUNCTION_POINTER _WSAIORW(IOC_WS2,6)
-#define SIO_GET_QOS _WSAIORW(IOC_WS2,7)
-#define SIO_GET_GROUP_QOS _WSAIORW(IOC_WS2,8)
-#define SIO_MULTIPOINT_LOOPBACK _WSAIOW(IOC_WS2,9)
-#define SIO_MULTICAST_SCOPE _WSAIOW(IOC_WS2,10)
-#define SIO_SET_QOS _WSAIOW(IOC_WS2,11)
-#define SIO_SET_GROUP_QOS _WSAIOW(IOC_WS2,12)
-#define SIO_TRANSLATE_HANDLE _WSAIORW(IOC_WS2,13)
-#define SIO_ROUTING_INTERFACE_QUERY _WSAIORW(IOC_WS2,20)
-#define SIO_ROUTING_INTERFACE_CHANGE _WSAIOW(IOC_WS2,21)
-#define SIO_ADDRESS_LIST_QUERY _WSAIOR(IOC_WS2,22)
-#define SIO_ADDRESS_LIST_CHANGE _WSAIO(IOC_WS2,23)
-#define SIO_QUERY_TARGET_PNP_HANDLE _WSAIOR(IOC_W32,24)
-#define SIO_GET_INTERFACE_LIST WS_IOR ('t', 127, u_long)
-
-/* Unfortunately the sockaddr_in6 structure doesn't
- seem to be defined in a standard place, even across
- different Linux distributions. Until IPv6 support settles
- down, let's do our own here so the sockaddr_gen
- union is the correct size.*/
-#ifdef s6_addr
-#undef s6_addr
+#define SIO_GET_QOS _WSAIORW(IOC_WS2,7)
+#define SIO_GET_GROUP_QOS _WSAIORW(IOC_WS2,8)
+#define SIO_MULTIPOINT_LOOPBACK _WSAIOW(IOC_WS2,9)
+#define SIO_MULTICAST_SCOPE _WSAIOW(IOC_WS2,10)
+#define SIO_SET_QOS _WSAIOW(IOC_WS2,11)
+#define SIO_SET_GROUP_QOS _WSAIOW(IOC_WS2,12)
+#define SIO_TRANSLATE_HANDLE _WSAIORW(IOC_WS2,13)
+#define SIO_ROUTING_INTERFACE_QUERY _WSAIORW(IOC_WS2,20)
+#define SIO_ROUTING_INTERFACE_CHANGE _WSAIOW(IOC_WS2,21)
+#define SIO_ADDRESS_LIST_QUERY _WSAIOR(IOC_WS2,22)
+#define SIO_ADDRESS_LIST_CHANGE _WSAIO(IOC_WS2,23)
+#define SIO_QUERY_TARGET_PNP_HANDLE _WSAIOR(IOC_W32,24)
+#ifndef USE_WS_PREFIX
+#define SIO_GET_INTERFACE_LIST _IOR ('t', 127, u_long)
+#else
+#define SIO_GET_INTERFACE_LIST WS__IOR ('t', 127, u_long)
#endif
-struct ws_in_addr6
-{
- unsigned char s6_addr[16]; /* IPv6 address */
-};
-struct ws_sockaddr_in6
-{
- short sin6_family; /* AF_INET6 */
- u_short sin6_port; /* Transport level port number */
- u_long sin6_flowinfo; /* IPv6 flow information */
- struct ws_in_addr6 sin6_addr; /* IPv6 address */
-};
+/* Constants for WSAIoctl() */
+#define WSA_FLAG_OVERLAPPED 0x01
+#define WSA_FLAG_MULTIPOINT_C_ROOT 0x02
+#define WSA_FLAG_MULTIPOINT_C_LEAF 0x04
+#define WSA_FLAG_MULTIPOINT_D_ROOT 0x08
+#define WSA_FLAG_MULTIPOINT_D_LEAF 0x10
-typedef union sockaddr_gen
-{
- struct sockaddr Address;
- struct ws_sockaddr_in AddressIn;
- struct ws_sockaddr_in6 AddressIn6;
-} sockaddr_gen;
-
-/* ws_hostent, ws_protoent, ws_servent, ws_netent are 4-byte aligned here ! */
-
-typedef struct ws_hostent32
-{
- char *h_name; /* official name of host */
- char **h_aliases; /* alias list */
- short h_addrtype; /* host address type */
- short h_length; /* length of address */
- char **h_addr_list; /* list of addresses from name server */
-} _ws_hostent32;
-
-typedef struct ws_protoent32
-{
- char *p_name; /* official protocol name */
- char **p_aliases; /* alias list */
- short p_proto; /* protocol # */
-} _ws_protoent32;
-
-typedef struct ws_servent32
-{
- char *s_name; /* official service name */
- char **s_aliases; /* alias list */
- short s_port; /* port # */
- char *s_proto; /* protocol to use */
-} _ws_servent32;
-
-typedef struct ws_netent32
-{
- char *n_name; /* official name of net */
- char **n_aliases; /* alias list */
- short n_addrtype; /* net address type */
- u_long n_net; /* network # */
-} _ws_netent32;
-
-/* Structure to keep interface specific information */
-typedef struct _INTERFACE_INFO
-{
- u_long iiFlags; /* Interface flags */
- sockaddr_gen iiAddress; /* Interface address */
- sockaddr_gen iiBroadcastAddress; /* Broadcast address */
- sockaddr_gen iiNetmask; /* Network mask */
-} INTERFACE_INFO, * LPINTERFACE_INFO;
-
-/* Possible flags for the iiFlags - bitmask */
-#ifndef HAVE_NET_IF_H
-# define IFF_UP 0x00000001 /* Interface is up */
-# define IFF_BROADCAST 0x00000002 /* Broadcast is supported */
-# define IFF_LOOPBACK 0x00000004 /* this is loopback interface */
-# define IFF_POINTTOPOINT 0x00000008 /* this is point-to-point interface */
-# define IFF_MULTICAST 0x00000010 /* multicast is supported */
-#endif
#ifndef GUID_DEFINED
#include "guiddef.h"
#endif
-#define MAX_PROTOCOL_CHAIN 7
-#define BASE_PROTOCOL 1
-#define LAYERED_PROTOCOL 0
+#define MAX_PROTOCOL_CHAIN 7
+#define BASE_PROTOCOL 1
+#define LAYERED_PROTOCOL 0
-typedef struct _WSAPROTOCOLCHAIN
+typedef struct _WSAPROTOCOLCHAIN
{
- int ChainLen; /* the length of the chain, */
- /* length = 0 means layered protocol, */
- /* length = 1 means base protocol, */
- /* length > 1 means protocol chain */
- DWORD ChainEntries[MAX_PROTOCOL_CHAIN]; /* a list of dwCatalogEntryIds */
+ int ChainLen; /* the length of the chain, */
+ /* length = 0 means layered protocol, */
+ /* length = 1 means base protocol, */
+ /* length > 1 means protocol chain */
+ DWORD ChainEntries[MAX_PROTOCOL_CHAIN]; /* a list of dwCatalogEntryIds */
} WSAPROTOCOLCHAIN, * LPWSAPROTOCOLCHAIN;
-#define WSAPROTOCOL_LEN 255
-typedef struct _WSAPROTOCOL_INFOA
+#define WSAPROTOCOL_LEN 255
+typedef struct _WSAPROTOCOL_INFOA
{
DWORD dwServiceFlags1;
DWORD dwServiceFlags2;
@@ -183,7 +160,7 @@
int iSecurityScheme;
DWORD dwMessageSize;
DWORD dwProviderReserved;
- CHAR szProtocol[WSAPROTOCOL_LEN+1];
+ CHAR szProtocol[WSAPROTOCOL_LEN+1];
} WSAPROTOCOL_INFOA, * LPWSAPROTOCOL_INFOA;
typedef struct _WSAPROTOCOL_INFOW
@@ -207,51 +184,270 @@
int iSecurityScheme;
DWORD dwMessageSize;
DWORD dwProviderReserved;
- WCHAR szProtocol[WSAPROTOCOL_LEN+1];
-} WSAPROTOCOL_INFOW, * LPWSAPROTOCOL_INFOW;
+ WCHAR szProtocol[WSAPROTOCOL_LEN+1];
+} WSAPROTOCOL_INFOW, *LPWSAPROTOCOL_INFOW;
DECL_WINELIB_TYPE_AW(WSAPROTOCOL_INFO)
DECL_WINELIB_TYPE_AW(LPWSAPROTOCOL_INFO)
-typedef struct _WSANETWORKEVENTS
+typedef struct _WSANETWORKEVENTS
{
- long lNetworkEvents;
- int iErrorCode[FD_MAX_EVENTS];
+ long lNetworkEvents;
+ int iErrorCode[FD_MAX_EVENTS];
} WSANETWORKEVENTS, *LPWSANETWORKEVENTS;
-typedef struct _WSABUF
+typedef struct _WSABUF
{
ULONG len;
CHAR* buf;
} WSABUF, *LPWSABUF;
-typedef struct _OVERLAPPED * LPWSAOVERLAPPED;
-typedef HANDLE WSAEVENT;
+#define WSAEVENT HANDLE
+#define LPWSAEVENT LPHANDLE
+#define WSAOVERLAPPED OVERLAPPED
+typedef struct _OVERLAPPED* LPWSAOVERLAPPED;
+
+#define WSA_IO_PENDING (ERROR_IO_PENDING)
+#define WSA_IO_INCOMPLETE (ERROR_IO_INCOMPLETE)
+#define WSA_INVALID_HANDLE (ERROR_INVALID_HANDLE)
+#define WSA_INVALID_PARAMETER (ERROR_INVALID_PARAMETER)
+#define WSA_NOT_ENOUGH_MEMORY (ERROR_NOT_ENOUGH_MEMORY)
+#define WSA_OPERATION_ABORTED (ERROR_OPERATION_ABORTED)
+
+#define WSA_INVALID_EVENT ((WSAEVENT)NULL)
+#define WSA_MAXIMUM_WAIT_EVENTS (MAXIMUM_WAIT_OBJECTS)
+#define WSA_WAIT_FAILED ((DWORD)-1L)
+#define WSA_WAIT_EVENT_0 (WAIT_OBJECT_0)
+#define WSA_WAIT_IO_COMPLETION (WAIT_IO_COMPLETION)
+#define WSA_WAIT_TIMEOUT (WAIT_TIMEOUT)
+#define WSA_INFINITE (INFINITE)
+
typedef unsigned int GROUP;
+#define SG_UNCONSTRAINED_GROUP 0x01
+#define SG_CONSTRAINED_GROUP 0x02
+
+/* FIXME: We don't yet have qos.h */
+typedef DWORD QOS, *LPQOS;
+
+typedef int CALLBACK (*LPCONDITIONPROC)
+(
+ LPWSABUF lpCallerId,
+ LPWSABUF lpCallerData,
+ LPQOS lpSQOS,
+ LPQOS lpGQOS,
+ LPWSABUF lpCalleeId,
+ LPWSABUF lpCalleeData,
+ GROUP *g,
+ DWORD dwCallbackData
+);
typedef void CALLBACK (*LPWSAOVERLAPPED_COMPLETION_ROUTINE)
(
- DWORD dwError,
- DWORD cbTransferred,
- LPWSAOVERLAPPED lpOverlapped,
- DWORD dwFlags
+ DWORD dwError,
+ DWORD cbTransferred,
+ LPWSAOVERLAPPED lpOverlapped,
+ DWORD dwFlags
);
-/* Function declarations */
-int WINAPI WSAEnumNetworkEvents(SOCKET s, WSAEVENT hEventObject, LPWSANETWORKEVENTS lpNetworkEvents);
-int WINAPI WSAEventSelect(SOCKET s, WSAEVENT hEventObject, long lNetworkEvents);
+
+/*
+ * Winsock Function Typedefs
+ *
+ * Remember to keep this section in sync with the
+ * "Prototypes" section in winsock.h.
+ */
+#if WS_API_TYPEDEFS
+typedef HANDLE (WINAPI *LPFN_WSAASYNCGETHOSTBYADDR)(HWND,u_int,const char*,int,int,char*,int));
+typedef HANDLE (WINAPI *LPFN_WSAASYNCGETHOSTBYNAME)(HWND,u_int,const char*,char*,int));
+typedef HANDLE (WINAPI *LPFN_WSAASYNCGETPROTOBYNAME)(HWND,u_int,const char*,char*,int));
+typedef HANDLE (WINAPI *LPFN_WSAASYNCGETPROTOBYNUMBER)(HWND,u_int,int,char*,int));
+typedef HANDLE (WINAPI *LPFN_WSAASYNCGETSERVBYNAME)(HWND,u_int,const char*,const char*,char*,int));
+typedef HANDLE (WINAPI *LPFN_WSAASYNCGETSERVBYPORT)(HWND,u_int,int,const char*,char*,int));
+typedef int (WINAPI *LPFN_WSAASYNCSELECT)(SOCKET,HWND,u_int,long));
+typedef int (WINAPI *LPFN_WSACANCELASYNCREQUEST)(HANDLE));
+typedef int (WINAPI *LPFN_WSACANCELBLOCKINGCALL)(void));
+typedef int (WINAPI *LPFN_WSACLEANUP)(void));
+typedef int (WINAPI *LPFN_WSAGETLASTERROR)(void));
+typedef BOOL (WINAPI *LPFN_WSAISBLOCKING)(void));
+typedef FARPROC (WINAPI *LPFN_WSASETBLOCKINGHOOK)(FARPROC));
+typedef void (WINAPI *LPFN_WSASETLASTERROR)(int));
+typedef int (WINAPI *LPFN_WSASTARTUP)(WORD,LPWSADATA));
+typedef int (WINAPI *LPFN_WSAUNHOOKBLOCKINGHOOK)(void));
+
+typedef SOCKET (WINAPI *LPFN_ACCEPT)(SOCKET,struct WS(sockaddr)*,int*));
+typedef int (WINAPI *LPFN_BIND)(SOCKET,const struct WS(sockaddr)*,int));
+typedef int (WINAPI *LPFN_CLOSESOCKET)(SOCKET));
+typedef int (WINAPI *LPFN_CONNECT)(SOCKET,const struct WS(sockaddr)*,int));
+typedef struct WS(hostent)* (WINAPI *LPFN_GETHOSTBYADDR)(const char*,int,int));
+typedef struct WS(hostent)* (WINAPI *LPFN_GETHOSTBYNAME)(const char*));
+typedef int (WINAPI *LPFN_GETHOSTNAME)(char*,int));
+typedef int (WINAPI *LPFN_GETPEERNAME)(SOCKET,struct WS(sockaddr)*,int*));
+typedef struct WS(protoent)* (WINAPI *LPFN_GETPROTOBYNAME)(const char*));
+typedef struct WS(protoent)* (WINAPI *LPFN_GETPROTOBYNUMBER)(int));
+#ifdef WS_DEFINE_SELECT
+typedef int (WINAPI* LPFN_SELECT)(int,WS(fd_set)*,WS(fd_set)*,WS(fd_set)*,const struct WS(timeval)*);
+#endif
+typedef struct WS(servent)* (WINAPI *LPFN_GETSERVBYNAME)(const char*,const char*));
+typedef struct WS(servent)* (WINAPI *LPFN_GETSERVBYPORT)(int,const char*));
+typedef int (WINAPI *LPFN_GETSOCKNAME)(SOCKET,struct WS(sockaddr)*,int*));
+typedef int (WINAPI *LPFN_GETSOCKOPT)(SOCKET,int,int,char*,int*));
+typedef u_long (WINAPI *LPFN_HTONL)(u_long));
+typedef u_short (WINAPI *LPFN_HTONS)(u_short));
+typedef unsigned long (WINAPI *LPFN_INET_ADDR)(const char*);
+typedef char* (WINAPI *LPFN_INET_NTOA)(struct WS(in_addr));
+typedef int (WINAPI *LPFN_IOCTLSOCKET)(SOCKET,long,u_long*));
+typedef int (WINAPI *LPFN_LISTEN)(SOCKET,int));
+typedef u_long (WINAPI *LPFN_NTOHL)(u_long));
+typedef u_short (WINAPI *LPFN_NTOHS)(u_short));
+typedef int (WINAPI *LPFN_RECV)(SOCKET,char*,int,int));
+typedef int (WINAPI *LPFN_RECVFROM)(SOCKET,char*,int,int,struct WS(sockaddr)*,int*));
+typedef int (WINAPI *LPFN_SEND)(SOCKET,const char*,int,int));
+typedef int (WINAPI *LPFN_SENDTO)(SOCKET,const char*,int,int,const struct WS(sockaddr)*,int));
+typedef int (WINAPI *LPFN_SETSOCKOPT)(SOCKET,int,int,const char*,int));
+typedef int (WINAPI *LPFN_SHUTDOWN)(SOCKET,int));
+typedef SOCKET (WINAPI *LPFN_SOCKET)(int,int,int));
+#endif /* WS_API_TYPEDEFS */
+
+
+
+/*
+ * Winsock2 Prototypes
+ *
+ * Remember to keep this section in sync with the
+ * "Winsock2 Function Typedefs" section below.
+ */
+#if WS_API_PROTOTYPES
+SOCKET WINAPI WSAAccept(SOCKET,struct WS(sockaddr)*,LPINT,LPCONDITIONPROC,DWORD);
+INT WINAPI WSAAddressToStringA(LPSOCKADDR,DWORD,LPWSAPROTOCOL_INFOA,LPSTR,LPDWORD);
+INT WINAPI WSAAddressToStringW(LPSOCKADDR,DWORD,LPWSAPROTOCOL_INFOW,LPWSTR,LPDWORD);
+#define WSAAddressToString WINELIB_NAME_AW(WSAAddressToString)
+BOOL WINAPI WSACloseEvent(WSAEVENT);
+int WINAPI WSAConnect(SOCKET,const struct WS(sockaddr)*,int,LPWSABUF,LPWSABUF,LPQOS,LPQOS);
WSAEVENT WINAPI WSACreateEvent(void);
-BOOL WINAPI WSACloseEvent(WSAEVENT event);
-INT WINAPI WSARecvFrom(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,struct sockaddr*,LPINT,
- LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
-INT WINAPI WSASend(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,LPWSAOVERLAPPED,
- LPWSAOVERLAPPED_COMPLETION_ROUTINE);
-SOCKET WINAPI WSASocketA(int af, int type, int protocol,
- LPWSAPROTOCOL_INFOA lpProtocolInfo,
- GROUP g, DWORD dwFlags);
-INT WINAPI ioctlsocket(SOCKET s, LONG cmd, ULONG *argp);
+/* WSADuplicateSocketA */
+/* WSADuplicateSocketW */
+/* WSAEnumNameSpaceProvidersA */
+/* WSAEnumNameSpaceProvidersW */
+int WINAPI WSAEnumNetworkEvents(SOCKET,WSAEVENT,LPWSANETWORKEVENTS);
+int WINAPI WSAEnumProtocolsA(LPINT,LPWSAPROTOCOL_INFOA,LPDWORD);
+int WINAPI WSAEnumProtocolsW(LPINT,LPWSAPROTOCOL_INFOW,LPDWORD);
+#define WSAEnumProtocols WINELIB_NAME_AW(WSAEnumProtocols)
+int WINAPI WSAEventSelect(SOCKET,WSAEVENT,long);
+BOOL WINAPI WSAGetOverlappedResult(SOCKET,LPWSAOVERLAPPED,LPDWORD,BOOL,LPDWORD);
+/* WSAGetQOSByName */
+/* WSAGetServiceClassInfoA */
+/* WSAGetServiceClassInfoW */
+/* WSAGetServiceClassNameByClassIdA */
+/* WSAGetServiceClassNameByClassIdW */
+int WINAPI WSAHtonl(SOCKET,u_long,u_long*);
+int WINAPI WSAHtons(SOCKET,u_short,u_short*);
+/* WSAInstallServiceClassA */
+/* WSAInstallServiceClassW */
+int WINAPI WSAIoctl(SOCKET,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
+/* WSAJoinLeaf */
+/* WSALookupServiceBeginA */
+/* WSALookupServiceBeginW */
+/* WSALookupServiceEnd */
+/* WSALookupServiceNextA */
+/* WSALookupServiceNextW */
+int WINAPI WSANtohl(SOCKET,u_long,u_long*);
+int WINAPI WSANtohs(SOCKET,u_short,u_short*);
+/* WSAProviderConfigChange */
+int WINAPI WSARecv(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
+int WINAPI WSARecvDisconnect(SOCKET,LPWSABUF);
+int WINAPI WSARecvFrom(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,struct WS(sockaddr)*,LPINT,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
+/* WSARemoveServiceClass */
+BOOL WINAPI WSAResetEvent(WSAEVENT);
+int WINAPI WSASend(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
+int WINAPI WSASendDisconnect(SOCKET,LPWSABUF);
+int WINAPI WSASendTo(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,const struct WS(sockaddr)*,int,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
+BOOL WINAPI WSASetEvent(WSAEVENT);
+/* WSASetServiceA */
+/* WSASetServiceW */
+SOCKET WINAPI WSASocketA(int,int,int,LPWSAPROTOCOL_INFOA,GROUP,DWORD);
+SOCKET WINAPI WSASocketW(int,int,int,LPWSAPROTOCOL_INFOW,GROUP,DWORD);
+INT WINAPI WSAStringToAddressA(LPSTR,INT,LPWSAPROTOCOL_INFOA,LPSOCKADDR,LPINT);
+INT WINAPI WSAStringToAddressW(LPSTR,INT,LPWSAPROTOCOL_INFOA,LPSOCKADDR,LPINT);
+#define WSASocket WINELIB_NAME_AW(WSASocket)
+#define WSAStringToAddress WINELIB_NAME_AW(WSAStringToAddress)
+DWORD WINAPI WSAWaitForMultipleEvents(DWORD,const WSAEVENT*,BOOL,DWORD,BOOL);
+#endif /* WS_API_PROTOTYPES */
+
+
+
+/*
+ * Winsock2 Function Typedefs
+ *
+ * Remember to keep this section in sync with the
+ * "Winsock2 Prototypes" section above.
+ */
+#if WS_API_TYPEDEFS
+typedef SOCKET (WINAPI *LPFN_WSAACCEPT)(SOCKET,WS(sockaddr)*,LPINT,LPCONDITIONPROC,DWORD);
+typedef INT (WINAPI *LPFN_WSAADRESSTOSTRINGA)(LPSOCKADDR,DWORD,LPWSAPROTOCOL_INFOA,LPSTR,LPDWORD);
+typedef INT (WINAPI *LPFN_WSAADRESSTOSTRINGW)(LPSOCKADDR,DWORD,LPWSAPROTOCOL_INFOW,LPWSTR,LPDWORD);
+#define LPFN_WSAADDRESSTOSTRING WINELIB_NAME_AW(LPFN_WSAADDRESSTOSTRING)
+typedef BOOL (WINAPI *LPFN_WSACLOSEEVENT)(WSAEVENT);
+typedef int (WINAPI *LPFN_WSACONNECT)(SOCKET,const struct WS(sockaddr)*,int,LPWSABUF,LPWSABUF,LPQOS,LPQOS);
+typedef WSAEVENT (WINAPI *LPFN_WSACREATEEVENT)(void);
+/* WSADuplicateSocketA */
+/* WSADuplicateSocketW */
+/* WSAEnumNameSpaceProvidersA */
+/* WSAEnumNameSpaceProvidersW */
+typedef int (WINAPI *LPFN_WSAENUMNETWORKEVENT)(SOCKET,WSAEVENT,LPWSANETWORKEVENTS);
+typedef int (WINAPI *LPFN_WSAENUMPROTOCOLSA)(LPINT,LPWSAPROTOCOL_INFOA,LPDWORD);
+typedef int (WINAPI *LPFN_WSAENUMPROTOCOLSW)(LPINT,LPWSAPROTOCOL_INFOW,LPDWORD);
+#define LPFN_WSAENUMPROTOCOLS WINELIB_NAME_AW(LPFN_WSAENUMPROTOCOLS)
+typedef int (WINAPI *LPFN_WSAEVENTSELECT)(SOCKET,WSAEVENT,long);
+typedef BOOL (WINAPI *LPFN_WSAGETOVERLAPPEDRESULT)(SOCKET,LPWSAOVERLAPPED,LPDWORD,BOOL,LPDWORD);
+/* WSAGetQOSByName */
+/* WSAGetServiceClassInfoA */
+/* WSAGetServiceClassInfoW */
+/* WSAGetServiceClassNameByClassIdA */
+/* WSAGetServiceClassNameByClassIdW */
+typedef int (WINAPI *LPFN_WSAHTONL)(SOCKET,u_long,u_long*);
+typedef int (WINAPI *LPFN_WSAHTONS)(SOCKET,u_short,u_short*);
+/* WSAInstallServiceClassA */
+/* WSAInstallServiceClassW */
+typedef int (WINAPI *LPFN_WSAIOCTL)(SOCKET,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
+/* WSAJoinLeaf */
+/* WSALookupServiceBeginA */
+/* WSALookupServiceBeginW */
+/* WSALookupServiceEnd */
+/* WSALookupServiceNextA */
+/* WSALookupServiceNextW */
+typedef int (WINAPI *LPFN_WSANTOHL)(SOCKET,u_long,u_long*);
+typedef int (WINAPI *LPFN_WSANTOHS)(SOCKET,u_short,u_short*);
+/* WSAProviderConfigChange */
+typedef int (WINAPI *LPFN_WSARECV)(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
+typedef int (WINAPI *LPFN_WSARECVDISCONNECT)(SOCKET,LPWSABUF);
+typedef int (WINAPI *LPFN_WSARECVFROM)(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,struct WS(sockaddr)*,LPINT,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
+/* WSARemoveServiceClass */
+typedef BOOL (WINAPI *LPFN_WSARESETEVENT)(WSAEVENT);
+typedef int (WINAPI *LPFN_WSASEND)(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
+typedef int (WINAPI *LPFN_WSASENDDISCONNECT)(SOCKET,LPWSABUF);
+typedef int (WINAPI *LPFN_WSASENDTO)(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,const struct WS(sockaddr)*,int,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
+typedef BOOL (WINAPI *LPFN_WSASETEVENT)(WSAEVENT);
+/* WSASetServiceA */
+/* WSASetServiceW */
+typedef SOCKET (WINAPI *LPFN_WSASOCKETA)(int,int,int,LPWSAPROTOCOL_INFOA,GROUP,DWORD);
+typedef SOCKET (WINAPI *LPFN_WSASOCKETW)(int,int,int,LPWSAPROTOCOL_INFOW,GROUP,DWORD);
+typedef INT (WINAPI *LPFN_WSASTRINGTOADDRESSA)(LPSTR,INT,LPWSAPROTOCOL_INFOA,LPSOCKADDR,LPINT);
+typedef INT (WINAPI *LPFN_WSASTRINGTOADDRESSW)(LPSTR,INT,LPWSAPROTOCOL_INFOA,LPSOCKADDR,LPINT);
+#define LPFN_WSASOCKET WINELIB_NAME_AW(LPFN_WSASOCKET)
+#define LPFN_WSASTRINGTOADDRESS WINELIB_NAME_AW(LPFN_WSASTRINGTOADDRESS)
+typedef DWORD (WINAPI *LPFN_WSAWAITFORMULTIPLEEVENTS)(DWORD,const WSAEVENT*,BOOL,DWORD,BOOL);
+#endif /* WS_API_TYPEDEFS */
+
#include "poppack.h"
+#ifdef __cplusplus
+}
#endif
+
+#undef WS
+#undef WS_API_PROTOTYPES
+#undef WS_API_TYPEDEFS
+
+#endif /* __WINSOCK2API__ */