4a42a279a819fe0eeeed89c4023cd065d6f41935
[reactos.git] / include / psdk / winsock2.h
1 /*
2
3 Definitions for winsock 2
4
5 Initially taken from the Wine project.
6
7 Portions Copyright (c) 1980, 1983, 1988, 1993
8 The Regents of the University of California. All rights reserved.
9
10 Portions Copyright (c) 1993 by Digital Equipment Corporation.
11 */
12
13 #if !(defined _WINSOCK2_H || defined _WINSOCK_H)
14 #define _WINSOCK2_H
15 #define _WINSOCK_H /* to prevent later inclusion of winsock.h */
16
17 #define _GNU_H_WINDOWS32_SOCKETS
18
19 #ifndef _M_AMD64
20 #if !defined(__ROS_LONG64__)
21 #ifdef __WINESRC__
22 #define __ROS_LONG64__
23 #endif
24 #endif
25 #endif
26
27 #include <windows.h>
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 #ifdef _MSC_VER
33 #pragma warning(push)
34 #pragma warning(disable:4820)
35 #endif
36 /* Names common to Winsock1.1 and Winsock2 */
37 #if !defined ( _BSDTYPES_DEFINED )
38 /* also defined in gmon.h and in cygwin's sys/types */
39 typedef unsigned char u_char;
40 typedef unsigned short u_short;
41 typedef unsigned int u_int;
42 #ifndef __ROS_LONG64__
43 typedef unsigned long u_long;
44 #else
45 typedef unsigned int u_long;
46 #endif
47 #define _BSDTYPES_DEFINED
48 #endif /* ! def _BSDTYPES_DEFINED */
49 typedef UINT_PTR SOCKET;
50 #ifndef FD_SETSIZE
51 #define FD_SETSIZE 64
52 #endif
53
54 #define WSAAPI WINAPI
55
56 /* shutdown() how types */
57 #define SD_RECEIVE 0x00
58 #define SD_SEND 0x01
59 #define SD_BOTH 0x02
60
61 #ifndef _SYS_TYPES_FD_SET
62 /* fd_set may be defined by the newlib <sys/types.h>
63 * if __USE_W32_SOCKETS not defined.
64 */
65 #ifdef fd_set
66 #undef fd_set
67 #endif
68 typedef struct fd_set {
69 u_int fd_count;
70 SOCKET fd_array[FD_SETSIZE];
71 } fd_set;
72 int PASCAL __WSAFDIsSet(SOCKET,fd_set*);
73 #ifndef FD_CLR
74 #define FD_CLR(fd,set) do { u_int __i;\
75 for (__i = 0; __i < ((fd_set *)(set))->fd_count ; __i++) {\
76 if (((fd_set *)(set))->fd_array[__i] == (fd)) {\
77 while (__i < ((fd_set *)(set))->fd_count-1) {\
78 ((fd_set*)(set))->fd_array[__i] = ((fd_set*)(set))->fd_array[__i+1];\
79 __i++;\
80 }\
81 ((fd_set*)(set))->fd_count--;\
82 break;\
83 }\
84 }\
85 } while (0)
86 #endif
87 #ifndef FD_SET
88 /* this differs from the define in winsock.h and in cygwin sys/types.h */
89 #define FD_SET(fd, set) do { u_int __i;\
90 for (__i = 0; __i < ((fd_set *)(set))->fd_count ; __i++) {\
91 if (((fd_set *)(set))->fd_array[__i] == (fd)) {\
92 break;\
93 }\
94 }\
95 if (__i == ((fd_set *)(set))->fd_count) {\
96 if (((fd_set *)(set))->fd_count < FD_SETSIZE) {\
97 ((fd_set *)(set))->fd_array[__i] = (fd);\
98 ((fd_set *)(set))->fd_count++;\
99 }\
100 }\
101 } while(0)
102 #endif
103 #ifndef FD_ZERO
104 #define FD_ZERO(set) (((fd_set *)(set))->fd_count=0)
105 #endif
106 #ifndef FD_ISSET
107 #define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (fd_set *)(set))
108 #endif
109 #elif !defined (USE_SYS_TYPES_FD_SET)
110 #warning "fd_set and associated macros have been defined in sys/types. \
111 This may cause runtime problems with W32 sockets"
112 #endif /* ndef _SYS_TYPES_FD_SET */
113 #if !(defined (__INSIDE_CYGWIN__) || (defined (__INSIDE_MSYS__) && (__INSIDE_MSYS__)))
114 #ifndef _TIMEVAL_DEFINED
115 /* also in sys/time.h */
116 #define _TIMEVAL_DEFINED
117 #define _STRUCT_TIMEVAL
118 struct timeval {
119 LONG tv_sec;
120 LONG tv_usec;
121 };
122 #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
123 #define timercmp(tvp, uvp, cmp) \
124 (((tvp)->tv_sec != (uvp)->tv_sec) ? \
125 ((tvp)->tv_sec cmp (uvp)->tv_sec) : \
126 ((tvp)->tv_usec cmp (uvp)->tv_usec))
127 #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
128 #endif /* _TIMEVAL_DEFINED */
129 struct hostent {
130 char *h_name;
131 char **h_aliases;
132 short h_addrtype;
133 short h_length;
134 char **h_addr_list;
135 #define h_addr h_addr_list[0]
136 };
137 struct linger {
138 u_short l_onoff;
139 u_short l_linger;
140 };
141 #endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
142 #define IOCPARM_MASK 0x7f
143 #define IOC_VOID 0x20000000
144 #define IOC_OUT 0x40000000
145 #define IOC_IN 0x80000000
146 #define IOC_INOUT (IOC_IN|IOC_OUT)
147
148 #if ! (defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
149 #define _IO(x,y) (IOC_VOID|((x)<<8)|(y))
150 #define _IOR(x,y,t) (IOC_OUT|(((LONG)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
151 #define _IOW(x,y,t) (IOC_IN|(((LONG)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
152 #define FIONBIO _IOW('f', 126, u_long)
153 #endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
154
155 #define FIONREAD _IOR('f', 127, u_long)
156 #define FIOASYNC _IOW('f', 125, u_long)
157 #define SIOCSHIWAT _IOW('s', 0, u_long)
158 #define SIOCGHIWAT _IOR('s', 1, u_long)
159 #define SIOCSLOWAT _IOW('s', 2, u_long)
160 #define SIOCGLOWAT _IOR('s', 3, u_long)
161 #define SIOCATMARK _IOR('s', 7, u_long)
162
163 #if ! (defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
164 struct netent {
165 char * n_name;
166 char **n_aliases;
167 short n_addrtype;
168 u_long n_net;
169 };
170 struct servent {
171 char *s_name;
172 char **s_aliases;
173 short s_port;
174 char *s_proto;
175 };
176 struct protoent {
177 char *p_name;
178 char **p_aliases;
179 short p_proto;
180 };
181 #endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
182
183 #define IPPROTO_IP 0
184 #define IPPROTO_ICMP 1
185 #define IPPROTO_IGMP 2
186 #define IPPROTO_GGP 3
187 #define IPPROTO_TCP 6
188 #define IPPROTO_PUP 12
189 #define IPPROTO_UDP 17
190 #define IPPROTO_IDP 22
191 #define IPPROTO_ND 77
192 #define IPPROTO_RAW 255
193 #define IPPROTO_MAX 256
194 /* IPv6 options */
195 #define IPPROTO_HOPOPTS 0 /* IPv6 Hop-by-Hop options */
196 #define IPPROTO_IPV6 41 /* IPv6 header */
197 #define IPPROTO_ROUTING 43 /* IPv6 Routing header */
198 #define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */
199 #define IPPROTO_ESP 50 /* encapsulating security payload */
200 #define IPPROTO_AH 51 /* authentication header */
201 #define IPPROTO_ICMPV6 58 /* ICMPv6 */
202 #define IPPROTO_NONE 59 /* IPv6 no next header */
203 #define IPPROTO_DSTOPTS 60 /* IPv6 Destination options */
204 #define IPPORT_ECHO 7
205 #define IPPORT_DISCARD 9
206 #define IPPORT_SYSTAT 11
207 #define IPPORT_DAYTIME 13
208 #define IPPORT_NETSTAT 15
209 #define IPPORT_FTP 21
210 #define IPPORT_TELNET 23
211 #define IPPORT_SMTP 25
212 #define IPPORT_TIMESERVER 37
213 #define IPPORT_NAMESERVER 42
214 #define IPPORT_WHOIS 43
215 #define IPPORT_MTP 57
216 #define IPPORT_TFTP 69
217 #define IPPORT_RJE 77
218 #define IPPORT_FINGER 79
219 #define IPPORT_TTYLINK 87
220 #define IPPORT_SUPDUP 95
221 #define IPPORT_EXECSERVER 512
222 #define IPPORT_LOGINSERVER 513
223 #define IPPORT_CMDSERVER 514
224 #define IPPORT_EFSSERVER 520
225 #define IPPORT_BIFFUDP 512
226 #define IPPORT_WHOSERVER 513
227 #define IPPORT_ROUTESERVER 520
228 #define IPPORT_RESERVED 1024
229 #define IMPLINK_IP 155
230 #define IMPLINK_LOWEXPER 156
231 #define IMPLINK_HIGHEXPER 158
232 #ifndef s_addr
233 typedef struct in_addr {
234 union {
235 struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b;
236 struct { u_short s_w1,s_w2; } S_un_w;
237 u_long S_addr;
238 } S_un;
239 #define s_addr S_un.S_addr
240 #define s_host S_un.S_un_b.s_b2
241 #define s_net S_un.S_un_b.s_b1
242 #define s_imp S_un.S_un_w.s_w2
243 #define s_impno S_un.S_un_b.s_b4
244 #define s_lh S_un.S_un_b.s_b3
245 } IN_ADDR, *PIN_ADDR;
246 #endif
247 #define IN_CLASSA(i) ((LONG)(i)&0x80000000)
248 #define IN_CLASSA_NET 0xff000000
249 #define IN_CLASSA_NSHIFT 24
250 #define IN_CLASSA_HOST 0x00ffffff
251 #define IN_CLASSA_MAX 128
252 #define IN_CLASSB(i) (((LONG)(i)&0xc0000000)==0x80000000)
253 #define IN_CLASSB_NET 0xffff0000
254 #define IN_CLASSB_NSHIFT 16
255 #define IN_CLASSB_HOST 0x0000ffff
256 #define IN_CLASSB_MAX 65536
257 #define IN_CLASSC(i) (((LONG)(i)&0xe0000000)==0xc0000000)
258 #define IN_CLASSC_NET 0xffffff00
259 #define IN_CLASSC_NSHIFT 8
260 #define IN_CLASSC_HOST 0xff
261 #define INADDR_ANY (u_long)0
262 #define INADDR_LOOPBACK 0x7f000001
263 #define INADDR_BROADCAST (u_long)0xffffffff
264 #define INADDR_NONE 0xffffffff
265 struct sockaddr_in {
266 short sin_family;
267 u_short sin_port;
268 struct in_addr sin_addr;
269 char sin_zero[8];
270 };
271 #define WSADESCRIPTION_LEN 256
272 #define WSASYS_STATUS_LEN 128
273 typedef struct WSAData {
274 WORD wVersion;
275 WORD wHighVersion;
276 char szDescription[WSADESCRIPTION_LEN+1];
277 char szSystemStatus[WSASYS_STATUS_LEN+1];
278 unsigned short iMaxSockets;
279 unsigned short iMaxUdpDg;
280 char * lpVendorInfo;
281 } WSADATA;
282 typedef WSADATA *LPWSADATA;
283
284 #if ! (defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
285 #define IP_OPTIONS 1
286 #define SO_DEBUG 1
287 #define SO_ACCEPTCONN 2
288 #define SO_REUSEADDR 4
289 #define SO_KEEPALIVE 8
290 #define SO_DONTROUTE 16
291 #define SO_BROADCAST 32
292 #define SO_USELOOPBACK 64
293 #define SO_LINGER 128
294 #define SO_OOBINLINE 256
295 #define SO_DONTLINGER (u_int)(~SO_LINGER)
296 #define SO_EXCLUSIVEADDRUSE ((u_int)(~SO_REUSEADDR))
297 #define SO_SNDBUF 0x1001
298 #define SO_RCVBUF 0x1002
299 #define SO_SNDLOWAT 0x1003
300 #define SO_RCVLOWAT 0x1004
301 #define SO_SNDTIMEO 0x1005
302 #define SO_RCVTIMEO 0x1006
303 #define SO_ERROR 0x1007
304 #define SO_TYPE 0x1008
305 #define SO_CONDITIONAL_ACCEPT 0x3002
306 #endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
307
308 #define INVALID_SOCKET (SOCKET)(~0)
309 #define SOCKET_ERROR (-1)
310 #define SOCK_STREAM 1
311 #define SOCK_DGRAM 2
312 #define SOCK_RAW 3
313 #define SOCK_RDM 4
314 #define SOCK_SEQPACKET 5
315 #define TCP_NODELAY 0x0001
316 #define AF_UNSPEC 0
317 #define AF_UNIX 1
318 #define AF_INET 2
319 #define AF_IMPLINK 3
320 #define AF_PUP 4
321 #define AF_CHAOS 5
322 #define AF_IPX 6
323 #define AF_NS 6
324 #define AF_ISO 7
325 #define AF_OSI AF_ISO
326 #define AF_ECMA 8
327 #define AF_DATAKIT 9
328 #define AF_CCITT 10
329 #define AF_SNA 11
330 #define AF_DECnet 12
331 #define AF_DLI 13
332 #define AF_LAT 14
333 #define AF_HYLINK 15
334 #define AF_APPLETALK 16
335 #define AF_NETBIOS 17
336 #define AF_VOICEVIEW 18
337 #define AF_FIREFOX 19
338 #define AF_UNKNOWN1 20
339 #define AF_BAN 21
340 #define AF_ATM 22
341 #define AF_INET6 23
342 #define AF_CLUSTER 24
343 #define AF_12844 25
344 #define AF_IRDA 26
345 #define AF_NETDES 28
346 #if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
347 #define AF_MAX 29
348 struct sockaddr {
349 u_short sa_family;
350 char sa_data[14];
351 };
352 #endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
353
354 /* Portable IPv6/IPv4 version of sockaddr.
355 Uses padding to force 8 byte alignment
356 and maximum size of 128 bytes */
357 struct sockaddr_storage {
358 short ss_family;
359 char __ss_pad1[6]; /* pad to 8 */
360 __int64 __ss_align; /* force alignment */
361 char __ss_pad2[112]; /* pad to 128 */
362 };
363
364 struct sockproto {
365 u_short sp_family;
366 u_short sp_protocol;
367 };
368 #define PF_UNSPEC AF_UNSPEC
369 #define PF_UNIX AF_UNIX
370 #define PF_INET AF_INET
371 #define PF_IMPLINK AF_IMPLINK
372 #define PF_PUP AF_PUP
373 #define PF_CHAOS AF_CHAOS
374 #define PF_NS AF_NS
375 #define PF_IPX AF_IPX
376 #define PF_ISO AF_ISO
377 #define PF_OSI AF_OSI
378 #define PF_ECMA AF_ECMA
379 #define PF_DATAKIT AF_DATAKIT
380 #define PF_CCITT AF_CCITT
381 #define PF_SNA AF_SNA
382 #define PF_DECnet AF_DECnet
383 #define PF_DLI AF_DLI
384 #define PF_LAT AF_LAT
385 #define PF_HYLINK AF_HYLINK
386 #define PF_APPLETALK AF_APPLETALK
387 #define PF_VOICEVIEW AF_VOICEVIEW
388 #define PF_FIREFOX AF_FIREFOX
389 #define PF_UNKNOWN1 AF_UNKNOWN1
390 #define PF_BAN AF_BAN
391 #define PF_ATM AF_ATM
392 #define PF_INET6 AF_INET6
393 #define PF_MAX AF_MAX
394 #define SOL_SOCKET 0xffff
395 #if ! (defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
396 #define SOMAXCONN 0x7fffffff /* (5) in WinSock1.1 */
397 #define MSG_OOB 1
398 #define MSG_PEEK 2
399 #define MSG_DONTROUTE 4
400 #define MSG_WAITALL 8
401 #endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
402 #define MSG_MAXIOVLEN 16
403 #define MSG_PARTIAL 0x8000
404 #define MAXGETHOSTSTRUCT 1024
405
406 #define FD_READ_BIT 0
407 #define FD_READ (1 << FD_READ_BIT)
408 #define FD_WRITE_BIT 1
409 #define FD_WRITE (1 << FD_WRITE_BIT)
410 #define FD_OOB_BIT 2
411 #define FD_OOB (1 << FD_OOB_BIT)
412 #define FD_ACCEPT_BIT 3
413 #define FD_ACCEPT (1 << FD_ACCEPT_BIT)
414 #define FD_CONNECT_BIT 4
415 #define FD_CONNECT (1 << FD_CONNECT_BIT)
416 #define FD_CLOSE_BIT 5
417 #define FD_CLOSE (1 << FD_CLOSE_BIT)
418 /* winsock1.1 defines stop at FD_CLOSE (32) */
419 #define FD_QOS_BIT 6
420 #define FD_QOS (1 << FD_QOS_BIT)
421 #define FD_GROUP_QOS_BIT 7
422 #define FD_GROUP_QOS (1 << FD_GROUP_QOS_BIT)
423 #define FD_ROUTING_INTERFACE_CHANGE_BIT 8
424 #define FD_ROUTING_INTERFACE_CHANGE (1 << FD_ROUTING_INTERFACE_CHANGE_BIT)
425 #define FD_ADDRESS_LIST_CHANGE_BIT 9
426 #define FD_ADDRESS_LIST_CHANGE (1 << FD_ADDRESS_LIST_CHANGE_BIT)
427 #define FD_MAX_EVENTS 10
428 #define FD_ALL_EVENTS ((1 << FD_MAX_EVENTS) - 1)
429
430 #ifndef WSABASEERR
431 #define WSABASEERR 10000
432 #define WSAEINTR (WSABASEERR+4)
433 #define WSAEBADF (WSABASEERR+9)
434 #define WSAEACCES (WSABASEERR+13)
435 #define WSAEFAULT (WSABASEERR+14)
436 #define WSAEINVAL (WSABASEERR+22)
437 #define WSAEMFILE (WSABASEERR+24)
438 #define WSAEWOULDBLOCK (WSABASEERR+35)
439 #define WSAEINPROGRESS (WSABASEERR+36) /* deprecated on WinSock2 */
440 #define WSAEALREADY (WSABASEERR+37)
441 #define WSAENOTSOCK (WSABASEERR+38)
442 #define WSAEDESTADDRREQ (WSABASEERR+39)
443 #define WSAEMSGSIZE (WSABASEERR+40)
444 #define WSAEPROTOTYPE (WSABASEERR+41)
445 #define WSAENOPROTOOPT (WSABASEERR+42)
446 #define WSAEPROTONOSUPPORT (WSABASEERR+43)
447 #define WSAESOCKTNOSUPPORT (WSABASEERR+44)
448 #define WSAEOPNOTSUPP (WSABASEERR+45)
449 #define WSAEPFNOSUPPORT (WSABASEERR+46)
450 #define WSAEAFNOSUPPORT (WSABASEERR+47)
451 #define WSAEADDRINUSE (WSABASEERR+48)
452 #define WSAEADDRNOTAVAIL (WSABASEERR+49)
453 #define WSAENETDOWN (WSABASEERR+50)
454 #define WSAENETUNREACH (WSABASEERR+51)
455 #define WSAENETRESET (WSABASEERR+52)
456 #define WSAECONNABORTED (WSABASEERR+53)
457 #define WSAECONNRESET (WSABASEERR+54)
458 #define WSAENOBUFS (WSABASEERR+55)
459 #define WSAEISCONN (WSABASEERR+56)
460 #define WSAENOTCONN (WSABASEERR+57)
461 #define WSAESHUTDOWN (WSABASEERR+58)
462 #define WSAETOOMANYREFS (WSABASEERR+59)
463 #define WSAETIMEDOUT (WSABASEERR+60)
464 #define WSAECONNREFUSED (WSABASEERR+61)
465 #define WSAELOOP (WSABASEERR+62)
466 #define WSAENAMETOOLONG (WSABASEERR+63)
467 #define WSAEHOSTDOWN (WSABASEERR+64)
468 #define WSAEHOSTUNREACH (WSABASEERR+65)
469 #define WSAENOTEMPTY (WSABASEERR+66)
470 #define WSAEPROCLIM (WSABASEERR+67)
471 #define WSAEUSERS (WSABASEERR+68)
472 #define WSAEDQUOT (WSABASEERR+69)
473 #define WSAESTALE (WSABASEERR+70)
474 #define WSAEREMOTE (WSABASEERR+71)
475 #define WSAEDISCON (WSABASEERR+101)
476 #define WSASYSNOTREADY (WSABASEERR+91)
477 #define WSAVERNOTSUPPORTED (WSABASEERR+92)
478 #define WSANOTINITIALISED (WSABASEERR+93)
479 #define WSAHOST_NOT_FOUND (WSABASEERR+1001)
480 #define WSATRY_AGAIN (WSABASEERR+1002)
481 #define WSANO_RECOVERY (WSABASEERR+1003)
482 #define WSANO_DATA (WSABASEERR+1004)
483
484 /* WinSock2 specific error codes */
485 #define WSAENOMORE (WSABASEERR+102)
486 #define WSAECANCELLED (WSABASEERR+103)
487 #define WSAEINVALIDPROCTABLE (WSABASEERR+104)
488 #define WSAEINVALIDPROVIDER (WSABASEERR+105)
489 #define WSAEPROVIDERFAILEDINIT (WSABASEERR+106)
490 #define WSASYSCALLFAILURE (WSABASEERR+107)
491 #define WSASERVICE_NOT_FOUND (WSABASEERR+108)
492 #define WSATYPE_NOT_FOUND (WSABASEERR+109)
493 #define WSA_E_NO_MORE (WSABASEERR+110)
494 #define WSA_E_CANCELLED (WSABASEERR+111)
495 #define WSAEREFUSED (WSABASEERR+112)
496
497 /* WS QualityofService errors */
498 #define WSA_QOS_RECEIVERS (WSABASEERR + 1005)
499 #define WSA_QOS_SENDERS (WSABASEERR + 1006)
500 #define WSA_QOS_NO_SENDERS (WSABASEERR + 1007)
501 #define WSA_QOS_NO_RECEIVERS (WSABASEERR + 1008)
502 #define WSA_QOS_REQUEST_CONFIRMED (WSABASEERR + 1009)
503 #define WSA_QOS_ADMISSION_FAILURE (WSABASEERR + 1010)
504 #define WSA_QOS_POLICY_FAILURE (WSABASEERR + 1011)
505 #define WSA_QOS_BAD_STYLE (WSABASEERR + 1012)
506 #define WSA_QOS_BAD_OBJECT (WSABASEERR + 1013)
507 #define WSA_QOS_TRAFFIC_CTRL_ERROR (WSABASEERR + 1014)
508 #define WSA_QOS_GENERIC_ERROR (WSABASEERR + 1015)
509 #define WSA_QOS_ESERVICETYPE (WSABASEERR + 1016)
510 #define WSA_QOS_EFLOWSPEC (WSABASEERR + 1017)
511 #define WSA_QOS_EPROVSPECBUF (WSABASEERR + 1018)
512 #define WSA_QOS_EFILTERSTYLE (WSABASEERR + 1019)
513 #define WSA_QOS_EFILTERTYPE (WSABASEERR + 1020)
514 #define WSA_QOS_EFILTERCOUNT (WSABASEERR + 1021)
515 #define WSA_QOS_EOBJLENGTH (WSABASEERR + 1022)
516 #define WSA_QOS_EFLOWCOUNT (WSABASEERR + 1023)
517 #define WSA_QOS_EUNKOWNPSOBJ (WSABASEERR + 1024)
518 #define WSA_QOS_EPOLICYOBJ (WSABASEERR + 1025)
519 #define WSA_QOS_EFLOWDESC (WSABASEERR + 1026)
520 #define WSA_QOS_EPSFLOWSPEC (WSABASEERR + 1027)
521 #define WSA_QOS_EPSFILTERSPEC (WSABASEERR + 1028)
522 #define WSA_QOS_ESDMODEOBJ (WSABASEERR + 1029)
523 #define WSA_QOS_ESHAPERATEOBJ (WSABASEERR + 1030)
524 #define WSA_QOS_RESERVED_PETYPE (WSABASEERR + 1031)
525
526 #endif /* !WSABASEERR */
527
528 #if !defined(NS_ALL)
529 #define NS_ALL 0
530 #define NS_SAP 1
531 #define NS_NDS 2
532 #define NS_PEER_BROWSE 3
533 #define NS_SLP 5
534 #define NS_DHCP 6
535 #define NS_TCPIP_LOCAL 10
536 #define NS_TCPIP_HOSTS 11
537 #define NS_DNS 12
538 #define NS_NETBT 13
539 #define NS_WINS 14
540 #define NS_NLA 15
541 #define NS_NBP 20
542 #define NS_MS 30
543 #define NS_STDA 31
544 #define NS_NTDS 32
545 #define NS_X500 40
546 #define NS_NIS 41
547 #define NS_NISPLUS 42
548 #define NS_WRQ 50
549 #define NS_NETDES 60
550 #endif /* !defined(NS_ALL) */
551
552 #define LUP_DEEP 0x0001
553 #define LUP_CONTAINERS 0x0002
554 #define LUP_NOCONTAINERS 0x0004
555 #define LUP_NEAREST 0x0008
556 #define LUP_RETURN_NAME 0x0010
557 #define LUP_RETURN_TYPE 0x0020
558 #define LUP_RETURN_VERSION 0x0040
559 #define LUP_RETURN_COMMENT 0x0080
560 #define LUP_RETURN_ADDR 0x0100
561 #define LUP_RETURN_BLOB 0x0200
562 #define LUP_RETURN_ALIASES 0x0400
563 #define LUP_RETURN_QUERY_STRING 0x0800
564 #define LUP_RETURN_ALL 0x0FF0
565 #define LUP_RES_SERVICE 0x8000
566 #define LUP_FLUSHCACHE 0x1000
567 #define LUP_FLUSHPREVIOUS 0x2000
568
569 #define WSANO_ADDRESS WSANO_DATA
570 #if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
571 #define h_errno WSAGetLastError()
572 #define HOST_NOT_FOUND WSAHOST_NOT_FOUND
573 #define TRY_AGAIN WSATRY_AGAIN
574 #define NO_RECOVERY WSANO_RECOVERY
575 #define NO_DATA WSANO_DATA
576 #define NO_ADDRESS WSANO_ADDRESS
577 #endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
578 SOCKET PASCAL accept(SOCKET,struct sockaddr*,int*);
579 int PASCAL bind(SOCKET,const struct sockaddr*,int);
580 int PASCAL closesocket(SOCKET);
581 int PASCAL connect(SOCKET,const struct sockaddr*,int);
582 int PASCAL ioctlsocket(SOCKET,LONG,u_long *);
583 int PASCAL getpeername(SOCKET,struct sockaddr*,int*);
584 int PASCAL getsockname(SOCKET,struct sockaddr*,int*);
585 int PASCAL getsockopt(SOCKET,int,int,char*,int*);
586 u_long PASCAL inet_addr(const char*);
587 DECLARE_STDCALL_P(char *) inet_ntoa(struct in_addr);
588 int PASCAL listen(SOCKET,int);
589 int PASCAL recv(SOCKET,char*,int,int);
590 int PASCAL recvfrom(SOCKET,char*,int,int,struct sockaddr*,int*);
591 int PASCAL send(SOCKET,const char*,int,int);
592 int PASCAL sendto(SOCKET,const char*,int,int,const struct sockaddr*,int);
593 int PASCAL setsockopt(SOCKET,int,int,const char*,int);
594 int PASCAL shutdown(SOCKET,int);
595 SOCKET PASCAL socket(int,int,int);
596 DECLARE_STDCALL_P(struct hostent *) gethostbyaddr(const char*,int,int);
597 DECLARE_STDCALL_P(struct hostent *) gethostbyname(const char*);
598 DECLARE_STDCALL_P(struct servent *) getservbyport(int,const char*);
599 DECLARE_STDCALL_P(struct servent *) getservbyname(const char*,const char*);
600 DECLARE_STDCALL_P(struct protoent *) getprotobynumber(int);
601 DECLARE_STDCALL_P(struct protoent *) getprotobyname(const char*);
602 int PASCAL WSAStartup(WORD,LPWSADATA);
603 int PASCAL WSACleanup(void);
604 void PASCAL WSASetLastError(int);
605 int PASCAL WSAGetLastError(void);
606 typedef int (WSAAPI *LPFN_WSAGETLASTERROR)(void);
607 typedef int (WSAAPI *LPFN_WSACANCELBLOCKINGCALL)(void);
608 typedef FARPROC (WSAAPI *LPFN_WSASETBLOCKINGHOOK)(FARPROC);
609 typedef int (WSAAPI *LPFN_SELECT)(int nfds,fd_set FAR*,fd_set FAR*,fd_set FAR*,const struct timeval FAR*);
610 typedef int (WSAAPI *LPFN_WSASTARTUP)(WORD,LPWSADATA);
611 typedef int (WSAAPI *LPFN_WSACLEANUP)(void);
612 typedef int (WSAAPI *LPFN_GETSOCKOPT)(SOCKET,int,int,char FAR*,int FAR*);
613 /*
614 * Pseudo-blocking functions are deprecated in WinSock2
615 * spec. Use threads instead.
616 */
617 BOOL PASCAL WSAIsBlocking(void);
618 int PASCAL WSAUnhookBlockingHook(void);
619 FARPROC PASCAL WSASetBlockingHook(FARPROC);
620 int PASCAL WSACancelBlockingCall(void);
621
622 HANDLE PASCAL WSAAsyncGetServByName(HWND,u_int,const char*,const char*,char*,int);
623 HANDLE PASCAL WSAAsyncGetServByPort(HWND,u_int,int,const char*,char*,int);
624 HANDLE PASCAL WSAAsyncGetProtoByName(HWND,u_int,const char*,char*,int);
625 HANDLE PASCAL WSAAsyncGetProtoByNumber(HWND,u_int,int,char*,int);
626 HANDLE PASCAL WSAAsyncGetHostByName(HWND,u_int,const char*,char*,int);
627 HANDLE PASCAL WSAAsyncGetHostByAddr(HWND,u_int,const char*,int,int,char*,int);
628 int PASCAL WSACancelAsyncRequest(HANDLE);
629 int PASCAL WSAAsyncSelect(SOCKET,HWND,u_int,LONG);
630 #if ! (defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
631 u_long PASCAL htonl(u_long);
632 u_long PASCAL ntohl(u_long);
633 u_short PASCAL htons(u_short);
634 u_short PASCAL ntohs(u_short);
635 #ifndef _SYS_SELECT_H /* Work around for Linux Compilers */
636 #define _SYS_SELECT_H
637 int PASCAL select(int nfds,fd_set*,fd_set*,fd_set*,const struct timeval*);
638 #endif
639 #endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
640
641 int PASCAL gethostname(char*,int);
642
643 #define WSAMAKEASYNCREPLY(b,e) MAKELONG(b,e)
644 #define WSAMAKESELECTREPLY(e,error) MAKELONG(e,error)
645 #define WSAGETASYNCBUFLEN(l) LOWORD(l)
646 #define WSAGETASYNCERROR(l) HIWORD(l)
647 #define WSAGETSELECTEVENT(l) LOWORD(l)
648 #define WSAGETSELECTERROR(l) HIWORD(l)
649
650 typedef struct sockaddr SOCKADDR;
651 typedef struct sockaddr *PSOCKADDR;
652 typedef struct sockaddr *LPSOCKADDR;
653 typedef struct sockaddr_storage SOCKADDR_STORAGE, *PSOCKADDR_STORAGE;
654 typedef struct sockaddr_in SOCKADDR_IN;
655 typedef struct sockaddr_in *PSOCKADDR_IN;
656 typedef struct sockaddr_in *LPSOCKADDR_IN;
657 typedef struct linger LINGER;
658 typedef struct linger *PLINGER;
659 typedef struct linger *LPLINGER;
660 typedef struct in_addr *LPIN_ADDR;
661 typedef struct fd_set FD_SET;
662 typedef struct fd_set *PFD_SET;
663 typedef struct fd_set *LPFD_SET;
664 typedef struct hostent HOSTENT;
665 typedef struct hostent *PHOSTENT;
666 typedef struct hostent *LPHOSTENT;
667 typedef struct servent SERVENT;
668 typedef struct servent *PSERVENT;
669 typedef struct servent *LPSERVENT;
670 typedef struct protoent PROTOENT;
671 typedef struct protoent *PPROTOENT;
672 typedef struct protoent *LPPROTOENT;
673 typedef struct timeval TIMEVAL;
674 typedef struct timeval *PTIMEVAL;
675 typedef struct timeval *LPTIMEVAL;
676
677 /* winsock2 additions */
678 #define ADDR_ANY INADDR_ANY
679
680 #define IN_CLASSD(i) (((LONG)(i) & 0xf0000000) == 0xe0000000)
681 #define IN_CLASSD_NET 0xf0000000
682 #define IN_CLASSD_NSHIFT 28
683 #define IN_CLASSD_HOST 0x0fffffff
684 #define IN_MULTICAST(i) IN_CLASSD(i)
685
686 #define FROM_PROTOCOL_INFO (-1)
687
688 #define SO_DONTLINGER (u_int)(~SO_LINGER)
689 #define SO_GROUP_ID 0x2001
690 #define SO_GROUP_PRIORITY 0x2002
691 #define SO_MAX_MSG_SIZE 0x2003
692 #define SO_PROTOCOL_INFOA 0x2004
693 #define SO_PROTOCOL_INFOW 0x2005
694 #ifdef UNICODE
695 #define SO_PROTOCOL_INFO SO_PROTOCOL_INFOW
696 #else
697 #define SO_PROTOCOL_INFO SO_PROTOCOL_INFOA
698 #endif
699 #define PVD_CONFIG 0x3001
700
701 #define MSG_INTERRUPT 0x10
702 #define MSG_MAXIOVLEN 16
703
704 #define WSAEVENT HANDLE
705 #define LPWSAEVENT LPHANDLE
706 #define WSAOVERLAPPED OVERLAPPED
707 typedef struct _OVERLAPPED *LPWSAOVERLAPPED;
708
709 #define WSA_IO_PENDING (ERROR_IO_PENDING)
710 #define WSA_IO_INCOMPLETE (ERROR_IO_INCOMPLETE)
711 #define WSA_INVALID_HANDLE (ERROR_INVALID_HANDLE)
712 #define WSA_INVALID_PARAMETER (ERROR_INVALID_PARAMETER)
713 #define WSA_NOT_ENOUGH_MEMORY (ERROR_NOT_ENOUGH_MEMORY)
714 #define WSA_OPERATION_ABORTED (ERROR_OPERATION_ABORTED)
715
716 #define WSA_INVALID_EVENT ((WSAEVENT)NULL)
717 #define WSA_MAXIMUM_WAIT_EVENTS (MAXIMUM_WAIT_OBJECTS)
718 #define WSA_WAIT_FAILED ((DWORD)-1L)
719 #define WSA_WAIT_EVENT_0 (WAIT_OBJECT_0)
720 #define WSA_WAIT_IO_COMPLETION (WAIT_IO_COMPLETION)
721 #define WSA_WAIT_TIMEOUT (WAIT_TIMEOUT)
722 #define WSA_INFINITE (INFINITE)
723
724 typedef struct _WSABUF {
725 u_long len;
726 char *buf;
727 } WSABUF, *LPWSABUF;
728
729 typedef enum
730 {
731 BestEffortService,
732 ControlledLoadService,
733 PredictiveService,
734 GuaranteedDelayService,
735 GuaranteedService
736 } GUARANTEE;
737
738 #include <qos.h>
739 typedef struct _QualityOfService
740 {
741 FLOWSPEC SendingFlowspec;
742 FLOWSPEC ReceivingFlowspec;
743 WSABUF ProviderSpecific;
744 } QOS, *LPQOS;
745
746 #define CF_ACCEPT 0x0000
747 #define CF_REJECT 0x0001
748 #define CF_DEFER 0x0002
749 #define SD_RECEIVE 0x00
750 #define SD_SEND 0x01
751 #define SD_BOTH 0x02
752 typedef unsigned int GROUP;
753
754 #define SG_UNCONSTRAINED_GROUP 0x01
755 #define SG_CONSTRAINED_GROUP 0x02
756 typedef struct _WSANETWORKEVENTS {
757 LONG lNetworkEvents;
758 int iErrorCode[FD_MAX_EVENTS];
759 } WSANETWORKEVENTS, *LPWSANETWORKEVENTS;
760
761 #define MAX_PROTOCOL_CHAIN 7
762
763 #define BASE_PROTOCOL 1
764 #define LAYERED_PROTOCOL 0
765
766 typedef enum _WSAESETSERVICEOP
767 {
768 RNRSERVICE_REGISTER=0,
769 RNRSERVICE_DEREGISTER,
770 RNRSERVICE_DELETE
771 } WSAESETSERVICEOP, *PWSAESETSERVICEOP, *LPWSAESETSERVICEOP;
772
773 typedef struct _AFPROTOCOLS {
774 INT iAddressFamily;
775 INT iProtocol;
776 } AFPROTOCOLS, *PAFPROTOCOLS, *LPAFPROTOCOLS;
777
778 typedef enum _WSAEcomparator
779 {
780 COMP_EQUAL = 0,
781 COMP_NOTLESS
782 } WSAECOMPARATOR, *PWSAECOMPARATOR, *LPWSAECOMPARATOR;
783
784 typedef struct _WSAVersion
785 {
786 DWORD dwVersion;
787 WSAECOMPARATOR ecHow;
788 } WSAVERSION, *PWSAVERSION, *LPWSAVERSION;
789
790 #ifndef __CSADDR_T_DEFINED /* also in nspapi.h */
791 #define __CSADDR_T_DEFINED
792 typedef struct _SOCKET_ADDRESS {
793 LPSOCKADDR lpSockaddr;
794 INT iSockaddrLength;
795 } SOCKET_ADDRESS,*PSOCKET_ADDRESS,*LPSOCKET_ADDRESS;
796 typedef struct _CSADDR_INFO {
797 SOCKET_ADDRESS LocalAddr;
798 SOCKET_ADDRESS RemoteAddr;
799 INT iSocketType;
800 INT iProtocol;
801 } CSADDR_INFO,*PCSADDR_INFO,*LPCSADDR_INFO;
802 #endif
803
804 typedef struct _SOCKET_ADDRESS_LIST {
805 INT iAddressCount;
806 SOCKET_ADDRESS Address[1];
807 } SOCKET_ADDRESS_LIST, * LPSOCKET_ADDRESS_LIST;
808
809 #ifndef __BLOB_T_DEFINED /* also in wtypes.h and nspapi.h */
810 #define __BLOB_T_DEFINED
811 /* wine is using a diff define */
812 #ifndef _tagBLOB_DEFINED
813 #define _tagBLOB_DEFINED
814 #define _BLOB_DEFINED
815 #define _LPBLOB_DEFINED
816
817 typedef struct _BLOB {
818 ULONG cbSize;
819 BYTE *pBlobData;
820 } BLOB,*PBLOB,*LPBLOB;
821 #endif
822 #endif
823
824 typedef struct _WSAQuerySetA
825 {
826 DWORD dwSize;
827 LPSTR lpszServiceInstanceName;
828 LPGUID lpServiceClassId;
829 LPWSAVERSION lpVersion;
830 LPSTR lpszComment;
831 DWORD dwNameSpace;
832 LPGUID lpNSProviderId;
833 LPSTR lpszContext;
834 DWORD dwNumberOfProtocols;
835 LPAFPROTOCOLS lpafpProtocols;
836 LPSTR lpszQueryString;
837 DWORD dwNumberOfCsAddrs;
838 LPCSADDR_INFO lpcsaBuffer;
839 DWORD dwOutputFlags;
840 LPBLOB lpBlob;
841 } WSAQUERYSETA, *PWSAQUERYSETA, *LPWSAQUERYSETA;
842
843 typedef struct _WSAQuerySetW
844 {
845 DWORD dwSize;
846 LPWSTR lpszServiceInstanceName;
847 LPGUID lpServiceClassId;
848 LPWSAVERSION lpVersion;
849 LPWSTR lpszComment;
850 DWORD dwNameSpace;
851 LPGUID lpNSProviderId;
852 LPWSTR lpszContext;
853 DWORD dwNumberOfProtocols;
854 LPAFPROTOCOLS lpafpProtocols;
855 LPWSTR lpszQueryString;
856 DWORD dwNumberOfCsAddrs;
857 LPCSADDR_INFO lpcsaBuffer;
858 DWORD dwOutputFlags;
859 LPBLOB lpBlob;
860 } WSAQUERYSETW, *PWSAQUERYSETW, *LPWSAQUERYSETW;
861
862 #ifdef UNICODE
863 typedef WSAQUERYSETW WSAQUERYSET;
864 typedef PWSAQUERYSETW PWSAQUERYSET;
865 typedef LPWSAQUERYSETW LPWSAQUERYSET;
866 #else
867 typedef WSAQUERYSETA WSAQUERYSET;
868 typedef PWSAQUERYSETA PWSAQUERYSET;
869 typedef LPWSAQUERYSETA LPWSAQUERYSET;
870 #endif
871
872 typedef struct _WSANSClassInfoA
873 {
874 LPSTR lpszName;
875 DWORD dwNameSpace;
876 DWORD dwValueType;
877 DWORD dwValueSize;
878 LPVOID lpValue;
879 } WSANSCLASSINFOA, *PWSANSCLASSINFOA, *LPWSANSCLASSINFOA;
880
881 typedef struct _WSANSClassInfoW
882 {
883 LPWSTR lpszName;
884 DWORD dwNameSpace;
885 DWORD dwValueType;
886 DWORD dwValueSize;
887 LPVOID lpValue;
888 } WSANSCLASSINFOW, *PWSANSCLASSINFOW, *LPWSANSCLASSINFOW;
889
890 #ifdef UNICODE
891 typedef WSANSCLASSINFOW WSANSCLASSINFO;
892 typedef PWSANSCLASSINFOW PWSANSCLASSINFO;
893 typedef LPWSANSCLASSINFOW LPWSANSCLASSINFO;
894 #else
895 typedef WSANSCLASSINFOA WSANSCLASSINFO;
896 typedef PWSANSCLASSINFOA PWSANSCLASSINFO;
897 typedef LPWSANSCLASSINFOA LPWSANSCLASSINFO;
898 #endif
899
900 typedef struct _WSAServiceClassInfoA
901 {
902 LPGUID lpServiceClassId;
903 LPSTR lpszServiceClassName;
904 DWORD dwCount;
905 LPWSANSCLASSINFOA lpClassInfos;
906 } WSASERVICECLASSINFOA, *PWSASERVICECLASSINFOA, *LPWSASERVICECLASSINFOA;
907
908 typedef struct _WSAServiceClassInfoW
909 {
910 LPGUID lpServiceClassId;
911 LPWSTR lpszServiceClassName;
912 DWORD dwCount;
913 LPWSANSCLASSINFOW lpClassInfos;
914 } WSASERVICECLASSINFOW, *PWSASERVICECLASSINFOW, *LPWSASERVICECLASSINFOW;
915
916 #ifdef UNICODE
917 typedef WSASERVICECLASSINFOW WSASERVICECLASSINFO;
918 typedef PWSASERVICECLASSINFOW PWSASERVICECLASSINFO;
919 typedef LPWSASERVICECLASSINFOW LPWSASERVICECLASSINFO;
920 #else
921 typedef WSASERVICECLASSINFOA WSASERVICECLASSINFO;
922 typedef PWSASERVICECLASSINFOA PWSASERVICECLASSINFO;
923 typedef LPWSASERVICECLASSINFOA LPWSASERVICECLASSINFO;
924 #endif
925
926 typedef struct _WSANAMESPACE_INFOA {
927 GUID NSProviderId;
928 DWORD dwNameSpace;
929 BOOL fActive;
930 DWORD dwVersion;
931 LPSTR lpszIdentifier;
932 } WSANAMESPACE_INFOA, *PWSANAMESPACE_INFOA, *LPWSANAMESPACE_INFOA;
933
934 typedef struct _WSANAMESPACE_INFOW {
935 GUID NSProviderId;
936 DWORD dwNameSpace;
937 BOOL fActive;
938 DWORD dwVersion;
939 LPWSTR lpszIdentifier;
940 } WSANAMESPACE_INFOW, *PWSANAMESPACE_INFOW, *LPWSANAMESPACE_INFOW;
941
942 #ifdef UNICODE
943 typedef WSANAMESPACE_INFOW WSANAMESPACE_INFO;
944 typedef PWSANAMESPACE_INFOW PWSANAMESPACE_INFO;
945 typedef LPWSANAMESPACE_INFOW LPWSANAMESPACE_INFO;
946 #else
947 typedef WSANAMESPACE_INFOA WSANAMESPACE_INFO;
948 typedef PWSANAMESPACE_INFOA PWSANAMESPACE_INFO;
949 typedef LPWSANAMESPACE_INFOA LPWSANAMESPACE_INFO;
950 #endif
951
952 typedef struct _WSAPROTOCOLCHAIN {
953 int ChainLen;
954 DWORD ChainEntries[MAX_PROTOCOL_CHAIN];
955 } WSAPROTOCOLCHAIN, *LPWSAPROTOCOLCHAIN;
956
957 #define WSAPROTOCOL_LEN 255
958
959 typedef struct _WSAPROTOCOL_INFOA {
960 DWORD dwServiceFlags1;
961 DWORD dwServiceFlags2;
962 DWORD dwServiceFlags3;
963 DWORD dwServiceFlags4;
964 DWORD dwProviderFlags;
965 GUID ProviderId;
966 DWORD dwCatalogEntryId;
967 WSAPROTOCOLCHAIN ProtocolChain;
968 int iVersion;
969 int iAddressFamily;
970 int iMaxSockAddr;
971 int iMinSockAddr;
972 int iSocketType;
973 int iProtocol;
974 int iProtocolMaxOffset;
975 int iNetworkByteOrder;
976 int iSecurityScheme;
977 DWORD dwMessageSize;
978 DWORD dwProviderReserved;
979 CHAR szProtocol[WSAPROTOCOL_LEN+1];
980 } WSAPROTOCOL_INFOA, *LPWSAPROTOCOL_INFOA;
981
982 typedef struct _WSAPROTOCOL_INFOW {
983 DWORD dwServiceFlags1;
984 DWORD dwServiceFlags2;
985 DWORD dwServiceFlags3;
986 DWORD dwServiceFlags4;
987 DWORD dwProviderFlags;
988 GUID ProviderId;
989 DWORD dwCatalogEntryId;
990 WSAPROTOCOLCHAIN ProtocolChain;
991 int iVersion;
992 int iAddressFamily;
993 int iMaxSockAddr;
994 int iMinSockAddr;
995 int iSocketType;
996 int iProtocol;
997 int iProtocolMaxOffset;
998 int iNetworkByteOrder;
999 int iSecurityScheme;
1000 DWORD dwMessageSize;
1001 DWORD dwProviderReserved;
1002 WCHAR szProtocol[WSAPROTOCOL_LEN+1];
1003 } WSAPROTOCOL_INFOW, * LPWSAPROTOCOL_INFOW;
1004
1005 typedef int (CALLBACK *LPCONDITIONPROC)(LPWSABUF, LPWSABUF, LPQOS, LPQOS, LPWSABUF, LPWSABUF, GROUP *, DWORD);
1006 typedef void (WINAPI *LPWSAOVERLAPPED_COMPLETION_ROUTINE)(DWORD, DWORD, LPWSAOVERLAPPED, DWORD);
1007
1008
1009 #ifdef UNICODE
1010 typedef WSAPROTOCOL_INFOW WSAPROTOCOL_INFO;
1011 typedef LPWSAPROTOCOL_INFOW LPWSAPROTOCOL_INFO;
1012 #else
1013 typedef WSAPROTOCOL_INFOA WSAPROTOCOL_INFO;
1014 typedef LPWSAPROTOCOL_INFOA LPWSAPROTOCOL_INFO;
1015 #endif
1016
1017 /* Needed for XP & .NET Server function WSANSPIoctl. */
1018 typedef enum _WSACOMPLETIONTYPE {
1019 NSP_NOTIFY_IMMEDIATELY = 0,
1020 NSP_NOTIFY_HWND,
1021 NSP_NOTIFY_EVENT,
1022 NSP_NOTIFY_PORT,
1023 NSP_NOTIFY_APC
1024 } WSACOMPLETIONTYPE, * PWSACOMPLETIONTYPE, * LPWSACOMPLETIONTYPE;
1025 typedef struct _WSACOMPLETION {
1026 WSACOMPLETIONTYPE Type;
1027 union {
1028 struct {
1029 HWND hWnd;
1030 UINT uMsg;
1031 WPARAM context;
1032 } WindowMessage;
1033 struct {
1034 LPWSAOVERLAPPED lpOverlapped;
1035 } Event;
1036 struct {
1037 LPWSAOVERLAPPED lpOverlapped;
1038 LPWSAOVERLAPPED_COMPLETION_ROUTINE lpfnCompletionProc;
1039 } Apc;
1040 struct {
1041 LPWSAOVERLAPPED lpOverlapped;
1042 HANDLE hPort;
1043 ULONG_PTR Key;
1044 } Port;
1045 } Parameters;
1046 } WSACOMPLETION, *PWSACOMPLETION, *LPWSACOMPLETION;
1047
1048 #define PFL_MULTIPLE_PROTO_ENTRIES 0x00000001
1049 #define PFL_RECOMMENDED_PROTO_ENTRY 0x00000002
1050 #define PFL_HIDDEN 0x00000004
1051 #define PFL_MATCHES_PROTOCOL_ZERO 0x00000008
1052 #define XP1_CONNECTIONLESS 0x00000001
1053 #define XP1_GUARANTEED_DELIVERY 0x00000002
1054 #define XP1_GUARANTEED_ORDER 0x00000004
1055 #define XP1_MESSAGE_ORIENTED 0x00000008
1056 #define XP1_PSEUDO_STREAM 0x00000010
1057 #define XP1_GRACEFUL_CLOSE 0x00000020
1058 #define XP1_EXPEDITED_DATA 0x00000040
1059 #define XP1_CONNECT_DATA 0x00000080
1060 #define XP1_DISCONNECT_DATA 0x00000100
1061 #define XP1_SUPPORT_BROADCAST 0x00000200
1062 #define XP1_SUPPORT_MULTIPOINT 0x00000400
1063 #define XP1_MULTIPOINT_CONTROL_PLANE 0x00000800
1064 #define XP1_MULTIPOINT_DATA_PLANE 0x00001000
1065 #define XP1_QOS_SUPPORTED 0x00002000
1066 #define XP1_INTERRUPT 0x00004000
1067 #define XP1_UNI_SEND 0x00008000
1068 #define XP1_UNI_RECV 0x00010000
1069 #define XP1_IFS_HANDLES 0x00020000
1070 #define XP1_PARTIAL_MESSAGE 0x00040000
1071
1072 #define BIGENDIAN 0x0000
1073 #define LITTLEENDIAN 0x0001
1074
1075 #define SECURITY_PROTOCOL_NONE 0x0000
1076 #define JL_SENDER_ONLY 0x01
1077 #define JL_RECEIVER_ONLY 0x02
1078 #define JL_BOTH 0x04
1079 #define WSA_FLAG_OVERLAPPED 0x01
1080 #define WSA_FLAG_MULTIPOINT_C_ROOT 0x02
1081 #define WSA_FLAG_MULTIPOINT_C_LEAF 0x04
1082 #define WSA_FLAG_MULTIPOINT_D_ROOT 0x08
1083 #define WSA_FLAG_MULTIPOINT_D_LEAF 0x10
1084 #define IOC_UNIX 0x00000000
1085 #define IOC_WS2 0x08000000
1086 #define IOC_PROTOCOL 0x10000000
1087 #define IOC_VENDOR 0x18000000
1088
1089 #define _WSAIO(x,y) (IOC_VOID|(x)|(y))
1090 #define _WSAIOR(x,y) (IOC_OUT|(x)|(y))
1091 #define _WSAIOW(x,y) (IOC_IN|(x)|(y))
1092 #define _WSAIORW(x,y) (IOC_INOUT|(x)|(y))
1093
1094 #define SIO_ASSOCIATE_HANDLE _WSAIOW(IOC_WS2,1)
1095 #define SIO_ENABLE_CIRCULAR_QUEUEING _WSAIO(IOC_WS2,2)
1096 #define SIO_FIND_ROUTE _WSAIOR(IOC_WS2,3)
1097 #define SIO_FLUSH _WSAIO(IOC_WS2,4)
1098 #define SIO_GET_BROADCAST_ADDRESS _WSAIOR(IOC_WS2,5)
1099 #define SIO_GET_EXTENSION_FUNCTION_POINTER _WSAIORW(IOC_WS2,6)
1100 #define SIO_GET_QOS _WSAIORW(IOC_WS2,7)
1101 #define SIO_GET_GROUP_QOS _WSAIORW(IOC_WS2,8)
1102 #define SIO_MULTIPOINT_LOOPBACK _WSAIOW(IOC_WS2,9)
1103 #define SIO_MULTICAST_SCOPE _WSAIOW(IOC_WS2,10)
1104 #define SIO_SET_QOS _WSAIOW(IOC_WS2,11)
1105 #define SIO_SET_GROUP_QOS _WSAIOW(IOC_WS2,12)
1106 #define SIO_TRANSLATE_HANDLE _WSAIORW(IOC_WS2,13)
1107 #define SIO_ROUTING_INTERFACE_QUERY _WSAIORW(IOC_WS2,20)
1108 #define SIO_ROUTING_INTERFACE_CHANGE _WSAIOW(IOC_WS2,21)
1109 #define SIO_ADDRESS_LIST_QUERY _WSAIOR(IOC_WS2,22)
1110 #define SIO_ADDRESS_LIST_CHANGE _WSAIO(IOC_WS2,23)
1111 #define SIO_QUERY_TARGET_PNP_HANDLE _WSAIOR(IOC_WS2,24)
1112 #define SIO_NSP_NOTIFY_CHANGE _WSAIOW(IOC_WS2,25)
1113
1114 #define TH_NETDEV 0x00000001
1115 #define TH_TAPI 0x00000002
1116
1117 SOCKET WINAPI WSAAccept(SOCKET, struct sockaddr *, LPINT, LPCONDITIONPROC, DWORD);
1118 INT WINAPI WSAAddressToStringA(LPSOCKADDR, DWORD, LPWSAPROTOCOL_INFOA, LPSTR, LPDWORD);
1119 INT WINAPI WSAAddressToStringW(LPSOCKADDR, DWORD, LPWSAPROTOCOL_INFOW, LPWSTR, LPDWORD);
1120 BOOL WINAPI WSACloseEvent(WSAEVENT);
1121 int WINAPI WSAConnect(SOCKET, const struct sockaddr *, int, LPWSABUF, LPWSABUF, LPQOS, LPQOS);
1122 WSAEVENT WINAPI WSACreateEvent(void);
1123 int WINAPI WSADuplicateSocketA(SOCKET, DWORD, LPWSAPROTOCOL_INFOA);
1124 int WINAPI WSADuplicateSocketW(SOCKET, DWORD, LPWSAPROTOCOL_INFOW);
1125 INT WINAPI WSAEnumNameSpaceProvidersA(LPDWORD, LPWSANAMESPACE_INFOA);
1126 INT WINAPI WSAEnumNameSpaceProvidersW(LPDWORD, LPWSANAMESPACE_INFOW);
1127 int WINAPI WSAEnumNetworkEvents(SOCKET, WSAEVENT, LPWSANETWORKEVENTS);
1128 int WINAPI WSAEnumProtocolsA(LPINT, LPWSAPROTOCOL_INFOA, LPDWORD);
1129 int WINAPI WSAEnumProtocolsW(LPINT, LPWSAPROTOCOL_INFOW, LPDWORD);
1130 int WINAPI WSAEventSelect(SOCKET, WSAEVENT, LONG);
1131 BOOL WINAPI WSAGetOverlappedResult(SOCKET, LPWSAOVERLAPPED, LPDWORD, BOOL, LPDWORD);
1132 BOOL WINAPI WSAGetQOSByName(SOCKET, LPWSABUF, LPQOS);
1133 INT WINAPI WSAGetServiceClassInfoA(LPGUID, LPGUID, LPDWORD, LPWSASERVICECLASSINFOA);
1134 INT WINAPI WSAGetServiceClassInfoW(LPGUID, LPGUID, LPDWORD, LPWSASERVICECLASSINFOW);
1135 INT WINAPI WSAGetServiceClassNameByClassIdA(LPGUID, LPSTR, LPDWORD);
1136 INT WINAPI WSAGetServiceClassNameByClassIdW(LPGUID, LPWSTR, LPDWORD);
1137 int WINAPI WSAHtonl(SOCKET, u_long, u_long *);
1138 int WINAPI WSAHtons(SOCKET, unsigned short, unsigned short *);
1139 INT WINAPI WSAInstallServiceClassA(LPWSASERVICECLASSINFOA);
1140 INT WINAPI WSAInstallServiceClassW(LPWSASERVICECLASSINFOW);
1141 int WINAPI WSAIoctl(SOCKET, DWORD, LPVOID, DWORD, LPVOID, DWORD, LPDWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1142 SOCKET WINAPI WSAJoinLeaf(SOCKET, const struct sockaddr *, int, LPWSABUF, LPWSABUF, LPQOS, LPQOS, DWORD);
1143 INT WINAPI WSALookupServiceBeginA(LPWSAQUERYSETA, DWORD, LPHANDLE);
1144 INT WINAPI WSALookupServiceBeginW(LPWSAQUERYSETW lpqsRestrictions, DWORD, LPHANDLE);
1145 INT WINAPI WSALookupServiceNextA(HANDLE, DWORD, LPDWORD, LPWSAQUERYSETA);
1146 INT WINAPI WSALookupServiceNextW(HANDLE, DWORD, LPDWORD, LPWSAQUERYSETW);
1147 INT WINAPI WSALookupServiceEnd(HANDLE);
1148 int WINAPI WSANSPIoctl(HANDLE,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPWSACOMPLETION); /* XP or .NET Server */
1149 int WINAPI WSANtohl(SOCKET, u_long, u_long *);
1150 int WINAPI WSANtohs(SOCKET, unsigned short, unsigned short *);
1151 int WINAPI WSARecv(SOCKET, LPWSABUF, DWORD, LPDWORD, LPDWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1152 int WINAPI WSARecvDisconnect(SOCKET, LPWSABUF);
1153 int WINAPI WSARecvFrom(SOCKET, LPWSABUF, DWORD, LPDWORD, LPDWORD, struct sockaddr *, LPINT, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1154 INT WINAPI WSARemoveServiceClass(LPGUID);
1155 BOOL WINAPI WSAResetEvent(WSAEVENT);
1156 int WINAPI WSASend(SOCKET, LPWSABUF, DWORD, LPDWORD, DWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1157 int WINAPI WSASendDisconnect(SOCKET, LPWSABUF);
1158 int WINAPI WSASendTo(SOCKET, LPWSABUF, DWORD, LPDWORD, DWORD, const struct sockaddr *, int, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1159 BOOL WINAPI WSASetEvent(WSAEVENT);
1160 INT WSAAPI WSASetServiceA(LPWSAQUERYSETA, WSAESETSERVICEOP, DWORD);
1161 INT WINAPI WSASetServiceW(LPWSAQUERYSETW, WSAESETSERVICEOP, DWORD);
1162 SOCKET WINAPI WSASocketA(int, int, int, LPWSAPROTOCOL_INFOA, GROUP, DWORD);
1163 SOCKET WINAPI WSASocketW(int, int, int, LPWSAPROTOCOL_INFOW, GROUP, DWORD);
1164 INT WINAPI WSAStringToAddressA(LPSTR, INT, LPWSAPROTOCOL_INFOA, LPSOCKADDR, LPINT);
1165 INT WINAPI WSAStringToAddressW(LPWSTR, INT, LPWSAPROTOCOL_INFOW, LPSOCKADDR, LPINT);
1166 DWORD WINAPI WSAWaitForMultipleEvents(DWORD, const WSAEVENT *, BOOL, DWORD, BOOL);
1167 typedef SOCKET (WINAPI *LPFN_WSAACCEPT)(SOCKET, struct sockaddr *, LPINT, LPCONDITIONPROC, DWORD);
1168 typedef INT (WINAPI *LPFN_WSAADDRESSTOSTRINGA)(LPSOCKADDR, DWORD, LPWSAPROTOCOL_INFOA, LPSTR, LPDWORD);
1169 typedef INT (WINAPI *LPFN_WSAADDRESSTOSTRINGW)(LPSOCKADDR, DWORD, LPWSAPROTOCOL_INFOW, LPWSTR, LPDWORD);
1170 typedef BOOL (WINAPI *LPFN_WSACLOSEEVENT)(WSAEVENT);
1171 typedef int (WINAPI *LPFN_WSACONNECT)(SOCKET, const struct sockaddr *, int, LPWSABUF, LPWSABUF, LPQOS, LPQOS);
1172 typedef WSAEVENT (WINAPI *LPFN_WSACREATEEVENT)(void);
1173 typedef int (WINAPI *LPFN_WSADUPLICATESOCKETA)(SOCKET, DWORD, LPWSAPROTOCOL_INFOA);
1174 typedef int (WINAPI *LPFN_WSADUPLICATESOCKETW)(SOCKET, DWORD, LPWSAPROTOCOL_INFOW);
1175 typedef INT (WINAPI *LPFN_WSAENUMNAMESPACEPROVIDERSA)(LPDWORD, LPWSANAMESPACE_INFOA);
1176 typedef INT (WINAPI *LPFN_WSAENUMNAMESPACEPROVIDERSW)(LPDWORD, LPWSANAMESPACE_INFOW);
1177 typedef int (WINAPI *LPFN_WSAENUMNETWORKEVENTS)(SOCKET, WSAEVENT, LPWSANETWORKEVENTS);
1178 typedef int (WINAPI *LPFN_WSAENUMPROTOCOLSA)(LPINT, LPWSAPROTOCOL_INFOA, LPDWORD);
1179 typedef int (WINAPI *LPFN_WSAENUMPROTOCOLSW)(LPINT, LPWSAPROTOCOL_INFOW, LPDWORD);
1180 typedef int (WINAPI *LPFN_WSAEVENTSELECT)(SOCKET, WSAEVENT, LONG);
1181 typedef BOOL (WINAPI *LPFN_WSAGETOVERLAPPEDRESULT)(SOCKET, LPWSAOVERLAPPED, LPDWORD, BOOL, LPDWORD);
1182 typedef BOOL (WINAPI *LPFN_WSAGETQOSBYNAME)(SOCKET, LPWSABUF, LPQOS);
1183 typedef INT (WINAPI *LPFN_WSAGETSERVICECLASSINFOA)(LPGUID, LPGUID, LPDWORD, LPWSASERVICECLASSINFOA);
1184 typedef INT (WINAPI *LPFN_WSAGETSERVICECLASSINFOW)(LPGUID, LPGUID, LPDWORD, LPWSASERVICECLASSINFOW);
1185 typedef INT (WINAPI *LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA)(LPGUID, LPSTR, LPDWORD);
1186 typedef INT (WINAPI *LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW)(LPGUID, LPWSTR, LPDWORD);
1187 typedef int (WINAPI *LPFN_WSAHTONL)(SOCKET, u_long, u_long *);
1188 typedef int (WINAPI *LPFN_WSAHTONS)(SOCKET, unsigned short, unsigned short *);
1189 typedef INT (WINAPI *LPFN_WSAINSTALLSERVICECLASSA)(LPWSASERVICECLASSINFOA);
1190 typedef INT (WINAPI *LPFN_WSAINSTALLSERVICECLASSW)(LPWSASERVICECLASSINFOW);
1191 typedef int (WINAPI *LPFN_WSAIOCTL)(SOCKET, DWORD, LPVOID, DWORD, LPVOID, DWORD, LPDWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1192 typedef SOCKET (WINAPI *LPFN_WSAJOINLEAF)(SOCKET, const struct sockaddr *, int, LPWSABUF, LPWSABUF, LPQOS, LPQOS, DWORD);
1193 typedef INT (WINAPI *LPFN_WSALOOKUPSERVICEBEGINA)(LPWSAQUERYSETA, DWORD, LPHANDLE);
1194 typedef INT (WINAPI *LPFN_WSALOOKUPSERVICEBEGINW)(LPWSAQUERYSETW, DWORD, LPHANDLE);
1195 typedef INT (WINAPI *LPFN_WSALOOKUPSERVICENEXTA)(HANDLE, DWORD, LPDWORD, LPWSAQUERYSETA);
1196 typedef INT (WINAPI *LPFN_WSALOOKUPSERVICENEXTW)(HANDLE, DWORD, LPDWORD, LPWSAQUERYSETW);
1197 typedef INT (WINAPI *LPFN_WSALOOKUPSERVICEEND)(HANDLE);
1198 typedef int (WINAPI *LPFN_WSANSPIoctl)(HANDLE, DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPWSACOMPLETION);
1199 typedef int (WINAPI *LPFN_WSANTOHL)(SOCKET, u_long, u_long *);
1200 typedef int (WINAPI *LPFN_WSANTOHS)(SOCKET, unsigned short, unsigned short *);
1201 typedef int (WINAPI *LPFN_WSARECV)(SOCKET, LPWSABUF, DWORD, LPDWORD, LPDWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1202 typedef int (WINAPI *LPFN_WSARECVDISCONNECT)(SOCKET, LPWSABUF);
1203 typedef int (WINAPI *LPFN_WSARECVFROM)(SOCKET, LPWSABUF, DWORD, LPDWORD, LPDWORD, struct sockaddr *, LPINT, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1204 typedef INT (WINAPI *LPFN_WSAREMOVESERVICECLASS)(LPGUID);
1205 typedef BOOL (WINAPI *LPFN_WSARESETEVENT)(WSAEVENT);
1206 typedef int (WINAPI *LPFN_WSASEND)(SOCKET, LPWSABUF, DWORD, LPDWORD, DWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1207 typedef int (WINAPI *LPFN_WSASENDDISCONNECT)(SOCKET, LPWSABUF);
1208 typedef int (WINAPI *LPFN_WSASENDTO)(SOCKET, LPWSABUF, DWORD, LPDWORD, DWORD, const struct sockaddr *, int, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE);
1209 typedef BOOL (WINAPI *LPFN_WSASETEVENT)(WSAEVENT);
1210 typedef INT (WINAPI *LPFN_WSASETSERVICEA)(LPWSAQUERYSETA, WSAESETSERVICEOP, DWORD);
1211 typedef INT (WINAPI *LPFN_WSASETSERVICEW)(LPWSAQUERYSETW, WSAESETSERVICEOP, DWORD);
1212 typedef SOCKET (WINAPI *LPFN_WSASOCKETA)(int, int, int, LPWSAPROTOCOL_INFOA, GROUP, DWORD);
1213 typedef SOCKET (WINAPI *LPFN_WSASOCKETW)(int, int, int, LPWSAPROTOCOL_INFOW, GROUP, DWORD);
1214 typedef INT (WINAPI *LPFN_WSASTRINGTOADDRESSA)(LPSTR, INT, LPWSAPROTOCOL_INFOA, LPSOCKADDR, LPINT);
1215 typedef INT (WINAPI *LPFN_WSASTRINGTOADDRESSW)(LPWSTR, INT, LPWSAPROTOCOL_INFOW, LPSOCKADDR, LPINT);
1216 typedef DWORD (WINAPI *LPFN_WSAWAITFORMULTIPLEEVENTS)(DWORD, const WSAEVENT *, BOOL, DWORD, BOOL);
1217
1218 #ifdef UNICODE
1219 #define LPFN_WSAADDRESSTOSTRING LPFN_WSAADDRESSTOSTRINGW
1220 #define LPFN_WSADUPLICATESOCKET LPFN_WSADUPLICATESOCKETW
1221 #define LPFN_WSAENUMNAMESPACEPROVIDERS LPFN_WSAENUMNAMESPACEPROVIDERSW
1222 #define LPFN_WSAENUMPROTOCOLS LPFN_WSAENUMPROTOCOLSW
1223 #define LPFN_WSAGETSERVICECLASSINFO LPFN_WSAGETSERVICECLASSINFOW
1224 #define LPFN_WSAGETSERVICECLASSNAMEBYCLASSID LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW
1225 #define LPFN_WSAINSTALLSERVICECLASS LPFN_WSAINSTALLSERVICECLASSW
1226 #define LPFN_WSALOOKUPSERVICEBEGIN LPFN_WSALOOKUPSERVICEBEGINW
1227 #define LPFN_WSALOOKUPSERVICENEXT LPFN_WSALOOKUPSERVICENEXTW
1228 #define LPFN_WSASETSERVICE LPFN_WSASETSERVICEW
1229 #define LPFN_WSASOCKET LPFN_WSASOCKETW
1230 #define LPFN_WSASTRINGTOADDRESS LPFN_WSASTRINGTOADDRESSW
1231 #define WSAAddressToString WSAAddressToStringW
1232 #define WSADuplicateSocket WSADuplicateSocketW
1233 #define WSAEnumNameSpaceProviders WSAEnumNameSpaceProvidersW
1234 #define WSAEnumProtocols WSAEnumProtocolsW
1235 #define WSAGetServiceClassInfo WSAGetServiceClassInfoW
1236 #define WSAGetServiceClassNameByClassId WSAGetServiceClassNameByClassIdW
1237 #define WSASetService WSASetServiceW
1238 #define WSASocket WSASocketW
1239 #define WSAStringToAddress WSAStringToAddressW
1240 #define WSALookupServiceBegin WSALookupServiceBeginW
1241 #define WSALookupServiceNext WSALookupServiceNextW
1242 #define WSAInstallServiceClass WSAInstallServiceClassW
1243 #else
1244 #define LPFN_WSAADDRESSTOSTRING LPFN_WSAADDRESSTOSTRINGA
1245 #define LPFN_WSADUPLICATESOCKET LPFN_WSADUPLICATESOCKETW
1246 #define LPFN_WSAENUMNAMESPACEPROVIDERS LPFN_WSAENUMNAMESPACEPROVIDERSA
1247 #define LPFN_WSAENUMPROTOCOLS LPFN_WSAENUMPROTOCOLSA
1248 #define LPFN_WSAGETSERVICECLASSINFO LPFN_WSAGETSERVICECLASSINFOA
1249 #define LPFN_WSAGETSERVICECLASSNAMEBYCLASSID LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA
1250 #define LPFN_WSAINSTALLSERVICECLASS LPFN_WSAINSTALLSERVICECLASSA
1251 #define LPFN_WSALOOKUPSERVICEBEGIN LPFN_WSALOOKUPSERVICEBEGINA
1252 #define LPFN_WSALOOKUPSERVICENEXT LPFN_WSALOOKUPSERVICENEXTA
1253 #define LPFN_WSASETSERVICE LPFN_WSASETSERVICEA
1254 #define LPFN_WSASOCKET LPFN_WSASOCKETA
1255 #define LPFN_WSASTRINGTOADDRESS LPFN_WSASTRINGTOADDRESSA
1256 #define WSAAddressToString WSAAddressToStringA
1257 #define WSADuplicateSocket WSADuplicateSocketA
1258 #define WSAEnumNameSpaceProviders WSAEnumNameSpaceProvidersA
1259 #define WSAEnumProtocols WSAEnumProtocolsA
1260 #define WSAGetServiceClassInfo WSAGetServiceClassInfoA
1261 #define WSAGetServiceClassNameByClassId WSAGetServiceClassNameByClassIdA
1262 #define WSAInstallServiceClass WSAInstallServiceClassA
1263 #define WSALookupServiceBegin WSALookupServiceBeginA
1264 #define WSALookupServiceNext WSALookupServiceNextA
1265 #define WSASocket WSASocketA
1266 #define WSAStringToAddress WSAStringToAddressA
1267 #define WSASetService WSASetServiceA
1268 #endif
1269
1270 #ifdef _MSC_VER
1271 #pragma warning(pop)
1272 #endif
1273
1274 #ifdef __cplusplus
1275 }
1276 #endif
1277 #endif