oleaut32: Implement OleLoadPictureFile.
[wine.git] / include / winsock2.h
blob1d2d7888909d35cb7cb7b54dec9df6ea9c9f2695
1 /*
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #ifndef __WINE_WINSOCKAPI_STDLIB_H
23 #define __WINE_WINSOCKAPI_STDLIB_H
26 * This section defines the items that conflict with the Unix headers.
28 #ifndef USE_WS_PREFIX
29 /* We are not using the WS_ prefix we risk getting conflicts for
30 * everything related to select.
32 # ifdef FD_CLR
33 /* Too late, the Unix version of stdlib.h was included before winsock.h.
34 * This means select and all the related stuff is already defined and we
35 * cannot override types and function prototypes.
36 * All we can do is disable all these symbols so that they are not used
37 * inadvertently.
39 # include <sys/types.h>
40 # undef FD_SETSIZE
41 # undef FD_CLR
42 # undef FD_SET
43 # undef FD_ZERO
44 # undef FD_ISSET
46 # define FD_SETSIZE Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
47 # define FD_CLR Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
48 # define FD_SET Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
49 # define FD_ZERO Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
50 # define FD_ISSET Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
51 # define fd_set Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
52 # define select Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
53 # elif defined(RLIM_INFINITY)
54 /* On Darwin stdlib.h includes sys/resource.h which defines timeval but not the fd_set macros */
55 # define fd_set unix_fd_set
56 # include <sys/types.h>
57 # include <time.h>
58 # include <stdlib.h>
59 # undef fd_set
60 # undef FD_SETSIZE
61 # undef FD_CLR
62 # undef FD_SET
63 # undef FD_ZERO
64 # undef FD_ISSET
65 # define select Include_winsock_h_before_sys_types_h_or_use_the_MSVCRT_library
66 # define timeval Include_winsock_h_before_sys_types_h_or_use_the_MSVCRT_library
67 # else /* FD_CLR */
68 /* stdlib.h has not been included yet so it's not too late. Include it now
69 * making sure that none of the select symbols is affected. Then we can
70 * define them with our own values.
72 # define fd_set unix_fd_set
73 # define timeval unix_timeval
74 # define select unix_select
75 # define socklen_t unix_socklen_t
76 # define u_long unix_u_long
77 # include <sys/types.h>
78 # include <time.h>
79 # include <stdlib.h>
80 # undef fd_set
81 # undef timeval
82 # undef select
83 # undef socklen_t
84 # undef u_long
85 # undef FD_SETSIZE
86 # undef FD_CLR
87 # undef FD_SET
88 # undef FD_ZERO
89 # undef FD_ISSET
90 # undef _TIMEVAL_DEFINED
92 # define WS_DEFINE_SELECT
93 # endif /* FD_CLR */
95 #else
96 # define WS_DEFINE_SELECT
97 # include <sys/types.h>
98 # include <stdlib.h>
99 #endif /* !USE_WS_PREFIX */
101 #endif /* __WINE_WINSOCKAPI_STDLIB_H */
103 #ifndef _WINSOCK2API_
104 #define _WINSOCK2API_
105 #define _WINSOCKAPI_
107 #include <windows.h>
109 #ifndef WINSOCK_API_LINKAGE
110 #ifdef _WS2_32_
111 # define WINSOCK_API_LINKAGE
112 #else
113 # define WINSOCK_API_LINKAGE DECLSPEC_IMPORT
114 #endif
115 #endif
117 #ifdef USE_WS_PREFIX
118 # define WS(x) WS_##x
119 #else
120 # define WS(x) x
121 #endif
123 #ifdef USE_WS_PREFIX
124 typedef unsigned char WS_u_char;
125 typedef unsigned short WS_u_short;
126 typedef unsigned int WS_u_int;
127 typedef ULONG WS_u_long;
128 #elif (defined(_MSC_VER) || defined(__MINGW32__) || defined(__WATCOMC__)) && !defined(_BSDTYPES_DEFINED)
129 /* MinGW doesn't define the u_xxx types */
130 typedef unsigned char u_char;
131 typedef unsigned short u_short;
132 typedef unsigned int u_int;
133 typedef ULONG u_long;
134 #define _BSDTYPES_DEFINED
135 #else
136 #define u_long ULONG /* make sure we don't use the system u_long */
137 #endif
139 typedef UINT_PTR SOCKET;
142 * Setup phase
145 /* Everything common between winsock.h and winsock2.h */
146 #ifndef INCL_WINSOCK_API_PROTOTYPES
147 #define INCL_WINSOCK_API_PROTOTYPES 1
148 #define WS_API_PROTOTYPES 1
149 #else
150 #define WS_API_PROTOTYPES INCL_WINSOCK_API_PROTOTYPES
151 #endif
153 #ifndef INCL_WINSOCK_API_TYPEDEFS
154 #define INCL_WINSOCK_API_TYPEDEFS 0
155 #define WS_API_TYPEDEFS 0
156 #else
157 #define WS_API_TYPEDEFS INCL_WINSOCK_API_TYPEDEFS
158 #endif
160 #include <ws2def.h>
162 #ifdef __cplusplus
163 extern "C" {
164 #endif /* defined(__cplusplus) */
166 #define INVALID_SOCKET (SOCKET)(~0)
167 #define SOCKET_ERROR (-1)
169 #ifndef USE_WS_PREFIX
170 #define SOL_SOCKET 0xffff
171 #define SO_DEBUG 0x0001
172 #define SO_ACCEPTCONN 0x0002
173 #define SO_REUSEADDR 0x0004
174 #define SO_EXCLUSIVEADDRUSE ((u_int)(~SO_REUSEADDR))
175 #define SO_KEEPALIVE 0x0008
176 #define SO_DONTROUTE 0x0010
177 #define SO_BROADCAST 0x0020
178 #define SO_USELOOPBACK 0x0040
179 #define SO_LINGER 0x0080
180 #define SO_OOBINLINE 0x0100
181 #define SO_DONTLINGER ((u_int)(~SO_LINGER))
182 #define SO_SNDBUF 0x1001
183 #define SO_RCVBUF 0x1002
184 #define SO_SNDLOWAT 0x1003
185 #define SO_RCVLOWAT 0x1004
186 #define SO_SNDTIMEO 0x1005
187 #define SO_RCVTIMEO 0x1006
188 #define SO_ERROR 0x1007
189 #define SO_TYPE 0x1008
190 #define SO_GROUP_ID 0x2001
191 #define SO_GROUP_PRIORITY 0x2002
192 #define SO_MAX_MSG_SIZE 0x2003
193 #define SO_PROTOCOL_INFOA 0x2004
194 #define SO_PROTOCOL_INFOW 0x2005
195 #define SO_PROTOCOL_INFO WINELIB_NAME_AW(WS_SO_PROTOCOL_INFO)
196 #define PVD_CONFIG 0x3001
197 #define SO_CONDITIONAL_ACCEPT 0x3002
198 #else
199 #define WS_SOL_SOCKET 0xffff
200 #define WS_SO_DEBUG 0x0001
201 #define WS_SO_ACCEPTCONN 0x0002
202 #define WS_SO_REUSEADDR 0x0004
203 #define WS_SO_EXCLUSIVEADDRUSE ((WS_u_int)(~WS_SO_REUSEADDR))
204 #define WS_SO_KEEPALIVE 0x0008
205 #define WS_SO_DONTROUTE 0x0010
206 #define WS_SO_BROADCAST 0x0020
207 #define WS_SO_USELOOPBACK 0x0040
208 #define WS_SO_LINGER 0x0080
209 #define WS_SO_OOBINLINE 0x0100
210 #define WS_SO_DONTLINGER ((WS_u_int)(~WS_SO_LINGER))
211 #define WS_SO_SNDBUF 0x1001
212 #define WS_SO_RCVBUF 0x1002
213 #define WS_SO_SNDLOWAT 0x1003
214 #define WS_SO_RCVLOWAT 0x1004
215 #define WS_SO_SNDTIMEO 0x1005
216 #define WS_SO_RCVTIMEO 0x1006
217 #define WS_SO_ERROR 0x1007
218 #define WS_SO_TYPE 0x1008
219 #define WS_SO_GROUP_ID 0x2001
220 #define WS_SO_GROUP_PRIORITY 0x2002
221 #define WS_SO_MAX_MSG_SIZE 0x2003
222 #define WS_SO_PROTOCOL_INFOA 0x2004
223 #define WS_SO_PROTOCOL_INFOW 0x2005
224 #define WS_SO_PROTOCOL_INFO WINELIB_NAME_AW(WS_SO_PROTOCOL_INFO)
225 #define WS_PVD_CONFIG 0x3001
226 #define WS_SO_CONDITIONAL_ACCEPT 0x3002
227 #endif
229 /* protocol types */
231 #define FROM_PROTOCOL_INFO (-1)
233 #ifndef USE_WS_PREFIX
234 #define SOCK_STREAM 1
235 #define SOCK_DGRAM 2
236 #define SOCK_RAW 3
237 #define SOCK_RDM 4
238 #define SOCK_SEQPACKET 5
239 #else /* USE_WS_PREFIX */
240 #define WS_SOCK_STREAM 1
241 #define WS_SOCK_DGRAM 2
242 #define WS_SOCK_RAW 3
243 #define WS_SOCK_RDM 4
244 #define WS_SOCK_SEQPACKET 5
245 #endif /* USE_WS_PREFIX */
247 /* protocol families */
249 #ifndef USE_WS_PREFIX
250 #define PF_APPLETALK AF_APPLETALK
251 #define PF_BAN AF_BAN
252 #define PF_CCITT AF_CCITT
253 #define PF_CHAOS AF_CHAOS
254 #define PF_DATAKIT AF_DATAKIT
255 #define PF_DECnet AF_DECnet
256 #define PF_DLI AF_DLI
257 #define PF_ECMA AF_ECMA
258 #define PF_FIREFOX AF_FIREFOX
259 #define PF_HYLINK AF_HYLINK
260 #define PF_IMPLINK AF_IMPLINK
261 #define PF_INET AF_INET
262 #define PF_INET6 AF_INET6
263 #define PF_IPX AF_IPX
264 #define PF_ISO AF_ISO
265 #define PF_LAT AF_LAT
266 #define PF_MAX AF_MAX
267 #define PF_NS AF_NS
268 #define PF_OSI AF_OSI
269 #define PF_PUP AF_PUP
270 #define PF_SNA AF_SNA
271 #define PF_UNIX AF_UNIX
272 #define PF_UNKNOWN1 AF_UNKNOWN1
273 #define PF_UNSPEC AF_UNSPEC
274 #define PF_VOICEVIEW AF_VOICEVIEW
275 #endif
277 /* option flags per socket */
279 #define FD_MAX_EVENTS 10
280 #define FD_READ_BIT 0
281 #define FD_WRITE_BIT 1
282 #define FD_OOB_BIT 2
283 #define FD_ACCEPT_BIT 3
284 #define FD_CONNECT_BIT 4
285 #define FD_CLOSE_BIT 5
286 #define FD_QOS_BIT 6
287 #define FD_GROUP_QOS_BIT 7
288 #define FD_ROUTING_INTERFACE_CHANGE_BIT 8
289 #define FD_ADDRESS_LIST_CHANGE_BIT 9
291 #define FD_READ 0x00000001
292 #define FD_WRITE 0x00000002
293 #define FD_OOB 0x00000004
294 #define FD_ACCEPT 0x00000008
295 #define FD_CONNECT 0x00000010
296 #define FD_CLOSE 0x00000020
297 #define FD_QOS 0x00000040
298 #define FD_GROUP_QOS 0x00000080
299 #define FD_ROUTING_INTERFACE_CHANGE 0x00000100
300 #define FD_ADDRESS_LIST_CHANGE 0x00000200
302 /* Constants for LPCONDITIONPROC */
303 #define CF_ACCEPT 0x0000
304 #define CF_REJECT 0x0001
305 #define CF_DEFER 0x0002
307 /* Constants for shutdown() */
308 #define SD_RECEIVE 0x00
309 #define SD_SEND 0x01
310 #define SD_BOTH 0x02
312 /* Constants for WSAPoll() */
313 #ifndef USE_WS_PREFIX
314 #define POLLERR 0x0001
315 #define POLLHUP 0x0002
316 #define POLLNVAL 0x0004
317 #define POLLWRNORM 0x0010
318 #define POLLWRBAND 0x0020
319 #define POLLRDNORM 0x0100
320 #define POLLRDBAND 0x0200
321 #define POLLPRI 0x0400
322 #define POLLIN (POLLRDNORM|POLLRDBAND)
323 #define POLLOUT (POLLWRNORM)
324 #else
325 #define WS_POLLERR 0x0001
326 #define WS_POLLHUP 0x0002
327 #define WS_POLLNVAL 0x0004
328 #define WS_POLLWRNORM 0x0010
329 #define WS_POLLWRBAND 0x0020
330 #define WS_POLLRDNORM 0x0100
331 #define WS_POLLRDBAND 0x0200
332 #define WS_POLLPRI 0x0400
333 #define WS_POLLIN (WS_POLLRDNORM|WS_POLLRDBAND)
334 #define WS_POLLOUT (WS_POLLWRNORM)
335 #endif
337 /* Constants for WSAIoctl() */
338 #ifdef USE_WS_PREFIX
339 #define WS_IOC_UNIX 0x00000000
340 #define WS_IOC_WS2 0x08000000
341 #define WS_IOC_PROTOCOL 0x10000000
342 #define WS_IOC_VENDOR 0x18000000
343 #define WS_IOC_VOID 0x20000000
344 #define WS_IOC_OUT 0x40000000
345 #define WS_IOC_IN 0x80000000
346 #define WS_IOC_INOUT (WS_IOC_IN|WS_IOC_OUT)
347 #define WS_IOCPARM_MASK 0x7f
348 #define WS__IO(x,y) (WS_IOC_VOID | ((x) << 8) | (y))
349 #define WS__IOR(x,y,t) (WS_IOC_OUT | (((UINT)sizeof(t) & WS_IOCPARM_MASK) << 16) | ((x) << 8) | (y))
350 #define WS__IOW(x,y,t) (WS_IOC_IN | (((UINT)sizeof(t) & WS_IOCPARM_MASK) << 16) | ((x) << 8) | (y))
351 #define _WSAIO(x,y) (WS_IOC_VOID|(x)|(y))
352 #define _WSAIOR(x,y) (WS_IOC_OUT|(x)|(y))
353 #define _WSAIOW(x,y) (WS_IOC_IN|(x)|(y))
354 #define _WSAIORW(x,y) (WS_IOC_INOUT|(x)|(y))
355 #define WS_FIONREAD WS__IOR('f', 127, ULONG)
356 #define WS_FIONBIO WS__IOW('f', 126, ULONG)
357 #define WS_FIOASYNC WS__IOW('f', 125, ULONG)
358 #define WS_SIOCSHIWAT WS__IOW('s', 0, ULONG)
359 #define WS_SIOCGHIWAT WS__IOR('s', 1, ULONG)
360 #define WS_SIOCSLOWAT WS__IOW('s', 2, ULONG)
361 #define WS_SIOCGLOWAT WS__IOR('s', 3, ULONG)
362 #define WS_SIOCATMARK WS__IOR('s', 7, ULONG)
363 #define WS_SIO_ASSOCIATE_HANDLE _WSAIOW(WS_IOC_WS2,1)
364 #define WS_SIO_ENABLE_CIRCULAR_QUEUEING _WSAIO(WS_IOC_WS2,2)
365 #define WS_SIO_FIND_ROUTE _WSAIOR(WS_IOC_WS2,3)
366 #define WS_SIO_FLUSH _WSAIO(WS_IOC_WS2,4)
367 #define WS_SIO_GET_BROADCAST_ADDRESS _WSAIOR(WS_IOC_WS2,5)
368 #define WS_SIO_GET_EXTENSION_FUNCTION_POINTER _WSAIORW(WS_IOC_WS2,6)
369 #define WS_SIO_GET_QOS _WSAIORW(WS_IOC_WS2,7)
370 #define WS_SIO_GET_GROUP_QOS _WSAIORW(WS_IOC_WS2,8)
371 #define WS_SIO_MULTIPOINT_LOOPBACK _WSAIOW(WS_IOC_WS2,9)
372 #define WS_SIO_MULTICAST_SCOPE _WSAIOW(WS_IOC_WS2,10)
373 #define WS_SIO_SET_QOS _WSAIOW(WS_IOC_WS2,11)
374 #define WS_SIO_SET_GROUP_QOS _WSAIOW(WS_IOC_WS2,12)
375 #define WS_SIO_TRANSLATE_HANDLE _WSAIORW(WS_IOC_WS2,13)
376 #define WS_SIO_ROUTING_INTERFACE_QUERY _WSAIORW(WS_IOC_WS2,20)
377 #define WS_SIO_ROUTING_INTERFACE_CHANGE _WSAIOW(WS_IOC_WS2,21)
378 #define WS_SIO_ADDRESS_LIST_QUERY _WSAIOR(WS_IOC_WS2,22)
379 #define WS_SIO_ADDRESS_LIST_CHANGE _WSAIO(WS_IOC_WS2,23)
380 #define WS_SIO_QUERY_TARGET_PNP_HANDLE _WSAIOR(WS_IOC_WS2,24)
381 #define WS_SIO_GET_INTERFACE_LIST WS__IOR('t', 127, ULONG)
382 #else /* USE_WS_PREFIX */
383 #undef IOC_VOID
384 #undef IOC_IN
385 #undef IOC_OUT
386 #undef IOC_INOUT
387 #define IOC_UNIX 0x00000000
388 #define IOC_WS2 0x08000000
389 #define IOC_PROTOCOL 0x10000000
390 #define IOC_VENDOR 0x18000000
391 #define IOC_VOID 0x20000000
392 #define IOC_OUT 0x40000000
393 #define IOC_IN 0x80000000
394 #define IOC_INOUT (IOC_IN|IOC_OUT)
395 #define IOCPARM_MASK 0x7f
396 #define _IO(x,y) (IOC_VOID | ((x) << 8) | (y))
397 #define _IOR(x,y,t) (IOC_OUT | (((UINT)sizeof(t) & IOCPARM_MASK) << 16) | ((x) << 8) | (y))
398 #define _IOW(x,y,t) (IOC_IN | (((UINT)sizeof(t) & IOCPARM_MASK) << 16) | ((x) << 8) | (y))
399 #define _WSAIO(x,y) (IOC_VOID|(x)|(y))
400 #define _WSAIOR(x,y) (IOC_OUT|(x)|(y))
401 #define _WSAIOW(x,y) (IOC_IN|(x)|(y))
402 #define _WSAIORW(x,y) (IOC_INOUT|(x)|(y))
403 #define FIONREAD _IOR('f', 127, ULONG)
404 #define FIONBIO _IOW('f', 126, ULONG)
405 #define FIOASYNC _IOW('f', 125, ULONG)
406 #define SIOCSHIWAT _IOW('s', 0, ULONG)
407 #define SIOCGHIWAT _IOR('s', 1, ULONG)
408 #define SIOCSLOWAT _IOW('s', 2, ULONG)
409 #define SIOCGLOWAT _IOR('s', 3, ULONG)
410 #define SIOCATMARK _IOR('s', 7, ULONG)
411 #define SIO_ASSOCIATE_HANDLE _WSAIOW(IOC_WS2,1)
412 #define SIO_ENABLE_CIRCULAR_QUEUEING _WSAIO(IOC_WS2,2)
413 #define SIO_FIND_ROUTE _WSAIOR(IOC_WS2,3)
414 #define SIO_FLUSH _WSAIO(IOC_WS2,4)
415 #define SIO_GET_BROADCAST_ADDRESS _WSAIOR(IOC_WS2,5)
416 #define SIO_GET_EXTENSION_FUNCTION_POINTER _WSAIORW(IOC_WS2,6)
417 #define SIO_GET_QOS _WSAIORW(IOC_WS2,7)
418 #define SIO_GET_GROUP_QOS _WSAIORW(IOC_WS2,8)
419 #define SIO_MULTIPOINT_LOOPBACK _WSAIOW(IOC_WS2,9)
420 #define SIO_MULTICAST_SCOPE _WSAIOW(IOC_WS2,10)
421 #define SIO_SET_QOS _WSAIOW(IOC_WS2,11)
422 #define SIO_SET_GROUP_QOS _WSAIOW(IOC_WS2,12)
423 #define SIO_TRANSLATE_HANDLE _WSAIORW(IOC_WS2,13)
424 #define SIO_ROUTING_INTERFACE_QUERY _WSAIORW(IOC_WS2,20)
425 #define SIO_ROUTING_INTERFACE_CHANGE _WSAIOW(IOC_WS2,21)
426 #define SIO_ADDRESS_LIST_QUERY _WSAIOR(IOC_WS2,22)
427 #define SIO_ADDRESS_LIST_CHANGE _WSAIO(IOC_WS2,23)
428 #define SIO_QUERY_TARGET_PNP_HANDLE _WSAIOR(IOC_WS2,24)
429 #define SIO_GET_INTERFACE_LIST _IOR ('t', 127, ULONG)
430 #endif /* USE_WS_PREFIX */
432 #ifndef USE_WS_PREFIX
433 #define SOMAXCONN 0x7fffffff
435 #define MSG_OOB 0x0001
436 #define MSG_PEEK 0x0002
437 #define MSG_DONTROUTE 0x0004
438 #define MSG_WAITALL 0x0008
439 #define MSG_INTERRUPT 0x0010
440 #define MSG_PARTIAL 0x8000
441 #define MSG_MAXIOVLEN 16
442 #else /* USE_WS_PREFIX */
443 #define WS_SOMAXCONN 0x7fffffff
445 #define WS_MSG_OOB 0x0001
446 #define WS_MSG_PEEK 0x0002
447 #define WS_MSG_DONTROUTE 0x0004
448 #define WS_MSG_WAITALL 0x0008
449 #define WS_MSG_INTERRUPT 0x0010
450 #define WS_MSG_PARTIAL 0x8000
451 #define WS_MSG_MAXIOVLEN 16
452 #endif /* USE_WS_PREFIX */
454 /* Constants for WSAIoctl() */
455 #define WSA_FLAG_OVERLAPPED 0x0001
456 #define WSA_FLAG_MULTIPOINT_C_ROOT 0x0002
457 #define WSA_FLAG_MULTIPOINT_C_LEAF 0x0004
458 #define WSA_FLAG_MULTIPOINT_D_ROOT 0x0008
459 #define WSA_FLAG_MULTIPOINT_D_LEAF 0x0010
460 #define WSA_FLAG_ACCESS_SYSTEM_SECURITY 0x0040
461 #define WSA_FLAG_NO_HANDLE_INHERIT 0x0080
462 #define WSA_FLAG_REGISTERED_IO 0x0100
464 /* Constants for WSAJoinLeaf() */
465 #define JL_SENDER_ONLY 0x01
466 #define JL_RECEIVER_ONLY 0x02
467 #define JL_BOTH 0x04
469 /* Constants for WSALookupServiceBegin() */
470 #define LUP_DEEP 0x0001
471 #define LUP_RETURN_NAME 0x0010
472 #define LUP_RETURN_TYPE 0x0020
473 #define LUP_RETURN_VERSION 0x0040
474 #define LUP_RETURN_COMMENT 0x0080
475 #define LUP_RETURN_ADDR 0x0100
476 #define LUP_RETURN_BLOB 0x0200
477 #define LUP_RETURN_ALIASES 0x0400
478 #define LUP_RETURN_QUERY_STRING 0x0800
479 #define LUP_RETURN_ALL (LUP_RETURN_ADDR|LUP_RETURN_BLOB|LUP_RETURN_ALIASES|LUP_RETURN_QUERY_STRING \
480 |LUP_RETURN_NAME|LUP_RETURN_TYPE|LUP_RETURN_VERSION|LUP_RETURN_COMMENT)
482 /* Constants for dwNameSpace from struct WSANAMESPACE_INFO */
483 #define NS_ALL 0
484 #define NS_SAP 1
485 #define NS_NDS 2
486 #define NS_PEER_BROWSE 3
487 #define NS_SLP 5
488 #define NS_DHCP 6
489 #define NS_TCPIP_LOCAL 10
490 #define NS_TCPIP_HOSTS 11
491 #define NS_DNS 12
492 #define NS_NETBT 13
493 #define NS_WINS 14
494 #define NS_NLA 15
495 #define NS_BTH 16
496 #define NS_NBP 20
497 #define NS_MS 30
498 #define NS_STDA 31
499 #define NS_NTDS 32
500 #define NS_EMAIL 37
501 #define NS_PNRPNAME 38
502 #define NS_PNRPCLOUD 39
503 #define NS_X500 40
504 #define NS_NIS 41
505 #define NS_NISPLUS 42
506 #define NS_WRQ 50
507 #define NS_NETDES 60
509 #ifndef GUID_DEFINED
510 #include <guiddef.h>
511 #endif
513 #define MAXGETHOSTSTRUCT 1024
515 #define MAX_PROTOCOL_CHAIN 7
516 #define BASE_PROTOCOL 1
517 #define LAYERED_PROTOCOL 0
519 typedef struct _WSAPROTOCOLCHAIN
521 int ChainLen; /* the length of the chain, */
522 /* length = 0 means layered protocol, */
523 /* length = 1 means base protocol, */
524 /* length > 1 means protocol chain */
525 DWORD ChainEntries[MAX_PROTOCOL_CHAIN]; /* a list of dwCatalogEntryIds */
526 } WSAPROTOCOLCHAIN, * LPWSAPROTOCOLCHAIN;
528 /* constants used in dwProviderFlags from struct WSAPROTOCOL_INFO */
529 #define PFL_MULTIPLE_PROTO_ENTRIES 0x00000001
530 #define PFL_RECOMMENDED_PROTO_ENTRY 0x00000002
531 #define PFL_HIDDEN 0x00000004
532 #define PFL_MATCHES_PROTOCOL_ZERO 0x00000008
534 #define XP1_CONNECTIONLESS 0x00000001
535 #define XP1_GUARANTEED_DELIVERY 0x00000002
536 #define XP1_GUARANTEED_ORDER 0x00000004
537 #define XP1_MESSAGE_ORIENTED 0x00000008
538 #define XP1_PSEUDO_STREAM 0x00000010
539 #define XP1_GRACEFUL_CLOSE 0x00000020
540 #define XP1_EXPEDITED_DATA 0x00000040
541 #define XP1_CONNECT_DATA 0x00000080
542 #define XP1_DISCONNECT_DATA 0x00000100
543 #define XP1_SUPPORT_BROADCAST 0x00000200
544 #define XP1_SUPPORT_MULTIPOINT 0x00000400
545 #define XP1_MULTIPOINT_CONTROL_PLANE 0x00000800
546 #define XP1_MULTIPOINT_DATA_PLANE 0x00001000
547 #define XP1_QOS_SUPPORTED 0x00002000
548 #define XP1_INTERRUPT 0x00004000
549 #define XP1_UNI_SEND 0x00008000
550 #define XP1_UNI_RECV 0x00010000
551 #define XP1_IFS_HANDLES 0x00020000
552 #define XP1_PARTIAL_MESSAGE 0x00040000
554 #define BIGENDIAN 0x0000
555 #define LITTLEENDIAN 0x0001
557 #define SECURITY_PROTOCOL_NONE 0x0000
559 #ifndef _TIMEVAL_DEFINED
560 #define _TIMEVAL_DEFINED
561 typedef struct WS(timeval)
563 LONG tv_sec;
564 LONG tv_usec;
565 } TIMEVAL, *PTIMEVAL, *LPTIMEVAL;
566 #endif
568 #ifdef WS_DEFINE_SELECT
570 #define __WS_FD_CLR(fd, set, cast) do { \
571 unsigned int __i; \
572 for (__i = 0; __i < ((cast*)(set))->fd_count; __i++) \
574 if (((cast*)(set))->fd_array[__i] == fd) \
576 while (__i < ((cast*)(set))->fd_count-1) \
578 ((cast*)(set))->fd_array[__i] = \
579 ((cast*)(set))->fd_array[__i+1]; \
580 __i++; \
582 ((cast*)(set))->fd_count--; \
583 break; \
586 } while (0)
588 #define __WS_FD_SET(fd, set, cast) do { \
589 unsigned int __i; \
590 for (__i = 0; __i < ((cast*)(set))->fd_count; __i++) \
592 if (((cast*)(set))->fd_array[__i] == (fd)) \
593 break; \
595 if (__i == ((cast*)(set))->fd_count && ((cast*)(set))->fd_count < FD_SETSIZE) \
597 ((cast*)(set))->fd_count++; \
598 ((cast*)(set))->fd_array[__i]=(fd);\
600 } while (0)
602 #ifndef USE_WS_PREFIX
604 # ifndef FD_SETSIZE
605 # define FD_SETSIZE 64
606 # endif
608 # define FD_CLR(fd, set) __WS_FD_CLR((fd), (set), fd_set)
609 # define FD_SET(fd, set) __WS_FD_SET((fd), (set), fd_set)
610 # define FD_ZERO(set) (((fd_set*)(set))->fd_count=0)
611 # define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (fd_set*)(set))
613 #else
615 # ifndef WS_FD_SETSIZE
616 # define WS_FD_SETSIZE 64
617 # endif
619 # define WS_FD_CLR(fd, set) __WS_FD_CLR((fd), (set), WS_fd_set)
620 # define WS_FD_SET(fd, set) __WS_FD_SET((fd), (set), WS_fd_set)
621 # define WS_FD_ZERO(set) (((WS_fd_set*)(set))->fd_count=0)
622 # define WS_FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (WS_fd_set*)(set))
624 #endif
626 typedef struct WS(fd_set)
628 WS(u_int) fd_count;
629 SOCKET fd_array[WS(FD_SETSIZE)];
630 } WS(fd_set), FD_SET, *PFD_SET, *LPFD_SET;
632 #endif
634 typedef struct /*WS(pollfd)*/
636 SOCKET fd;
637 SHORT events;
638 SHORT revents;
639 } WSAPOLLFD;
641 typedef struct WS(hostent)
643 char *h_name;
644 char **h_aliases;
645 short h_addrtype;
646 short h_length;
647 char **h_addr_list;
648 #define h_addr h_addr_list[0]
649 } HOSTENT, *PHOSTENT, *LPHOSTENT;
651 typedef struct WS(servent)
653 char *s_name;
654 char **s_aliases;
655 #ifdef _WIN64
656 char *s_proto;
657 short s_port;
658 #else
659 short s_port;
660 char *s_proto;
661 #endif
662 } SERVENT, *PSERVENT, *LPSERVENT;
664 typedef struct WS(protoent)
666 char *p_name;
667 char **p_aliases;
668 short p_proto;
669 } PROTOENT, *PPROTOENT, *LPPROTOENT;
671 typedef struct WS(linger)
673 WS(u_short) l_onoff;
674 WS(u_short) l_linger;
675 } LINGER, *PLINGER, *LPLINGER;
677 #define WSAPROTOCOL_LEN 255
678 typedef struct _WSAPROTOCOL_INFOA
680 DWORD dwServiceFlags1;
681 DWORD dwServiceFlags2;
682 DWORD dwServiceFlags3;
683 DWORD dwServiceFlags4;
684 DWORD dwProviderFlags;
685 GUID ProviderId;
686 DWORD dwCatalogEntryId;
687 WSAPROTOCOLCHAIN ProtocolChain;
688 int iVersion;
689 int iAddressFamily;
690 int iMaxSockAddr;
691 int iMinSockAddr;
692 int iSocketType;
693 int iProtocol;
694 int iProtocolMaxOffset;
695 int iNetworkByteOrder;
696 int iSecurityScheme;
697 DWORD dwMessageSize;
698 DWORD dwProviderReserved;
699 CHAR szProtocol[WSAPROTOCOL_LEN+1];
700 } WSAPROTOCOL_INFOA, * LPWSAPROTOCOL_INFOA;
702 typedef struct _WSAPROTOCOL_INFOW
704 DWORD dwServiceFlags1;
705 DWORD dwServiceFlags2;
706 DWORD dwServiceFlags3;
707 DWORD dwServiceFlags4;
708 DWORD dwProviderFlags;
709 GUID ProviderId;
710 DWORD dwCatalogEntryId;
711 WSAPROTOCOLCHAIN ProtocolChain;
712 int iVersion;
713 int iAddressFamily;
714 int iMaxSockAddr;
715 int iMinSockAddr;
716 int iSocketType;
717 int iProtocol;
718 int iProtocolMaxOffset;
719 int iNetworkByteOrder;
720 int iSecurityScheme;
721 DWORD dwMessageSize;
722 DWORD dwProviderReserved;
723 WCHAR szProtocol[WSAPROTOCOL_LEN+1];
724 } WSAPROTOCOL_INFOW, *LPWSAPROTOCOL_INFOW;
726 DECL_WINELIB_TYPE_AW(WSAPROTOCOL_INFO)
727 DECL_WINELIB_TYPE_AW(LPWSAPROTOCOL_INFO)
729 typedef struct _WSANETWORKEVENTS
731 LONG lNetworkEvents;
732 int iErrorCode[FD_MAX_EVENTS];
733 } WSANETWORKEVENTS, *LPWSANETWORKEVENTS;
735 typedef struct _WSANSClassInfoA
737 LPSTR lpszName;
738 DWORD dwNameSpace;
739 DWORD dwValueType;
740 DWORD dwValueSize;
741 LPVOID lpValue;
742 } WSANSCLASSINFOA, *PWSANSCLASSINFOA, *LPWSANSCLASSINFOA;
744 typedef struct _WSANSClassInfoW
746 LPSTR lpszName;
747 DWORD dwNameSpace;
748 DWORD dwValueType;
749 DWORD dwValueSize;
750 LPVOID lpValue;
751 } WSANSCLASSINFOW, *PWSANSCLASSINFOW, *LPWSANSCLASSINFOW;
753 DECL_WINELIB_TYPE_AW(WSANSCLASSINFO)
754 DECL_WINELIB_TYPE_AW(PWSANSCLASSINFO)
755 DECL_WINELIB_TYPE_AW(LPWSANSCLASSINFO)
757 typedef struct _WSAServiceClassInfoA
759 LPGUID lpServiceClassId;
760 LPSTR lpszServiceClassName;
761 DWORD dwCount;
762 LPWSANSCLASSINFOA lpClassInfos;
763 } WSASERVICECLASSINFOA, *PWSASERVICECLASSINFOA, *LPWSASERVICECLASSINFOA;
765 typedef struct _WSAServiceClassInfoW
767 LPGUID lpServiceClassId;
768 LPWSTR lpszServiceClassName;
769 DWORD dwCount;
770 LPWSANSCLASSINFOW lpClassInfos;
771 } WSASERVICECLASSINFOW, *PWSASERVICECLASSINFOW, *LPWSASERVICECLASSINFOW;
774 DECL_WINELIB_TYPE_AW(WSASERVICECLASSINFO)
775 DECL_WINELIB_TYPE_AW(PWSASERVICECLASSINFO)
776 DECL_WINELIB_TYPE_AW(LPWSASERVICECLASSINFO)
778 #define WSAEVENT HANDLE
779 #define LPWSAEVENT LPHANDLE
780 #define WSAOVERLAPPED OVERLAPPED
781 typedef struct _OVERLAPPED* LPWSAOVERLAPPED;
783 #ifndef USE_WS_PREFIX
784 #define h_errno WSAGetLastError()
785 #else
786 #define WS_h_errno WSAGetLastError()
787 #endif
789 #define WSAHOST_NOT_FOUND (WSABASEERR + 1001)
790 #define WSATRY_AGAIN (WSABASEERR + 1002)
791 #define WSANO_RECOVERY (WSABASEERR + 1003)
792 #define WSANO_DATA (WSABASEERR + 1004)
793 #define WSANO_ADDRESS WSANO_DATA
795 #define WSA_IO_PENDING (ERROR_IO_PENDING)
796 #define WSA_IO_INCOMPLETE (ERROR_IO_INCOMPLETE)
797 #define WSA_INVALID_HANDLE (ERROR_INVALID_HANDLE)
798 #define WSA_INVALID_PARAMETER (ERROR_INVALID_PARAMETER)
799 #define WSA_NOT_ENOUGH_MEMORY (ERROR_NOT_ENOUGH_MEMORY)
800 #define WSA_OPERATION_ABORTED (ERROR_OPERATION_ABORTED)
802 #define WSA_INVALID_EVENT ((WSAEVENT)NULL)
803 #define WSA_MAXIMUM_WAIT_EVENTS (MAXIMUM_WAIT_OBJECTS)
804 #define WSA_WAIT_FAILED ((DWORD)-1)
805 #define WSA_WAIT_EVENT_0 (WAIT_OBJECT_0)
806 #define WSA_WAIT_IO_COMPLETION (WAIT_IO_COMPLETION)
807 #define WSA_WAIT_TIMEOUT (WAIT_TIMEOUT)
808 #define WSA_INFINITE (INFINITE)
810 typedef unsigned int GROUP;
811 #define SG_UNCONSTRAINED_GROUP 0x01
812 #define SG_CONSTRAINED_GROUP 0x02
815 * FLOWSPEC and SERVICETYPE should eventually move to qos.h
818 typedef ULONG SERVICETYPE;
820 typedef struct _FLOWSPEC {
821 unsigned int TokenRate;
822 unsigned int TokenBucketSize;
823 unsigned int PeakBandwidth;
824 unsigned int Latency;
825 unsigned int DelayVariation;
826 SERVICETYPE ServiceType;
827 unsigned int MaxSduSize;
828 unsigned int MinimumPolicedSize;
829 } FLOWSPEC, *PFLOWSPEC, *LPFLOWSPEC;
831 typedef struct _QUALITYOFSERVICE {
832 FLOWSPEC SendingFlowspec;
833 FLOWSPEC ReceivingFlowspec;
834 WSABUF ProviderSpecific;
835 } QOS, *LPQOS;
837 typedef int (CALLBACK *LPCONDITIONPROC)
839 LPWSABUF lpCallerId,
840 LPWSABUF lpCallerData,
841 LPQOS lpSQOS,
842 LPQOS lpGQOS,
843 LPWSABUF lpCalleeId,
844 LPWSABUF lpCalleeData,
845 GROUP *g,
846 DWORD_PTR dwCallbackData
849 typedef void (CALLBACK *LPWSAOVERLAPPED_COMPLETION_ROUTINE)
851 DWORD dwError,
852 DWORD cbTransferred,
853 LPWSAOVERLAPPED lpOverlapped,
854 DWORD dwFlags
857 #ifndef _tagBLOB_DEFINED
858 #define _tagBLOB_DEFINED
859 #define _BLOB_DEFINED
860 #define _LPBLOB_DEFINED
861 typedef struct _BLOB {
862 ULONG cbSize;
863 BYTE *pBlobData;
864 } BLOB, *LPBLOB;
865 #endif
867 /* addressfamily protocol pairs */
868 typedef struct _AFPROTOCOLS {
869 INT iAddressFamily;
870 INT iProtocol;
871 } AFPROTOCOLS, *PAFPROTOCOLS, *LPAFPROTOCOLS;
873 /* client query definitions */
874 typedef enum _WSAEcomparator {
875 COMP_EQUAL = 0,
876 COMP_NOTLESS
877 } WSAECOMPARATOR, *PWSAECOMPARATOR, *LPWSAECOMPARATOR;
879 typedef struct _WSAVersion {
880 DWORD dwVersion;
881 WSAECOMPARATOR ecHow;
882 } WSAVERSION, *PWSAVERSION, *LPWSAVERSION;
885 typedef struct _WSAQuerySetA {
886 DWORD dwSize;
887 LPSTR lpszServiceInstanceName;
888 LPGUID lpServiceClassId;
889 LPWSAVERSION lpVersion;
890 LPSTR lpszComment;
891 DWORD dwNameSpace;
892 LPGUID lpNSProviderId;
893 LPSTR lpszContext;
894 DWORD dwNumberOfProtocols;
895 LPAFPROTOCOLS lpafpProtocols;
896 LPSTR lpszQueryString;
897 DWORD dwNumberOfCsAddrs;
898 LPCSADDR_INFO lpcsaBuffer;
899 DWORD dwOutputFlags;
900 LPBLOB lpBlob;
901 } WSAQUERYSETA, *PWSAQUERYSETA, *LPWSAQUERYSETA;
903 typedef struct _WSAQuerySetW {
904 DWORD dwSize;
905 LPWSTR lpszServiceInstanceName;
906 LPGUID lpServiceClassId;
907 LPWSAVERSION lpVersion;
908 LPWSTR lpszComment;
909 DWORD dwNameSpace;
910 LPGUID lpNSProviderId;
911 LPWSTR lpszContext;
912 DWORD dwNumberOfProtocols;
913 LPAFPROTOCOLS lpafpProtocols;
914 LPWSTR lpszQueryString;
915 DWORD dwNumberOfCsAddrs;
916 LPCSADDR_INFO lpcsaBuffer;
917 DWORD dwOutputFlags;
918 LPBLOB lpBlob;
919 } WSAQUERYSETW, *PWSAQUERYSETW, *LPWSAQUERYSETW;
921 DECL_WINELIB_TYPE_AW(WSAQUERYSET)
922 DECL_WINELIB_TYPE_AW(PWSAQUERYSET)
923 DECL_WINELIB_TYPE_AW(LPWSAQUERYSET)
925 typedef enum _WSAESETSERVICEOP {
926 RNRSERVICE_REGISTER = 0,
927 RNRSERVICE_DEREGISTER,
928 RNRSERVICE_DELETE
929 } WSAESETSERVICEOP, *PWSAESETSERVICEOP, *LPWSAESETSERVICEOP;
931 typedef struct _WSANAMESPACE_INFOA {
932 GUID NSProviderId;
933 DWORD dwNameSpace;
934 BOOL fActive;
935 DWORD dwVersion;
936 LPSTR lpszIdentifier;
937 } WSANAMESPACE_INFOA, *PWSANAMESPACE_INFOA, *LPWSANAMESPACE_INFOA;
939 typedef struct _WSANAMESPACE_INFOW {
940 GUID NSProviderId;
941 DWORD dwNameSpace;
942 BOOL fActive;
943 DWORD dwVersion;
944 LPWSTR lpszIdentifier;
945 } WSANAMESPACE_INFOW, *PWSANAMESPACE_INFOW, *LPWSANAMESPACE_INFOW;
947 DECL_WINELIB_TYPE_AW(WSANAMESPACE_INFO)
948 DECL_WINELIB_TYPE_AW(PWSANAMESPACE_INFO)
949 DECL_WINELIB_TYPE_AW(LPWSANAMESPACE_INFO)
951 typedef enum _WSACOMPLETIONTYPE {
952 NSP_NOTIFY_IMMEDIATELY = 0,
953 NSP_NOTIFY_HWND = 1,
954 NSP_NOTIFY_EVENT = 2,
955 NSP_NOTIFY_PORT = 3,
956 NSP_NOTIFY_APC = 4
957 } WSACOMPLETIONTYPE, * PWSACOMPLETIONTYPE, * LPWSACOMPLETIONTYPE;
959 typedef struct _WSACOMPLETION {
960 WSACOMPLETIONTYPE Type;
961 union {
962 struct {
963 HWND hWnd;
964 UINT uMsg;
965 WPARAM context;
966 } WindowMessage;
967 struct {
968 LPWSAOVERLAPPED lpOverlapped;
969 } Event;
970 struct {
971 LPWSAOVERLAPPED lpOverlapped;
972 LPWSAOVERLAPPED_COMPLETION_ROUTINE lpfnCompletionProc;
973 } Apc;
974 struct {
975 LPWSAOVERLAPPED lpOverlapped;
976 HANDLE hPort;
977 ULONG_PTR Key;
978 } Port;
979 } Parameters;
980 } WSACOMPLETION, *PWSACOMPLETION, *LPWSACOMPLETION;
982 #define WSADESCRIPTION_LEN 256
983 #define WSASYS_STATUS_LEN 128
985 typedef struct WSAData
987 WORD wVersion;
988 WORD wHighVersion;
989 #ifdef _WIN64
990 WORD iMaxSockets;
991 WORD iMaxUdpDg;
992 char *lpVendorInfo;
993 char szDescription[WSADESCRIPTION_LEN+1];
994 char szSystemStatus[WSASYS_STATUS_LEN+1];
995 #else
996 char szDescription[WSADESCRIPTION_LEN+1];
997 char szSystemStatus[WSASYS_STATUS_LEN+1];
998 WORD iMaxSockets;
999 WORD iMaxUdpDg;
1000 char *lpVendorInfo;
1001 #endif
1002 } WSADATA, *LPWSADATA;
1004 #define WSAMAKEASYNCREPLY(size, error) MAKELONG(size, error)
1005 #define WSAMAKESELECTREPLY(flags, error) MAKELONG(flags, error)
1006 #define WSAGETASYNCBUFLEN(x) LOWORD(x)
1007 #define WSAGETASYNCERROR(x) HIWORD(x)
1008 #define WSAGETSELECTEVENT(x) LOWORD(x)
1009 #define WSAGETSELECTERROR(x) HIWORD(x)
1012 * Winsock Function Typedefs
1014 * Remember to keep this section in sync with the
1015 * "Prototypes" section in winsock.h.
1017 #if WS_API_TYPEDEFS
1018 typedef HANDLE (WINAPI *LPFN_WSAASYNCGETHOSTBYADDR)(HWND,WS(u_int),const char*,int,int,char*,int);
1019 typedef HANDLE (WINAPI *LPFN_WSAASYNCGETHOSTBYNAME)(HWND,WS(u_int),const char*,char*,int);
1020 typedef HANDLE (WINAPI *LPFN_WSAASYNCGETPROTOBYNAME)(HWND,WS(u_int),const char*,char*,int);
1021 typedef HANDLE (WINAPI *LPFN_WSAASYNCGETPROTOBYNUMBER)(HWND,WS(u_int),int,char*,int);
1022 typedef HANDLE (WINAPI *LPFN_WSAASYNCGETSERVBYNAME)(HWND,WS(u_int),const char*,const char*,char*,int);
1023 typedef HANDLE (WINAPI *LPFN_WSAASYNCGETSERVBYPORT)(HWND,WS(u_int),int,const char*,char*,int);
1024 typedef int (WINAPI *LPFN_WSAASYNCSELECT)(SOCKET,HWND,WS(u_int),LONG);
1025 typedef int (WINAPI *LPFN_WSACANCELASYNCREQUEST)(HANDLE);
1026 typedef int (WINAPI *LPFN_WSACANCELBLOCKINGCALL)(void);
1027 typedef int (WINAPI *LPFN_WSACLEANUP)(void);
1028 typedef int (WINAPI *LPFN_WSAGETLASTERROR)(void);
1029 typedef BOOL (WINAPI *LPFN_WSAISBLOCKING)(void);
1030 typedef FARPROC (WINAPI *LPFN_WSASETBLOCKINGHOOK)(FARPROC);
1031 typedef void (WINAPI *LPFN_WSASETLASTERROR)(int);
1032 typedef int (WINAPI *LPFN_WSASTARTUP)(WORD,LPWSADATA);
1033 typedef int (WINAPI *LPFN_WSAUNHOOKBLOCKINGHOOK)(void);
1035 typedef SOCKET (WINAPI *LPFN_ACCEPT)(SOCKET,struct WS(sockaddr)*,int*);
1036 typedef int (WINAPI *LPFN_BIND)(SOCKET,const struct WS(sockaddr)*,int);
1037 typedef int (WINAPI *LPFN_CLOSESOCKET)(SOCKET);
1038 typedef int (WINAPI *LPFN_CONNECT)(SOCKET,const struct WS(sockaddr)*,int);
1039 typedef struct WS(hostent)* (WINAPI *LPFN_GETHOSTBYADDR)(const char*,int,int);
1040 typedef struct WS(hostent)* (WINAPI *LPFN_GETHOSTBYNAME)(const char*);
1041 typedef int (WINAPI *LPFN_GETHOSTNAME)(char*,int);
1042 typedef int (WINAPI *LPFN_GETPEERNAME)(SOCKET,struct WS(sockaddr)*,int*);
1043 typedef struct WS(protoent)* (WINAPI *LPFN_GETPROTOBYNAME)(const char*);
1044 typedef struct WS(protoent)* (WINAPI *LPFN_GETPROTOBYNUMBER)(int);
1045 #ifdef WS_DEFINE_SELECT
1046 typedef int (WINAPI* LPFN_SELECT)(int,WS(fd_set)*,WS(fd_set)*,WS(fd_set)*,const struct WS(timeval)*);
1047 #endif
1048 typedef struct WS(servent)* (WINAPI *LPFN_GETSERVBYNAME)(const char*,const char*);
1049 typedef struct WS(servent)* (WINAPI *LPFN_GETSERVBYPORT)(int,const char*);
1050 typedef int (WINAPI *LPFN_GETSOCKNAME)(SOCKET,struct WS(sockaddr)*,int*);
1051 typedef int (WINAPI *LPFN_GETSOCKOPT)(SOCKET,int,int,char*,int*);
1052 typedef ULONG (WINAPI *LPFN_HTONL)(ULONG);
1053 typedef WS(u_short) (WINAPI *LPFN_HTONS)(WS(u_short));
1054 typedef ULONG (WINAPI *LPFN_INET_ADDR)(const char*);
1055 typedef char* (WINAPI *LPFN_INET_NTOA)(struct WS(in_addr));
1056 typedef int (WINAPI *LPFN_IOCTLSOCKET)(SOCKET,LONG,ULONG*);
1057 typedef int (WINAPI *LPFN_LISTEN)(SOCKET,int);
1058 typedef ULONG (WINAPI *LPFN_NTOHL)(ULONG);
1059 typedef WS(u_short) (WINAPI *LPFN_NTOHS)(WS(u_short));
1060 typedef int (WINAPI *LPFN_RECV)(SOCKET,char*,int,int);
1061 typedef int (WINAPI *LPFN_RECVFROM)(SOCKET,char*,int,int,struct WS(sockaddr)*,int*);
1062 typedef int (WINAPI *LPFN_SEND)(SOCKET,const char*,int,int);
1063 typedef int (WINAPI *LPFN_SENDTO)(SOCKET,const char*,int,int,const struct WS(sockaddr)*,int);
1064 typedef int (WINAPI *LPFN_SETSOCKOPT)(SOCKET,int,int,const char*,int);
1065 typedef int (WINAPI *LPFN_SHUTDOWN)(SOCKET,int);
1066 typedef SOCKET (WINAPI *LPFN_SOCKET)(int,int,int);
1067 #endif /* WS_API_TYPEDEFS */
1072 * Winsock2 Prototypes
1074 * Remember to keep this section in sync with the
1075 * "Winsock2 Function Typedefs" section below.
1077 #if WS_API_PROTOTYPES
1078 WINSOCK_API_LINKAGE int WINAPI __WSAFDIsSet(SOCKET, WS(fd_set) *);
1080 WINSOCK_API_LINKAGE SOCKET WINAPI WS(accept)(SOCKET, struct WS(sockaddr) *, int *);
1081 WINSOCK_API_LINKAGE int WINAPI WS(bind)(SOCKET, const struct WS(sockaddr) *, int);
1082 WINSOCK_API_LINKAGE int WINAPI WS(closesocket)(SOCKET);
1083 WINSOCK_API_LINKAGE int WINAPI WS(connect)(SOCKET, const struct WS(sockaddr) *, int);
1084 WINSOCK_API_LINKAGE struct WS(hostent) * WINAPI WS(gethostbyaddr)(const char *, int, int);
1085 WINSOCK_API_LINKAGE struct WS(hostent) * WINAPI WS(gethostbyname)(const char *);
1086 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__WINE_USE_MSVCRT)
1087 /* gethostname is defined in unistd.h */
1088 WINSOCK_API_LINKAGE int WINAPI WS(gethostname)(char *, int);
1089 #endif
1090 WINSOCK_API_LINKAGE int WINAPI WS(getpeername)(SOCKET, struct WS(sockaddr) *, int *);
1091 WINSOCK_API_LINKAGE struct WS(protoent) * WINAPI WS(getprotobyname)(const char *);
1092 WINSOCK_API_LINKAGE struct WS(protoent) * WINAPI WS(getprotobynumber)(int);
1093 WINSOCK_API_LINKAGE struct WS(servent) * WINAPI WS(getservbyname)(const char *, const char *);
1094 WINSOCK_API_LINKAGE struct WS(servent) * WINAPI WS(getservbyport)(int, const char *);
1095 WINSOCK_API_LINKAGE int WINAPI WS(getsockname)(SOCKET, struct WS(sockaddr) *, int *);
1096 WINSOCK_API_LINKAGE int WINAPI WS(getsockopt)(SOCKET, int, int, char *, int *);
1097 WINSOCK_API_LINKAGE ULONG WINAPI WS(htonl)(ULONG);
1098 WINSOCK_API_LINKAGE WS(u_short) WINAPI WS(htons)(WS(u_short));
1099 WINSOCK_API_LINKAGE ULONG WINAPI WS(inet_addr)(const char *);
1100 WINSOCK_API_LINKAGE char * WINAPI WS(inet_ntoa)(struct WS(in_addr));
1101 WINSOCK_API_LINKAGE int WINAPI WS(ioctlsocket)(SOCKET, LONG, WS(u_long) *);
1102 WINSOCK_API_LINKAGE int WINAPI WS(listen)(SOCKET, int);
1103 WINSOCK_API_LINKAGE ULONG WINAPI WS(ntohl)(ULONG);
1104 WINSOCK_API_LINKAGE WS(u_short) WINAPI WS(ntohs)(WS(u_short));
1105 WINSOCK_API_LINKAGE int WINAPI WS(recv)(SOCKET, char *, int, int);
1106 WINSOCK_API_LINKAGE int WINAPI WS(recvfrom)(SOCKET, char *, int, int, struct WS(sockaddr) *, int *);
1107 #ifdef WS_DEFINE_SELECT
1108 WINSOCK_API_LINKAGE int WINAPI WS(select)(int, WS(fd_set) *, WS(fd_set) *, WS(fd_set) *, const struct WS(timeval) *);
1109 #endif
1110 WINSOCK_API_LINKAGE int WINAPI WS(send)(SOCKET, const char *, int, int);
1111 WINSOCK_API_LINKAGE int WINAPI WS(sendto)(SOCKET, const char *, int, int, const struct WS(sockaddr) *, int);
1112 WINSOCK_API_LINKAGE int WINAPI WS(setsockopt)(SOCKET, int, int, const char *, int);
1113 WINSOCK_API_LINKAGE int WINAPI WS(shutdown)(SOCKET, int);
1114 WINSOCK_API_LINKAGE SOCKET WINAPI WS(socket)(int, int, int);
1116 WINSOCK_API_LINKAGE int WINAPI GetHostNameW(WCHAR *, int);
1117 WINSOCK_API_LINKAGE SOCKET WINAPI WSAAccept(SOCKET,struct WS(sockaddr)*,LPINT,LPCONDITIONPROC,DWORD_PTR);
1118 WINSOCK_API_LINKAGE INT WINAPI WSAAddressToStringA(LPSOCKADDR,DWORD,LPWSAPROTOCOL_INFOA,LPSTR,LPDWORD);
1119 WINSOCK_API_LINKAGE INT WINAPI WSAAddressToStringW(LPSOCKADDR,DWORD,LPWSAPROTOCOL_INFOW,LPWSTR,LPDWORD);
1120 #define WSAAddressToString WINELIB_NAME_AW(WSAAddressToString)
1121 WINSOCK_API_LINKAGE HANDLE WINAPI WSAAsyncGetHostByAddr(HWND, WS(u_int), const char *, int, int, char *, int);
1122 WINSOCK_API_LINKAGE HANDLE WINAPI WSAAsyncGetHostByName(HWND, WS(u_int), const char *, char *, int);
1123 WINSOCK_API_LINKAGE HANDLE WINAPI WSAAsyncGetProtoByName(HWND, WS(u_int), const char *, char *, int);
1124 WINSOCK_API_LINKAGE HANDLE WINAPI WSAAsyncGetProtoByNumber(HWND, WS(u_int), int, char *, int);
1125 WINSOCK_API_LINKAGE HANDLE WINAPI WSAAsyncGetServByName(HWND, WS(u_int), const char *, const char *, char *, int);
1126 WINSOCK_API_LINKAGE HANDLE WINAPI WSAAsyncGetServByPort(HWND, WS(u_int), int, const char *, char *, int);
1127 WINSOCK_API_LINKAGE int WINAPI WSAAsyncSelect(SOCKET, HWND, WS(u_int), LONG);
1128 WINSOCK_API_LINKAGE int WINAPI WSACancelAsyncRequest(HANDLE);
1129 WINSOCK_API_LINKAGE int WINAPI WSACancelBlockingCall(void);
1130 WINSOCK_API_LINKAGE int WINAPI WSACleanup(void);
1131 WINSOCK_API_LINKAGE BOOL WINAPI WSACloseEvent(WSAEVENT);
1132 WINSOCK_API_LINKAGE int WINAPI WSAConnect(SOCKET,const struct WS(sockaddr)*,int,LPWSABUF,LPWSABUF,LPQOS,LPQOS);
1133 WINSOCK_API_LINKAGE BOOL WINAPI WSAConnectByNameA(SOCKET,const char *,const char *,DWORD *,struct WS(sockaddr) *,DWORD *,struct WS(sockaddr) *,const struct WS(timeval) *,WSAOVERLAPPED *);
1134 WINSOCK_API_LINKAGE BOOL WINAPI WSAConnectByNameW(SOCKET,const WCHAR *,const WCHAR *,DWORD *,struct WS(sockaddr) *,DWORD *,struct WS(sockaddr) *,const struct WS(timeval) *,WSAOVERLAPPED *);
1135 #define WSAConnectByName WINELIB_NAME_AW(WSAConnectByName)
1136 WINSOCK_API_LINKAGE WSAEVENT WINAPI WSACreateEvent(void);
1137 WINSOCK_API_LINKAGE INT WINAPI WSADuplicateSocketA(SOCKET,DWORD,LPWSAPROTOCOL_INFOA);
1138 WINSOCK_API_LINKAGE INT WINAPI WSADuplicateSocketW(SOCKET,DWORD,LPWSAPROTOCOL_INFOW);
1139 #define WSADuplicateSocket WINELIB_NAME_AW(WSADuplicateSocket)
1140 WINSOCK_API_LINKAGE INT WINAPI WSAEnumNameSpaceProvidersA(LPDWORD,LPWSANAMESPACE_INFOA);
1141 WINSOCK_API_LINKAGE INT WINAPI WSAEnumNameSpaceProvidersW(LPDWORD,LPWSANAMESPACE_INFOW);
1142 #define WSAEnumNameSpaceProviders WINELIB_NAME_AW(WSAEnumNameSpaceProviders)
1143 WINSOCK_API_LINKAGE int WINAPI WSAEnumNetworkEvents(SOCKET,WSAEVENT,LPWSANETWORKEVENTS);
1144 WINSOCK_API_LINKAGE int WINAPI WSAEnumProtocolsA(LPINT,LPWSAPROTOCOL_INFOA,LPDWORD);
1145 WINSOCK_API_LINKAGE int WINAPI WSAEnumProtocolsW(LPINT,LPWSAPROTOCOL_INFOW,LPDWORD);
1146 #define WSAEnumProtocols WINELIB_NAME_AW(WSAEnumProtocols)
1147 WINSOCK_API_LINKAGE int WINAPI WSAEventSelect(SOCKET,WSAEVENT,LONG);
1148 WINSOCK_API_LINKAGE int WINAPI WSAGetLastError(void);
1149 WINSOCK_API_LINKAGE BOOL WINAPI WSAGetOverlappedResult(SOCKET,LPWSAOVERLAPPED,LPDWORD,BOOL,LPDWORD);
1150 WINSOCK_API_LINKAGE BOOL WINAPI WSAGetQOSByName(SOCKET,LPWSABUF,LPQOS);
1151 WINSOCK_API_LINKAGE INT WINAPI WSAGetServiceClassInfoA(LPGUID,LPGUID,LPDWORD,LPWSASERVICECLASSINFOA);
1152 WINSOCK_API_LINKAGE INT WINAPI WSAGetServiceClassInfoW(LPGUID,LPGUID,LPDWORD,LPWSASERVICECLASSINFOW);
1153 #define WSAGetServiceClassInfo WINELIB_NAME_AW(WSAGetServiceClassInfo)
1154 WINSOCK_API_LINKAGE INT WINAPI WSAGetServiceClassNameByClassIdA(LPGUID,LPSTR,LPDWORD);
1155 WINSOCK_API_LINKAGE INT WINAPI WSAGetServiceClassNameByClassIdW(LPGUID,LPWSTR,LPDWORD);
1156 #define WSAGetServiceClassNameByClassId WINELIB_NAME_AW(WSAGetServiceClassNameByClassId)
1157 WINSOCK_API_LINKAGE int WINAPI WSAHtonl(SOCKET,ULONG,ULONG*);
1158 WINSOCK_API_LINKAGE int WINAPI WSAHtons(SOCKET,WS(u_short),WS(u_short)*);
1159 WINSOCK_API_LINKAGE int WINAPI WSAInstallServiceClassA(LPWSASERVICECLASSINFOA);
1160 WINSOCK_API_LINKAGE int WINAPI WSAInstallServiceClassW(LPWSASERVICECLASSINFOW);
1161 #define WSAInstallServiceClass WINELIB_NAME_AW(WSAInstallServiceClass)
1162 WINSOCK_API_LINKAGE int WINAPI WSAIoctl(SOCKET,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1163 WINSOCK_API_LINKAGE BOOL WINAPI WSAIsBlocking(void);
1164 WINSOCK_API_LINKAGE SOCKET WINAPI WSAJoinLeaf(SOCKET,const struct WS(sockaddr)*,int,LPWSABUF,LPWSABUF,LPQOS,LPQOS,DWORD);
1165 WINSOCK_API_LINKAGE INT WINAPI WSALookupServiceBeginA(LPWSAQUERYSETA,DWORD,LPHANDLE);
1166 WINSOCK_API_LINKAGE INT WINAPI WSALookupServiceBeginW(LPWSAQUERYSETW,DWORD,LPHANDLE);
1167 #define WSALookupServiceBegin WINELIB_NAME_AW(WSALookupServiceBegin)
1168 WINSOCK_API_LINKAGE INT WINAPI WSALookupServiceEnd(HANDLE);
1169 WINSOCK_API_LINKAGE INT WINAPI WSALookupServiceNextA(HANDLE,DWORD,LPDWORD,LPWSAQUERYSETA);
1170 WINSOCK_API_LINKAGE INT WINAPI WSALookupServiceNextW(HANDLE,DWORD,LPDWORD,LPWSAQUERYSETW);
1171 #define WSALookupServiceNext WINELIB_NAME_AW(WSALookupServiceNext)
1172 WINSOCK_API_LINKAGE int WINAPI WSANSPIoctl(HANDLE,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPWSACOMPLETION);
1173 WINSOCK_API_LINKAGE int WINAPI WSANtohl(SOCKET,ULONG,ULONG*);
1174 WINSOCK_API_LINKAGE int WINAPI WSANtohs(SOCKET,WS(u_short),WS(u_short)*);
1175 WINSOCK_API_LINKAGE int WINAPI WSAPoll(WSAPOLLFD*,ULONG,int);
1176 WINSOCK_API_LINKAGE INT WINAPI WSAProviderConfigChange(LPHANDLE,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1177 WINSOCK_API_LINKAGE int WINAPI WSARecv(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1178 WINSOCK_API_LINKAGE int WINAPI WSARecvDisconnect(SOCKET,LPWSABUF);
1179 WINSOCK_API_LINKAGE int WINAPI WSARecvFrom(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,struct WS(sockaddr)*,LPINT,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1180 WINSOCK_API_LINKAGE INT WINAPI WSARemoveServiceClass(LPGUID);
1181 WINSOCK_API_LINKAGE BOOL WINAPI WSAResetEvent(WSAEVENT);
1182 WINSOCK_API_LINKAGE int WINAPI WSASend(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1183 WINSOCK_API_LINKAGE int WINAPI WSASendDisconnect(SOCKET,LPWSABUF);
1184 WINSOCK_API_LINKAGE int WINAPI WSASendTo(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,const struct WS(sockaddr)*,int,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1185 WINSOCK_API_LINKAGE FARPROC WINAPI WSASetBlockingHook(FARPROC);
1186 WINSOCK_API_LINKAGE BOOL WINAPI WSASetEvent(WSAEVENT);
1187 WINSOCK_API_LINKAGE void WINAPI WSASetLastError(int);
1188 WINSOCK_API_LINKAGE INT WINAPI WSASetServiceA(LPWSAQUERYSETA,WSAESETSERVICEOP,DWORD);
1189 WINSOCK_API_LINKAGE INT WINAPI WSASetServiceW(LPWSAQUERYSETW,WSAESETSERVICEOP,DWORD);
1190 #define WSASetService WINELIB_NAME_AW(WSASetService)
1191 WINSOCK_API_LINKAGE SOCKET WINAPI WSASocketA(int,int,int,LPWSAPROTOCOL_INFOA,GROUP,DWORD);
1192 WINSOCK_API_LINKAGE SOCKET WINAPI WSASocketW(int,int,int,LPWSAPROTOCOL_INFOW,GROUP,DWORD);
1193 #define WSASocket WINELIB_NAME_AW(WSASocket)
1194 WINSOCK_API_LINKAGE int WINAPI WSAStartup(WORD,WSADATA*);
1195 WINSOCK_API_LINKAGE INT WINAPI WSAStringToAddressA(LPSTR,INT,LPWSAPROTOCOL_INFOA,LPSOCKADDR,LPINT);
1196 WINSOCK_API_LINKAGE INT WINAPI WSAStringToAddressW(LPWSTR,INT,LPWSAPROTOCOL_INFOW,LPSOCKADDR,LPINT);
1197 #define WSAStringToAddress WINELIB_NAME_AW(WSAStringToAddress)
1198 WINSOCK_API_LINKAGE int WINAPI WSAUnhookBlockingHook(void);
1199 WINSOCK_API_LINKAGE DWORD WINAPI WSAWaitForMultipleEvents(DWORD,const WSAEVENT*,BOOL,DWORD,BOOL);
1200 #endif /* WS_API_PROTOTYPES */
1205 * Winsock2 Function Typedefs
1207 * Remember to keep this section in sync with the
1208 * "Winsock2 Prototypes" section above.
1210 #if WS_API_TYPEDEFS
1211 typedef SOCKET (WINAPI *LPFN_WSAACCEPT)(SOCKET,struct WS(sockaddr)*,LPINT,LPCONDITIONPROC,DWORD_PTR);
1212 typedef INT (WINAPI *LPFN_WSAADDRESSTOSTRINGA)(LPSOCKADDR,DWORD,LPWSAPROTOCOL_INFOA,LPSTR,LPDWORD);
1213 typedef INT (WINAPI *LPFN_WSAADDRESSTOSTRINGW)(LPSOCKADDR,DWORD,LPWSAPROTOCOL_INFOW,LPWSTR,LPDWORD);
1214 #define LPFN_WSAADDRESSTOSTRING WINELIB_NAME_AW(LPFN_WSAADDRESSTOSTRING)
1215 typedef BOOL (WINAPI *LPFN_WSACLOSEEVENT)(WSAEVENT);
1216 typedef int (WINAPI *LPFN_WSACONNECT)(SOCKET,const struct WS(sockaddr)*,int,LPWSABUF,LPWSABUF,LPQOS,LPQOS);
1217 typedef WSAEVENT (WINAPI *LPFN_WSACREATEEVENT)(void);
1218 typedef INT (WINAPI *LPFN_WSADUPLICATESOCKETA)(SOCKET,DWORD,LPWSAPROTOCOL_INFOA);
1219 typedef INT (WINAPI *LPFN_WSADUPLICATESOCKETW)(SOCKET,DWORD,LPWSAPROTOCOL_INFOW);
1220 #define LPFN_WSADUPLICATESOCKET WINELIB_NAME_AW(LPFN_WSADUPLICATESOCKET)
1221 typedef INT (WINAPI *LPFN_WSAENUMNAMESPACEPROVIDERSA)(LPDWORD,LPWSANAMESPACE_INFOA);
1222 typedef INT (WINAPI *LPFN_WSAENUMNAMESPACEPROVIDERSW)(LPDWORD,LPWSANAMESPACE_INFOW);
1223 #define LPFN_WSAENUMNAMESPACEPROVIDERS WINELIB_NAME_AW(LPFN_WSAENUMNAMESPACEPROVIDERS)
1224 typedef int (WINAPI *LPFN_WSAENUMNETWORKEVENTS)(SOCKET,WSAEVENT,LPWSANETWORKEVENTS);
1225 typedef int (WINAPI *LPFN_WSAENUMPROTOCOLSA)(LPINT,LPWSAPROTOCOL_INFOA,LPDWORD);
1226 typedef int (WINAPI *LPFN_WSAENUMPROTOCOLSW)(LPINT,LPWSAPROTOCOL_INFOW,LPDWORD);
1227 #define LPFN_WSAENUMPROTOCOLS WINELIB_NAME_AW(LPFN_WSAENUMPROTOCOLS)
1228 typedef int (WINAPI *LPFN_WSAEVENTSELECT)(SOCKET,WSAEVENT,LONG);
1229 typedef BOOL (WINAPI *LPFN_WSAGETOVERLAPPEDRESULT)(SOCKET,LPWSAOVERLAPPED,LPDWORD,BOOL,LPDWORD);
1230 typedef BOOL (WINAPI *LPFN_WSAGETQOSBYNAME)(SOCKET,LPWSABUF,LPQOS);
1231 typedef INT (WINAPI *LPFN_WSAGETSERVICECLASSINFOA)(LPGUID,LPGUID,LPDWORD,LPWSASERVICECLASSINFOA);
1232 typedef INT (WINAPI *LPFN_WSAGETSERVICECLASSINFOW)(LPGUID,LPGUID,LPDWORD,LPWSASERVICECLASSINFOW);
1233 #define LPFN_LPFNWSAGETSERVICECLASSINFO WINELIB_NAME_AW(LPFN_LPFNWSAGETSERVICECLASSINFO)
1234 typedef INT (WINAPI *LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA)(LPGUID,LPSTR,LPDWORD);
1235 typedef INT (WINAPI *LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW)(LPGUID,LPWSTR,LPDWORD);
1236 #define LPFN_WSAGETSERVICECLASSNAMEBYCLASSID WINELIB_NAME_AW(LPFN_WSAGETSERVICECLASSNAMEBYCLASSID)
1237 typedef int (WINAPI *LPFN_WSAHTONL)(SOCKET,ULONG,ULONG*);
1238 typedef int (WINAPI *LPFN_WSAHTONS)(SOCKET,WS(u_short),WS(u_short)*);
1239 typedef int (WINAPI *LPFN_WSAINSTALLSERVICECLASSA)(LPWSASERVICECLASSINFOA);
1240 typedef int (WINAPI *LPFN_WSAINSTALLSERVICECLASSW)(LPWSASERVICECLASSINFOW);
1241 typedef int (WINAPI *LPFN_WSAIOCTL)(SOCKET,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1242 typedef int (WINAPI *LPFN_WSAJOINLEAF)(SOCKET,const struct WS(sockaddr)*,int,LPWSABUF,LPWSABUF,LPQOS,LPQOS,DWORD);
1243 typedef INT (WINAPI *LPFN_WSALOOKUPSERVICEBEGINA)(LPWSAQUERYSETA,DWORD,LPHANDLE);
1244 typedef INT (WINAPI *LPFN_WSALOOKUPSERVICEBEGINW)(LPWSAQUERYSETW,DWORD,LPHANDLE);
1245 #define LPFN_WSALOOKUPSERVICEBEGIN WINELIB_NAME_AW(LPFN_WSALOOKUPSERVICEBEGIN)
1246 typedef INT (WINAPI *LPFN_WSALOOKUPSERVICEEND)(HANDLE);
1247 typedef INT (WINAPI *LPFN_WSALOOKUPSERVICENEXTA)(HANDLE,DWORD,LPDWORD,LPWSAQUERYSETA);
1248 typedef INT (WINAPI *LPFN_WSALOOKUPSERVICENEXTW)(HANDLE,DWORD,LPDWORD,LPWSAQUERYSETW);
1249 #define LPFN_WSALOOKUPSERVICENEXT WINELIB_NAME_AW(LPFN_WSALOOKUPSERVICENEXT)
1250 typedef int (WINAPI *LPFN_WSANSPIOCTL)(HANDLE,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPWSACOMPLETION);
1251 typedef int (WINAPI *LPFN_WSANTOHL)(SOCKET,ULONG,ULONG*);
1252 typedef int (WINAPI *LPFN_WSANTOHS)(SOCKET,WS(u_short),WS(u_short)*);
1253 typedef INT (WINAPI *LPFN_WSAPROVIDERCONFIGCHANGE)(LPHANDLE,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1254 typedef int (WINAPI *LPFN_WSAPOLL)(WSAPOLLFD*,ULONG,int);
1255 typedef int (WINAPI *LPFN_WSARECV)(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1256 typedef int (WINAPI *LPFN_WSARECVDISCONNECT)(SOCKET,LPWSABUF);
1257 typedef int (WINAPI *LPFN_WSARECVFROM)(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,struct WS(sockaddr)*,LPINT,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1258 typedef INT (WINAPI *LPFN_WSAREMOVESERVICECLASS)(LPGUID);
1259 typedef BOOL (WINAPI *LPFN_WSARESETEVENT)(WSAEVENT);
1260 typedef int (WINAPI *LPFN_WSASEND)(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1261 typedef int (WINAPI *LPFN_WSASENDDISCONNECT)(SOCKET,LPWSABUF);
1262 typedef int (WINAPI *LPFN_WSASENDTO)(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,const struct WS(sockaddr)*,int,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1263 typedef BOOL (WINAPI *LPFN_WSASETEVENT)(WSAEVENT);
1264 typedef INT (WINAPI *LPFN_WSASETSERVICEA)(LPWSAQUERYSETA,WSAESETSERVICEOP,DWORD);
1265 typedef INT (WINAPI *LPFN_WSASETSERVICEW)(LPWSAQUERYSETW,WSAESETSERVICEOP,DWORD);
1266 #define LPFN_WSASETSERVICE WINELIB_NAME_AW(LPFN_WSASETSERVICE)
1267 typedef SOCKET (WINAPI *LPFN_WSASOCKETA)(int,int,int,LPWSAPROTOCOL_INFOA,GROUP,DWORD);
1268 typedef SOCKET (WINAPI *LPFN_WSASOCKETW)(int,int,int,LPWSAPROTOCOL_INFOW,GROUP,DWORD);
1269 typedef INT (WINAPI *LPFN_WSASTRINGTOADDRESSA)(LPSTR,INT,LPWSAPROTOCOL_INFOA,LPSOCKADDR,LPINT);
1270 typedef INT (WINAPI *LPFN_WSASTRINGTOADDRESSW)(LPSTR,INT,LPWSAPROTOCOL_INFOA,LPSOCKADDR,LPINT);
1271 #define LPFN_WSASOCKET WINELIB_NAME_AW(LPFN_WSASOCKET)
1272 #define LPFN_WSASTRINGTOADDRESS WINELIB_NAME_AW(LPFN_WSASTRINGTOADDRESS)
1273 typedef DWORD (WINAPI *LPFN_WSAWAITFORMULTIPLEEVENTS)(DWORD,const WSAEVENT*,BOOL,DWORD,BOOL);
1274 #endif /* WS_API_TYPEDEFS */
1277 /* Condition function return values */
1278 #define CF_ACCEPT 0x0000
1279 #define CF_REJECT 0x0001
1280 #define CF_DEFER 0x0002
1282 #ifdef __cplusplus
1284 #endif
1286 #undef WS
1287 #undef WS_API_PROTOTYPES
1288 #undef WS_API_TYPEDEFS
1290 #endif /* __WINSOCK2API__ */