2 * Winsock 2 definitions - used for ws2_32.dll
4 * Copyright (C) 1999 Ove Kaaven
5 * Copyright (C) 2001 Francois Gouget
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * FIXME: Still missing required Winsock 2 definitions.
31 /* Everything common between winsock.h and winsock2.h */
32 #ifndef INCL_WINSOCK_API_PROTOTYPES
33 #define INCL_WINSOCK_API_PROTOTYPES 1
34 #define WS_API_PROTOTYPES 1
36 #define WS_API_PROTOTYPES INCL_WINSOCK_API_PROTOTYPES
39 #ifndef INCL_WINSOCK_API_TYPEDEFS
40 #define INCL_WINSOCK_API_TYPEDEFS 0
41 #define WS_API_TYPEDEFS 0
43 #define WS_API_TYPEDEFS INCL_WINSOCK_API_TYPEDEFS
46 #define __WINE_WINSOCK2__
48 #undef __WINE_WINSOCK2__
53 #endif /* defined(__cplusplus) */
55 /* proper 4-byte packing */
60 #define SO_GROUP_ID 0x2001
61 #define SO_GROUP_PRIORITY 0x2002
62 #define SO_MAX_MSG_SIZE 0x2003
63 #define SO_PROTOCOL_INFOA 0x2004
64 #define SO_PROTOCOL_INFOW 0x2005
65 #define SO_PROTOCOL_INFO WINELIB_NAME_AW(WS_SO_PROTOCOL_INFO)
66 #define PVD_CONFIG 0x3001
67 #define SO_CONDITIONAL_ACCEPT 0x3002
69 #define WS_SO_GROUP_ID 0x2001
70 #define WS_SO_GROUP_PRIORITY 0x2002
71 #define WS_SO_MAX_MSG_SIZE 0x2003
72 #define WS_SO_PROTOCOL_INFOA 0x2004
73 #define WS_SO_PROTOCOL_INFOW 0x2005
74 #define WS_SO_PROTOCOL_INFO WINELIB_NAME_AW(WS_SO_PROTOCOL_INFO)
75 #define WS_PVD_CONFIG 0x3001
76 #define WS_SO_CONDITIONAL_ACCEPT 0x3002
80 /* option flags per socket */
82 #define FD_MAX_EVENTS 10
84 #define FD_WRITE_BIT 1
86 #define FD_ACCEPT_BIT 3
87 #define FD_CONNECT_BIT 4
88 #define FD_CLOSE_BIT 5
90 /* Constants for LPCONDITIONPROC */
91 #define CF_ACCEPT 0x0000
92 #define CF_REJECT 0x0001
93 #define CF_DEFER 0x0002
95 /* Constants for shutdown() */
96 #define SD_RECEIVE 0x00
100 /* Constants for WSAIoctl() */
101 #define IOC_UNIX 0x00000000
102 #define IOC_WS2 0x08000000
103 #define IOC_PROTOCOL 0x10000000
104 #define IOC_VENDOR 0x18000000
105 #define _WSAIO(x,y) (IOC_VOID|(x)|(y))
106 #define _WSAIOR(x,y) (IOC_OUT|(x)|(y))
107 #define _WSAIOW(x,y) (IOC_IN|(x)|(y))
108 #define _WSAIORW(x,y) (IOC_INOUT|(x)|(y))
109 #define SIO_ASSOCIATE_HANDLE _WSAIOW(IOC_WS2,1)
110 #define SIO_ENABLE_CIRCULAR_QUEUEING _WSAIO(IOC_WS2,2)
111 #define SIO_FIND_ROUTE _WSAIOR(IOC_WS2,3)
112 #define SIO_FLUSH _WSAIO(IOC_WS2,4)
113 #define SIO_GET_BROADCAST_ADDRESS _WSAIOR(IOC_WS2,5)
114 #define SIO_GET_EXTENSION_FUNCTION_POINTER _WSAIORW(IOC_WS2,6)
115 #define SIO_GET_QOS _WSAIORW(IOC_WS2,7)
116 #define SIO_GET_GROUP_QOS _WSAIORW(IOC_WS2,8)
117 #define SIO_MULTIPOINT_LOOPBACK _WSAIOW(IOC_WS2,9)
118 #define SIO_MULTICAST_SCOPE _WSAIOW(IOC_WS2,10)
119 #define SIO_SET_QOS _WSAIOW(IOC_WS2,11)
120 #define SIO_SET_GROUP_QOS _WSAIOW(IOC_WS2,12)
121 #define SIO_TRANSLATE_HANDLE _WSAIORW(IOC_WS2,13)
122 #define SIO_ROUTING_INTERFACE_QUERY _WSAIORW(IOC_WS2,20)
123 #define SIO_ROUTING_INTERFACE_CHANGE _WSAIOW(IOC_WS2,21)
124 #define SIO_ADDRESS_LIST_QUERY _WSAIOR(IOC_WS2,22)
125 #define SIO_ADDRESS_LIST_CHANGE _WSAIO(IOC_WS2,23)
126 #define SIO_QUERY_TARGET_PNP_HANDLE _WSAIOR(IOC_WS2,24)
127 #ifndef USE_WS_PREFIX
128 #define SIO_GET_INTERFACE_LIST _IOR ('t', 127, u_long)
130 #define SIO_GET_INTERFACE_LIST WS__IOR ('t', 127, u_long)
133 /* Constants for WSAIoctl() */
134 #define WSA_FLAG_OVERLAPPED 0x01
135 #define WSA_FLAG_MULTIPOINT_C_ROOT 0x02
136 #define WSA_FLAG_MULTIPOINT_C_LEAF 0x04
137 #define WSA_FLAG_MULTIPOINT_D_ROOT 0x08
138 #define WSA_FLAG_MULTIPOINT_D_LEAF 0x10
140 /* Constants for WSAJoinLeaf() */
141 #define JL_SENDER_ONLY 0x01
142 #define JL_RECEIVER_ONLY 0x02
150 #define MAX_PROTOCOL_CHAIN 7
151 #define BASE_PROTOCOL 1
152 #define LAYERED_PROTOCOL 0
154 typedef struct _WSAPROTOCOLCHAIN
156 int ChainLen
; /* the length of the chain, */
157 /* length = 0 means layered protocol, */
158 /* length = 1 means base protocol, */
159 /* length > 1 means protocol chain */
160 DWORD ChainEntries
[MAX_PROTOCOL_CHAIN
]; /* a list of dwCatalogEntryIds */
161 } WSAPROTOCOLCHAIN
, * LPWSAPROTOCOLCHAIN
;
163 #define WSAPROTOCOL_LEN 255
164 typedef struct _WSAPROTOCOL_INFOA
166 DWORD dwServiceFlags1
;
167 DWORD dwServiceFlags2
;
168 DWORD dwServiceFlags3
;
169 DWORD dwServiceFlags4
;
170 DWORD dwProviderFlags
;
172 DWORD dwCatalogEntryId
;
173 WSAPROTOCOLCHAIN ProtocolChain
;
180 int iProtocolMaxOffset
;
181 int iNetworkByteOrder
;
184 DWORD dwProviderReserved
;
185 CHAR szProtocol
[WSAPROTOCOL_LEN
+1];
186 } WSAPROTOCOL_INFOA
, * LPWSAPROTOCOL_INFOA
;
188 typedef struct _WSAPROTOCOL_INFOW
190 DWORD dwServiceFlags1
;
191 DWORD dwServiceFlags2
;
192 DWORD dwServiceFlags3
;
193 DWORD dwServiceFlags4
;
194 DWORD dwProviderFlags
;
196 DWORD dwCatalogEntryId
;
197 WSAPROTOCOLCHAIN ProtocolChain
;
204 int iProtocolMaxOffset
;
205 int iNetworkByteOrder
;
208 DWORD dwProviderReserved
;
209 WCHAR szProtocol
[WSAPROTOCOL_LEN
+1];
210 } WSAPROTOCOL_INFOW
, *LPWSAPROTOCOL_INFOW
;
212 DECL_WINELIB_TYPE_AW(WSAPROTOCOL_INFO
)
213 DECL_WINELIB_TYPE_AW(LPWSAPROTOCOL_INFO
)
215 typedef struct _WSANETWORKEVENTS
218 int iErrorCode
[FD_MAX_EVENTS
];
219 } WSANETWORKEVENTS
, *LPWSANETWORKEVENTS
;
221 typedef struct _WSANSClassInfoA
228 } WSANSCLASSINFOA
, *PWSANSCLASSINFOA
, *LPWSANSCLASSINFOA
;
230 typedef struct _WSANSClassInfoW
237 } WSANSCLASSINFOW
, *PWSANSCLASSINFOW
, *LPWSANSCLASSINFOW
;
239 DECL_WINELIB_TYPE_AW(WSANSCLASSINFO
)
240 DECL_WINELIB_TYPE_AW(PWSANSCLASSINFO
)
241 DECL_WINELIB_TYPE_AW(LPWSANSCLASSINFO
)
243 typedef struct _WSAServiceClassInfoA
245 LPGUID lpServiceClassId
;
246 LPSTR lpszServiceClassName
;
248 LPWSANSCLASSINFOA lpClassInfos
;
249 } WSASERVICECLASSINFOA
, *PWSASERVICECLASSINFOA
, *LPWSASERVICECLASSINFOA
;
251 typedef struct _WSAServiceClassInfoW
253 LPGUID lpServiceClassId
;
254 LPWSTR lpszServiceClassName
;
256 LPWSANSCLASSINFOW lpClassInfos
;
257 } WSASERVICECLASSINFOW
, *PWSASERVICECLASSINFOW
, *LPWSASERVICECLASSINFOW
;
260 DECL_WINELIB_TYPE_AW(WSASERVICECLASSINFO
)
261 DECL_WINELIB_TYPE_AW(PWSASERVICECLASSINFO
)
262 DECL_WINELIB_TYPE_AW(LPWSASERVICECLASSINFO
)
264 typedef struct _WSABUF
270 #define WSAEVENT HANDLE
271 #define LPWSAEVENT LPHANDLE
272 #define WSAOVERLAPPED OVERLAPPED
273 typedef struct _OVERLAPPED
* LPWSAOVERLAPPED
;
275 #define WSA_IO_PENDING (ERROR_IO_PENDING)
276 #define WSA_IO_INCOMPLETE (ERROR_IO_INCOMPLETE)
277 #define WSA_INVALID_HANDLE (ERROR_INVALID_HANDLE)
278 #define WSA_INVALID_PARAMETER (ERROR_INVALID_PARAMETER)
279 #define WSA_NOT_ENOUGH_MEMORY (ERROR_NOT_ENOUGH_MEMORY)
280 #define WSA_OPERATION_ABORTED (ERROR_OPERATION_ABORTED)
282 #define WSA_INVALID_EVENT ((WSAEVENT)NULL)
283 #define WSA_MAXIMUM_WAIT_EVENTS (MAXIMUM_WAIT_OBJECTS)
284 #define WSA_WAIT_FAILED ((DWORD)-1L)
285 #define WSA_WAIT_EVENT_0 (WAIT_OBJECT_0)
286 #define WSA_WAIT_IO_COMPLETION (WAIT_IO_COMPLETION)
287 #define WSA_WAIT_TIMEOUT (WAIT_TIMEOUT)
288 #define WSA_INFINITE (INFINITE)
290 typedef unsigned int GROUP
;
291 #define SG_UNCONSTRAINED_GROUP 0x01
292 #define SG_CONSTRAINED_GROUP 0x02
295 * FLOWSPEC and SERVICETYPE should eventually move to qos.h
298 typedef ULONG SERVICETYPE
;
300 typedef struct _FLOWSPEC
{
301 unsigned int TokenRate
;
302 unsigned int TokenBucketSize
;
303 unsigned int PeakBandwidth
;
304 unsigned int Latency
;
305 unsigned int DelayVariation
;
306 SERVICETYPE ServiceType
;
307 unsigned int MaxSduSize
;
308 unsigned int MinimumPolicedSize
;
309 } FLOWSPEC
, *PFLOWSPEC
, *LPFLOWSPEC
;
311 typedef struct _QUALITYOFSERVICE
{
312 FLOWSPEC SendingFlowspec
;
313 FLOWSPEC ReceivingFlowspec
;
314 WSABUF ProviderSpecific
;
317 typedef int (CALLBACK
*LPCONDITIONPROC
)
320 LPWSABUF lpCallerData
,
324 LPWSABUF lpCalleeData
,
329 typedef void (CALLBACK
*LPWSAOVERLAPPED_COMPLETION_ROUTINE
)
333 LPWSAOVERLAPPED lpOverlapped
,
340 * Winsock Function Typedefs
342 * Remember to keep this section in sync with the
343 * "Prototypes" section in winsock.h.
346 typedef HANDLE (WINAPI
*LPFN_WSAASYNCGETHOSTBYADDR
)(HWND
,u_int
,const char*,int,int,char*,int);
347 typedef HANDLE (WINAPI
*LPFN_WSAASYNCGETHOSTBYNAME
)(HWND
,u_int
,const char*,char*,int);
348 typedef HANDLE (WINAPI
*LPFN_WSAASYNCGETPROTOBYNAME
)(HWND
,u_int
,const char*,char*,int);
349 typedef HANDLE (WINAPI
*LPFN_WSAASYNCGETPROTOBYNUMBER
)(HWND
,u_int
,int,char*,int);
350 typedef HANDLE (WINAPI
*LPFN_WSAASYNCGETSERVBYNAME
)(HWND
,u_int
,const char*,const char*,char*,int);
351 typedef HANDLE (WINAPI
*LPFN_WSAASYNCGETSERVBYPORT
)(HWND
,u_int
,int,const char*,char*,int);
352 typedef int (WINAPI
*LPFN_WSAASYNCSELECT
)(SOCKET
,HWND
,u_int
,long);
353 typedef int (WINAPI
*LPFN_WSACANCELASYNCREQUEST
)(HANDLE
);
354 typedef int (WINAPI
*LPFN_WSACANCELBLOCKINGCALL
)(void);
355 typedef int (WINAPI
*LPFN_WSACLEANUP
)(void);
356 typedef int (WINAPI
*LPFN_WSAGETLASTERROR
)(void);
357 typedef BOOL (WINAPI
*LPFN_WSAISBLOCKING
)(void);
358 typedef FARPROC (WINAPI
*LPFN_WSASETBLOCKINGHOOK
)(FARPROC
);
359 typedef void (WINAPI
*LPFN_WSASETLASTERROR
)(int);
360 typedef int (WINAPI
*LPFN_WSASTARTUP
)(WORD
,LPWSADATA
);
361 typedef int (WINAPI
*LPFN_WSAUNHOOKBLOCKINGHOOK
)(void);
363 typedef SOCKET (WINAPI
*LPFN_ACCEPT
)(SOCKET
,struct WS(sockaddr
)*,int*);
364 typedef int (WINAPI
*LPFN_BIND
)(SOCKET
,const struct WS(sockaddr
)*,int);
365 typedef int (WINAPI
*LPFN_CLOSESOCKET
)(SOCKET
);
366 typedef int (WINAPI
*LPFN_CONNECT
)(SOCKET
,const struct WS(sockaddr
)*,int);
367 typedef struct WS(hostent
)* (WINAPI
*LPFN_GETHOSTBYADDR
)(const char*,int,int);
368 typedef struct WS(hostent
)* (WINAPI
*LPFN_GETHOSTBYNAME
)(const char*);
369 typedef int (WINAPI
*LPFN_GETHOSTNAME
)(char*,int);
370 typedef int (WINAPI
*LPFN_GETPEERNAME
)(SOCKET
,struct WS(sockaddr
)*,int*);
371 typedef struct WS(protoent
)* (WINAPI
*LPFN_GETPROTOBYNAME
)(const char*);
372 typedef struct WS(protoent
)* (WINAPI
*LPFN_GETPROTOBYNUMBER
)(int);
373 #ifdef WS_DEFINE_SELECT
374 typedef int (WINAPI
* LPFN_SELECT
)(int,WS(fd_set
)*,WS(fd_set
)*,WS(fd_set
)*,const struct WS(timeval
)*);
376 typedef struct WS(servent
)* (WINAPI
*LPFN_GETSERVBYNAME
)(const char*,const char*);
377 typedef struct WS(servent
)* (WINAPI
*LPFN_GETSERVBYPORT
)(int,const char*);
378 typedef int (WINAPI
*LPFN_GETSOCKNAME
)(SOCKET
,struct WS(sockaddr
)*,int*);
379 typedef int (WINAPI
*LPFN_GETSOCKOPT
)(SOCKET
,int,int,char*,int*);
380 typedef u_long (WINAPI
*LPFN_HTONL
)(u_long
);
381 typedef u_short (WINAPI
*LPFN_HTONS
)(u_short
);
382 typedef unsigned long (WINAPI
*LPFN_INET_ADDR
)(const char*);
383 typedef char* (WINAPI
*LPFN_INET_NTOA
)(struct WS(in_addr
);
384 typedef int (WINAPI
*LPFN_IOCTLSOCKET
)(SOCKET
,long,u_long
*);
385 typedef int (WINAPI
*LPFN_LISTEN
)(SOCKET
,int);
386 typedef u_long (WINAPI
*LPFN_NTOHL
)(u_long
);
387 typedef u_short (WINAPI
*LPFN_NTOHS
)(u_short
);
388 typedef int (WINAPI
*LPFN_RECV
)(SOCKET
,char*,int,int);
389 typedef int (WINAPI
*LPFN_RECVFROM
)(SOCKET
,char*,int,int,struct WS(sockaddr
)*,int*);
390 typedef int (WINAPI
*LPFN_SEND
)(SOCKET
,const char*,int,int);
391 typedef int (WINAPI
*LPFN_SENDTO
)(SOCKET
,const char*,int,int,const struct WS(sockaddr
)*,int);
392 typedef int (WINAPI
*LPFN_SETSOCKOPT
)(SOCKET
,int,int,const char*,int);
393 typedef int (WINAPI
*LPFN_SHUTDOWN
)(SOCKET
,int);
394 typedef SOCKET (WINAPI
*LPFN_SOCKET
)(int,int,int);
395 #endif /* WS_API_TYPEDEFS */
400 * Winsock2 Prototypes
402 * Remember to keep this section in sync with the
403 * "Winsock2 Function Typedefs" section below.
405 #if WS_API_PROTOTYPES
406 SOCKET WINAPI
WSAAccept(SOCKET
,struct WS(sockaddr
)*,LPINT
,LPCONDITIONPROC
,DWORD
);
407 INT WINAPI
WSAAddressToStringA(LPSOCKADDR
,DWORD
,LPWSAPROTOCOL_INFOA
,LPSTR
,LPDWORD
);
408 INT WINAPI
WSAAddressToStringW(LPSOCKADDR
,DWORD
,LPWSAPROTOCOL_INFOW
,LPWSTR
,LPDWORD
);
409 #define WSAAddressToString WINELIB_NAME_AW(WSAAddressToString)
410 BOOL WINAPI
WSACloseEvent(WSAEVENT
);
411 int WINAPI
WSAConnect(SOCKET
,const struct WS(sockaddr
)*,int,LPWSABUF
,LPWSABUF
,LPQOS
,LPQOS
);
412 WSAEVENT WINAPI
WSACreateEvent(void);
413 /* WSADuplicateSocketA */
414 /* WSADuplicateSocketW */
415 /* WSAEnumNameSpaceProvidersA */
416 /* WSAEnumNameSpaceProvidersW */
417 int WINAPI
WSAEnumNetworkEvents(SOCKET
,WSAEVENT
,LPWSANETWORKEVENTS
);
418 int WINAPI
WSAEnumProtocolsA(LPINT
,LPWSAPROTOCOL_INFOA
,LPDWORD
);
419 int WINAPI
WSAEnumProtocolsW(LPINT
,LPWSAPROTOCOL_INFOW
,LPDWORD
);
420 #define WSAEnumProtocols WINELIB_NAME_AW(WSAEnumProtocols)
421 int WINAPI
WSAEventSelect(SOCKET
,WSAEVENT
,long);
422 BOOL WINAPI
WSAGetOverlappedResult(SOCKET
,LPWSAOVERLAPPED
,LPDWORD
,BOOL
,LPDWORD
);
423 /* WSAGetQOSByName */
424 /* WSAGetServiceClassInfoA */
425 /* WSAGetServiceClassInfoW */
426 /* WSAGetServiceClassNameByClassIdA */
427 /* WSAGetServiceClassNameByClassIdW */
428 int WINAPI
WSAHtonl(SOCKET
,u_long
,u_long
*);
429 int WINAPI
WSAHtons(SOCKET
,u_short
,u_short
*);
430 int WINAPI
WSAInstallServiceClassA(LPWSASERVICECLASSINFOA
);
431 int WINAPI
WSAInstallServiceClassW(LPWSASERVICECLASSINFOW
);
432 #define WSAInstallServiceClass WINELIB_NAME_AW(WSAInstallServiceClass)
433 int WINAPI
WSAIoctl(SOCKET
,DWORD
,LPVOID
,DWORD
,LPVOID
,DWORD
,LPDWORD
,LPWSAOVERLAPPED
,LPWSAOVERLAPPED_COMPLETION_ROUTINE
);
434 SOCKET WINAPI
WSAJoinLeaf(SOCKET
,const struct WS(sockaddr
)*,int,LPWSABUF
,LPWSABUF
,LPQOS
,LPQOS
,DWORD
);
435 /* WSALookupServiceBeginA */
436 /* WSALookupServiceBeginW */
437 /* WSALookupServiceEnd */
438 /* WSALookupServiceNextA */
439 /* WSALookupServiceNextW */
440 int WINAPI
WSANtohl(SOCKET
,u_long
,u_long
*);
441 int WINAPI
WSANtohs(SOCKET
,u_short
,u_short
*);
442 /* WSAProviderConfigChange */
443 int WINAPI
WSARecv(SOCKET
,LPWSABUF
,DWORD
,LPDWORD
,LPDWORD
,LPWSAOVERLAPPED
,LPWSAOVERLAPPED_COMPLETION_ROUTINE
);
444 int WINAPI
WSARecvDisconnect(SOCKET
,LPWSABUF
);
445 int WINAPI
WSARecvFrom(SOCKET
,LPWSABUF
,DWORD
,LPDWORD
,LPDWORD
,struct WS(sockaddr
)*,LPINT
,LPWSAOVERLAPPED
,LPWSAOVERLAPPED_COMPLETION_ROUTINE
);
446 /* WSARemoveServiceClass */
447 BOOL WINAPI
WSAResetEvent(WSAEVENT
);
448 int WINAPI
WSASend(SOCKET
,LPWSABUF
,DWORD
,LPDWORD
,DWORD
,LPWSAOVERLAPPED
,LPWSAOVERLAPPED_COMPLETION_ROUTINE
);
449 int WINAPI
WSASendDisconnect(SOCKET
,LPWSABUF
);
450 int WINAPI
WSASendTo(SOCKET
,LPWSABUF
,DWORD
,LPDWORD
,DWORD
,const struct WS(sockaddr
)*,int,LPWSAOVERLAPPED
,LPWSAOVERLAPPED_COMPLETION_ROUTINE
);
451 BOOL WINAPI
WSASetEvent(WSAEVENT
);
454 SOCKET WINAPI
WSASocketA(int,int,int,LPWSAPROTOCOL_INFOA
,GROUP
,DWORD
);
455 SOCKET WINAPI
WSASocketW(int,int,int,LPWSAPROTOCOL_INFOW
,GROUP
,DWORD
);
456 INT WINAPI
WSAStringToAddressA(LPSTR
,INT
,LPWSAPROTOCOL_INFOA
,LPSOCKADDR
,LPINT
);
457 INT WINAPI
WSAStringToAddressW(LPSTR
,INT
,LPWSAPROTOCOL_INFOA
,LPSOCKADDR
,LPINT
);
458 #define WSASocket WINELIB_NAME_AW(WSASocket)
459 #define WSAStringToAddress WINELIB_NAME_AW(WSAStringToAddress)
460 DWORD WINAPI
WSAWaitForMultipleEvents(DWORD
,const WSAEVENT
*,BOOL
,DWORD
,BOOL
);
461 #endif /* WS_API_PROTOTYPES */
466 * Winsock2 Function Typedefs
468 * Remember to keep this section in sync with the
469 * "Winsock2 Prototypes" section above.
472 typedef SOCKET (WINAPI
*LPFN_WSAACCEPT
)(SOCKET
,WS(sockaddr
)*,LPINT
,LPCONDITIONPROC
,DWORD
);
473 typedef INT (WINAPI
*LPFN_WSAADRESSTOSTRINGA
)(LPSOCKADDR
,DWORD
,LPWSAPROTOCOL_INFOA
,LPSTR
,LPDWORD
);
474 typedef INT (WINAPI
*LPFN_WSAADRESSTOSTRINGW
)(LPSOCKADDR
,DWORD
,LPWSAPROTOCOL_INFOW
,LPWSTR
,LPDWORD
);
475 #define LPFN_WSAADDRESSTOSTRING WINELIB_NAME_AW(LPFN_WSAADDRESSTOSTRING)
476 typedef BOOL (WINAPI
*LPFN_WSACLOSEEVENT
)(WSAEVENT
);
477 typedef int (WINAPI
*LPFN_WSACONNECT
)(SOCKET
,const struct WS(sockaddr
)*,int,LPWSABUF
,LPWSABUF
,LPQOS
,LPQOS
);
478 typedef WSAEVENT (WINAPI
*LPFN_WSACREATEEVENT
)(void);
479 /* WSADuplicateSocketA */
480 /* WSADuplicateSocketW */
481 /* WSAEnumNameSpaceProvidersA */
482 /* WSAEnumNameSpaceProvidersW */
483 typedef int (WINAPI
*LPFN_WSAENUMNETWORKEVENT
)(SOCKET
,WSAEVENT
,LPWSANETWORKEVENTS
);
484 typedef int (WINAPI
*LPFN_WSAENUMPROTOCOLSA
)(LPINT
,LPWSAPROTOCOL_INFOA
,LPDWORD
);
485 typedef int (WINAPI
*LPFN_WSAENUMPROTOCOLSW
)(LPINT
,LPWSAPROTOCOL_INFOW
,LPDWORD
);
486 #define LPFN_WSAENUMPROTOCOLS WINELIB_NAME_AW(LPFN_WSAENUMPROTOCOLS)
487 typedef int (WINAPI
*LPFN_WSAEVENTSELECT
)(SOCKET
,WSAEVENT
,long);
488 typedef BOOL (WINAPI
*LPFN_WSAGETOVERLAPPEDRESULT
)(SOCKET
,LPWSAOVERLAPPED
,LPDWORD
,BOOL
,LPDWORD
);
489 /* WSAGetQOSByName */
490 /* WSAGetServiceClassInfoA */
491 /* WSAGetServiceClassInfoW */
492 /* WSAGetServiceClassNameByClassIdA */
493 /* WSAGetServiceClassNameByClassIdW */
494 typedef int (WINAPI
*LPFN_WSAHTONL
)(SOCKET
,u_long
,u_long
*);
495 typedef int (WINAPI
*LPFN_WSAHTONS
)(SOCKET
,u_short
,u_short
*);
496 typedef int (WINAPI LPFN_WSAINSTALLSERVICECLASSA
)(LPWSASERVICECLASSINFOA
);
497 typedef int (WINAPI LPFN_WSAINSTALLSERVICECLASSW
)(LPWSASERVICECLASSINFOW
);
498 typedef int (WINAPI
*LPFN_WSAIOCTL
)(SOCKET
,DWORD
,LPVOID
,DWORD
,LPVOID
,DWORD
,LPDWORD
,LPWSAOVERLAPPED
,LPWSAOVERLAPPED_COMPLETION_ROUTINE
);
499 typedef int (WINAPI
*LPFN_WSAJOINLEAF
)(SOCKET
,const struct WS(sockaddr
)*,int,LPWSABUF
,LPWSABUF
,LPQOS
,LPQOS
,DWORD
);
500 /* WSALookupServiceBeginA */
501 /* WSALookupServiceBeginW */
502 /* WSALookupServiceEnd */
503 /* WSALookupServiceNextA */
504 /* WSALookupServiceNextW */
505 typedef int (WINAPI
*LPFN_WSANTOHL
)(SOCKET
,u_long
,u_long
*);
506 typedef int (WINAPI
*LPFN_WSANTOHS
)(SOCKET
,u_short
,u_short
*);
507 /* WSAProviderConfigChange */
508 typedef int (WINAPI
*LPFN_WSARECV
)(SOCKET
,LPWSABUF
,DWORD
,LPDWORD
,LPDWORD
,LPWSAOVERLAPPED
,LPWSAOVERLAPPED_COMPLETION_ROUTINE
);
509 typedef int (WINAPI
*LPFN_WSARECVDISCONNECT
)(SOCKET
,LPWSABUF
);
510 typedef int (WINAPI
*LPFN_WSARECVFROM
)(SOCKET
,LPWSABUF
,DWORD
,LPDWORD
,LPDWORD
,struct WS(sockaddr
)*,LPINT
,LPWSAOVERLAPPED
,LPWSAOVERLAPPED_COMPLETION_ROUTINE
);
511 /* WSARemoveServiceClass */
512 typedef BOOL (WINAPI
*LPFN_WSARESETEVENT
)(WSAEVENT
);
513 typedef int (WINAPI
*LPFN_WSASEND
)(SOCKET
,LPWSABUF
,DWORD
,LPDWORD
,DWORD
,LPWSAOVERLAPPED
,LPWSAOVERLAPPED_COMPLETION_ROUTINE
);
514 typedef int (WINAPI
*LPFN_WSASENDDISCONNECT
)(SOCKET
,LPWSABUF
);
515 typedef int (WINAPI
*LPFN_WSASENDTO
)(SOCKET
,LPWSABUF
,DWORD
,LPDWORD
,DWORD
,const struct WS(sockaddr
)*,int,LPWSAOVERLAPPED
,LPWSAOVERLAPPED_COMPLETION_ROUTINE
);
516 typedef BOOL (WINAPI
*LPFN_WSASETEVENT
)(WSAEVENT
);
519 typedef SOCKET (WINAPI
*LPFN_WSASOCKETA
)(int,int,int,LPWSAPROTOCOL_INFOA
,GROUP
,DWORD
);
520 typedef SOCKET (WINAPI
*LPFN_WSASOCKETW
)(int,int,int,LPWSAPROTOCOL_INFOW
,GROUP
,DWORD
);
521 typedef INT (WINAPI
*LPFN_WSASTRINGTOADDRESSA
)(LPSTR
,INT
,LPWSAPROTOCOL_INFOA
,LPSOCKADDR
,LPINT
);
522 typedef INT (WINAPI
*LPFN_WSASTRINGTOADDRESSW
)(LPSTR
,INT
,LPWSAPROTOCOL_INFOA
,LPSOCKADDR
,LPINT
);
523 #define LPFN_WSASOCKET WINELIB_NAME_AW(LPFN_WSASOCKET)
524 #define LPFN_WSASTRINGTOADDRESS WINELIB_NAME_AW(LPFN_WSASTRINGTOADDRESS)
525 typedef DWORD (WINAPI
*LPFN_WSAWAITFORMULTIPLEEVENTS
)(DWORD
,const WSAEVENT
*,BOOL
,DWORD
,BOOL
);
526 #endif /* WS_API_TYPEDEFS */
529 /* Condition function return values */
530 #define CF_ACCEPT 0x0000
531 #define CF_REJECT 0x0001
532 #define CF_DEFER 0x0002
541 #undef WS_API_PROTOTYPES
542 #undef WS_API_TYPEDEFS
544 #endif /* __WINSOCK2API__ */