2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER within this package.
10 #ifndef INCL_WINSOCK_API_TYPEDEFS
11 #define INCL_WINSOCK_API_TYPEDEFS 0
19 #define MAKEWORD(low,high) ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8))
22 #ifndef WINSOCK_VERSION
23 #define WINSOCK_VERSION MAKEWORD(2,2)
26 #ifndef WINSOCK_API_LINKAGE
27 #ifdef DECLSPEC_IMPORT
28 #define WINSOCK_API_LINKAGE DECLSPEC_IMPORT
30 #define WINSOCK_API_LINKAGE
38 #ifndef _WINSOCK_SOCKET_DEFINED
39 #define _WINSOCK_SOCKET_DEFINED
40 typedef unsigned char u_char
;
41 typedef unsigned short u_short
;
42 typedef unsigned int u_int
;
43 typedef unsigned long u_long
;
44 __MINGW_EXTENSION
typedef unsigned __int64 u_int64
;
45 typedef INT_PTR SOCKET
;
52 typedef struct fd_set
{
54 SOCKET fd_array
[FD_SETSIZE
];
57 extern int WINAPI
__WSAFDIsSet(SOCKET
,fd_set
*);
59 #define FD_CLR(fd,set) do { u_int __i; for(__i = 0;__i < ((fd_set *)(set))->fd_count;__i++) { if (((fd_set *)(set))->fd_array[__i]==fd) { while (__i < ((fd_set *)(set))->fd_count-1) { ((fd_set *)(set))->fd_array[__i] = ((fd_set *)(set))->fd_array[__i+1]; __i++; } ((fd_set *)(set))->fd_count--; break; } } } while(0)
60 #define FD_SET(fd,set) do { u_int __i; for(__i = 0;__i < ((fd_set *)(set))->fd_count;__i++) { if (((fd_set *)(set))->fd_array[__i]==(fd)) { break; } } if (__i==((fd_set *)(set))->fd_count) { if (((fd_set *)(set))->fd_count < FD_SETSIZE) { ((fd_set *)(set))->fd_array[__i] = (fd); ((fd_set *)(set))->fd_count++; } } } while(0)
61 #define FD_ZERO(set) (((fd_set *)(set))->fd_count=0)
62 #define FD_ISSET(fd,set) __WSAFDIsSet((SOCKET)(fd),(fd_set *)(set))
64 #ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */
65 #define _TIMEVAL_DEFINED
71 #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
72 #define timercmp(tvp,uvp,cmp) ((tvp)->tv_sec cmp (uvp)->tv_sec || (tvp)->tv_sec==(uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
73 #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
74 #endif /* _TIMEVAL_DEFINED */
76 #define IOCPARM_MASK 0x7f
77 #define IOC_VOID 0x20000000
78 #define IOC_OUT 0x40000000
79 #define IOC_IN 0x80000000
80 #define IOC_INOUT (IOC_IN|IOC_OUT)
82 #define _IO(x,y) (IOC_VOID|((x)<<8)|(y))
83 #define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
84 #define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
86 #define FIONREAD _IOR('f',127,u_long)
87 #define FIONBIO _IOW('f',126,u_long)
88 #define FIOASYNC _IOW('f',125,u_long)
90 #define SIOCSHIWAT _IOW('s',0,u_long)
91 #define SIOCGHIWAT _IOR('s',1,u_long)
92 #define SIOCSLOWAT _IOW('s',2,u_long)
93 #define SIOCGLOWAT _IOR('s',3,u_long)
94 #define SIOCATMARK _IOR('s',7,u_long)
96 #define h_addr h_addr_list[0]
132 #define IPPROTO_HOPOPTS 0
133 #define IPPROTO_ICMP 1
134 #define IPPROTO_IGMP 2
135 #define IPPROTO_GGP 3
136 #define IPPROTO_IPV4 4
137 #define IPPROTO_TCP 6
138 #define IPPROTO_PUP 12
139 #define IPPROTO_UDP 17
140 #define IPPROTO_IDP 22
141 #define IPPROTO_IPV6 41
142 #define IPPROTO_ROUTING 43
143 #define IPPROTO_FRAGMENT 44
144 #define IPPROTO_ESP 50
145 #define IPPROTO_AH 51
146 #define IPPROTO_ICMPV6 58
147 #define IPPROTO_NONE 59
148 #define IPPROTO_DSTOPTS 60
149 #define IPPROTO_ND 77
150 #define IPPROTO_ICLFXBM 78
152 #define IPPROTO_RAW 255
153 #define IPPROTO_MAX 256
155 #define IPPORT_ECHO 7
156 #define IPPORT_DISCARD 9
157 #define IPPORT_SYSTAT 11
158 #define IPPORT_DAYTIME 13
159 #define IPPORT_NETSTAT 15
160 #define IPPORT_FTP 21
161 #define IPPORT_TELNET 23
162 #define IPPORT_SMTP 25
163 #define IPPORT_TIMESERVER 37
164 #define IPPORT_NAMESERVER 42
165 #define IPPORT_WHOIS 43
166 #define IPPORT_MTP 57
168 #define IPPORT_TFTP 69
169 #define IPPORT_RJE 77
170 #define IPPORT_FINGER 79
171 #define IPPORT_TTYLINK 87
172 #define IPPORT_SUPDUP 95
174 #define IPPORT_EXECSERVER 512
175 #define IPPORT_LOGINSERVER 513
176 #define IPPORT_CMDSERVER 514
177 #define IPPORT_EFSSERVER 520
179 #define IPPORT_BIFFUDP 512
180 #define IPPORT_WHOSERVER 513
181 #define IPPORT_ROUTESERVER 520
183 #define IPPORT_RESERVED 1024
185 #define IMPLINK_IP 155
186 #define IMPLINK_LOWEXPER 156
187 #define IMPLINK_HIGHEXPER 158
193 struct { u_char s_b1
,s_b2
,s_b3
,s_b4
; } S_un_b
;
194 struct { u_short s_w1
,s_w2
; } S_un_w
;
199 #define s_addr S_un.S_addr
200 #define s_host S_un.S_un_b.s_b2
201 #define s_net S_un.S_un_b.s_b1
202 #define s_imp S_un.S_un_w.s_w2
203 #define s_impno S_un.S_un_b.s_b4
204 #define s_lh S_un.S_un_b.s_b3
208 #define IN_CLASSA(i) (((long)(i) & 0x80000000)==0)
209 #define IN_CLASSA_NET 0xff000000
210 #define IN_CLASSA_NSHIFT 24
211 #define IN_CLASSA_HOST 0x00ffffff
212 #define IN_CLASSA_MAX 128
214 #define IN_CLASSB(i) (((long)(i) & 0xc0000000)==0x80000000)
215 #define IN_CLASSB_NET 0xffff0000
216 #define IN_CLASSB_NSHIFT 16
217 #define IN_CLASSB_HOST 0x0000ffff
218 #define IN_CLASSB_MAX 65536
220 #define IN_CLASSC(i) (((long)(i) & 0xe0000000)==0xc0000000)
221 #define IN_CLASSC_NET 0xffffff00
222 #define IN_CLASSC_NSHIFT 8
223 #define IN_CLASSC_HOST 0x000000ff
225 #define IN_CLASSD(i) (((long)(i) & 0xf0000000)==0xe0000000)
226 #define IN_CLASSD_NET 0xf0000000
227 #define IN_CLASSD_NSHIFT 28
228 #define IN_CLASSD_HOST 0x0fffffff
229 #define IN_MULTICAST(i) IN_CLASSD(i)
231 #define INADDR_ANY (u_long)0x00000000
232 #define INADDR_LOOPBACK 0x7f000001
233 #define INADDR_BROADCAST (u_long)0xffffffff
234 #define INADDR_NONE 0xffffffff
236 #define ADDR_ANY INADDR_ANY
241 struct in_addr sin_addr
;
245 #define WSADESCRIPTION_LEN 256
246 #define WSASYS_STATUS_LEN 128
248 typedef struct WSAData
{
252 unsigned short iMaxSockets
;
253 unsigned short iMaxUdpDg
;
255 char szDescription
[WSADESCRIPTION_LEN
+1];
256 char szSystemStatus
[WSASYS_STATUS_LEN
+1];
258 char szDescription
[WSADESCRIPTION_LEN
+1];
259 char szSystemStatus
[WSASYS_STATUS_LEN
+1];
260 unsigned short iMaxSockets
;
261 unsigned short iMaxUdpDg
;
264 } WSADATA
,*LPWSADATA
;
266 #define INVALID_SOCKET (SOCKET)(~0)
267 #define SOCKET_ERROR (-1)
269 #define FROM_PROTOCOL_INFO (-1)
271 #define SOCK_STREAM 1
275 #define SOCK_SEQPACKET 5
277 #define SO_DEBUG 0x0001
278 #define SO_ACCEPTCONN 0x0002
279 #define SO_REUSEADDR 0x0004
280 #define SO_KEEPALIVE 0x0008
281 #define SO_DONTROUTE 0x0010
282 #define SO_BROADCAST 0x0020
283 #define SO_USELOOPBACK 0x0040
284 #define SO_LINGER 0x0080
285 #define SO_OOBINLINE 0x0100
287 #define SO_DONTLINGER (int)(~SO_LINGER)
288 #define SO_EXCLUSIVEADDRUSE ((int)(~SO_REUSEADDR))
290 #define SO_SNDBUF 0x1001
291 #define SO_RCVBUF 0x1002
292 #define SO_SNDLOWAT 0x1003
293 #define SO_RCVLOWAT 0x1004
294 #define SO_SNDTIMEO 0x1005
295 #define SO_RCVTIMEO 0x1006
296 #define SO_ERROR 0x1007
297 #define SO_TYPE 0x1008
299 #define SO_GROUP_ID 0x2001
300 #define SO_GROUP_PRIORITY 0x2002
301 #define SO_MAX_MSG_SIZE 0x2003
302 #define SO_PROTOCOL_INFOA 0x2004
303 #define SO_PROTOCOL_INFOW 0x2005
305 #define SO_PROTOCOL_INFO SO_PROTOCOL_INFOW
307 #define SO_PROTOCOL_INFO SO_PROTOCOL_INFOA
309 #define PVD_CONFIG 0x3001
310 #define SO_CONDITIONAL_ACCEPT 0x3002
312 #define TCP_NODELAY 0x0001
324 #define AF_OSI AF_ISO
333 #define AF_APPLETALK 16
334 #define AF_NETBIOS 17
335 #define AF_VOICEVIEW 18
336 #define AF_FIREFOX 19
337 #define AF_UNKNOWN1 20
341 #define AF_CLUSTER 24
345 #define AF_TCNPROCESS 29
346 #define AF_TCNMESSAGE 30
347 #define AF_ICLFXBM 31
356 #define _SS_MAXSIZE 128
357 #define _SS_ALIGNSIZE (8)
359 #define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof (short))
360 #define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof (short) + _SS_PAD1SIZE + _SS_ALIGNSIZE))
362 struct sockaddr_storage
{
364 char __ss_pad1
[_SS_PAD1SIZE
];
366 __MINGW_EXTENSION __int64 __ss_align
;
367 char __ss_pad2
[_SS_PAD2SIZE
];
376 #define PF_UNSPEC AF_UNSPEC
377 #define PF_UNIX AF_UNIX
378 #define PF_INET AF_INET
379 #define PF_IMPLINK AF_IMPLINK
380 #define PF_PUP AF_PUP
381 #define PF_CHAOS AF_CHAOS
383 #define PF_IPX AF_IPX
384 #define PF_ISO AF_ISO
385 #define PF_OSI AF_OSI
386 #define PF_ECMA AF_ECMA
387 #define PF_DATAKIT AF_DATAKIT
388 #define PF_CCITT AF_CCITT
389 #define PF_SNA AF_SNA
390 #define PF_DECnet AF_DECnet
391 #define PF_DLI AF_DLI
392 #define PF_LAT AF_LAT
393 #define PF_HYLINK AF_HYLINK
394 #define PF_APPLETALK AF_APPLETALK
395 #define PF_VOICEVIEW AF_VOICEVIEW
396 #define PF_FIREFOX AF_FIREFOX
397 #define PF_UNKNOWN1 AF_UNKNOWN1
398 #define PF_BAN AF_BAN
399 #define PF_ATM AF_ATM
400 #define PF_INET6 AF_INET6
402 #define PF_MAX AF_MAX
409 #define SOL_SOCKET 0xffff
411 #define SOMAXCONN 0x7fffffff
415 #define MSG_DONTROUTE 0x4
416 #define MSG_WAITALL 0x8
418 #define MSG_PARTIAL 0x8000
420 #define MSG_INTERRUPT 0x10
422 #define MSG_MAXIOVLEN 16
424 #define MAXGETHOSTSTRUCT 1024
426 #define FD_READ_BIT 0
427 #define FD_READ (1 << FD_READ_BIT)
429 #define FD_WRITE_BIT 1
430 #define FD_WRITE (1 << FD_WRITE_BIT)
433 #define FD_OOB (1 << FD_OOB_BIT)
435 #define FD_ACCEPT_BIT 3
436 #define FD_ACCEPT (1 << FD_ACCEPT_BIT)
438 #define FD_CONNECT_BIT 4
439 #define FD_CONNECT (1 << FD_CONNECT_BIT)
441 #define FD_CLOSE_BIT 5
442 #define FD_CLOSE (1 << FD_CLOSE_BIT)
445 #define FD_QOS (1 << FD_QOS_BIT)
447 #define FD_GROUP_QOS_BIT 7
448 #define FD_GROUP_QOS (1 << FD_GROUP_QOS_BIT)
450 #define FD_ROUTING_INTERFACE_CHANGE_BIT 8
451 #define FD_ROUTING_INTERFACE_CHANGE (1 << FD_ROUTING_INTERFACE_CHANGE_BIT)
453 #define FD_ADDRESS_LIST_CHANGE_BIT 9
454 #define FD_ADDRESS_LIST_CHANGE (1 << FD_ADDRESS_LIST_CHANGE_BIT)
456 #define FD_MAX_EVENTS 10
457 #define FD_ALL_EVENTS ((1 << FD_MAX_EVENTS) - 1)
461 #define WSABASEERR 10000
463 #define WSAEINTR (WSABASEERR+4)
464 #define WSAEBADF (WSABASEERR+9)
465 #define WSAEACCES (WSABASEERR+13)
466 #define WSAEFAULT (WSABASEERR+14)
467 #define WSAEINVAL (WSABASEERR+22)
468 #define WSAEMFILE (WSABASEERR+24)
470 #define WSAEWOULDBLOCK (WSABASEERR+35)
471 #define WSAEINPROGRESS (WSABASEERR+36)
472 #define WSAEALREADY (WSABASEERR+37)
473 #define WSAENOTSOCK (WSABASEERR+38)
474 #define WSAEDESTADDRREQ (WSABASEERR+39)
475 #define WSAEMSGSIZE (WSABASEERR+40)
476 #define WSAEPROTOTYPE (WSABASEERR+41)
477 #define WSAENOPROTOOPT (WSABASEERR+42)
478 #define WSAEPROTONOSUPPORT (WSABASEERR+43)
479 #define WSAESOCKTNOSUPPORT (WSABASEERR+44)
480 #define WSAEOPNOTSUPP (WSABASEERR+45)
481 #define WSAEPFNOSUPPORT (WSABASEERR+46)
482 #define WSAEAFNOSUPPORT (WSABASEERR+47)
483 #define WSAEADDRINUSE (WSABASEERR+48)
484 #define WSAEADDRNOTAVAIL (WSABASEERR+49)
485 #define WSAENETDOWN (WSABASEERR+50)
486 #define WSAENETUNREACH (WSABASEERR+51)
487 #define WSAENETRESET (WSABASEERR+52)
488 #define WSAECONNABORTED (WSABASEERR+53)
489 #define WSAECONNRESET (WSABASEERR+54)
490 #define WSAENOBUFS (WSABASEERR+55)
491 #define WSAEISCONN (WSABASEERR+56)
492 #define WSAENOTCONN (WSABASEERR+57)
493 #define WSAESHUTDOWN (WSABASEERR+58)
494 #define WSAETOOMANYREFS (WSABASEERR+59)
495 #define WSAETIMEDOUT (WSABASEERR+60)
496 #define WSAECONNREFUSED (WSABASEERR+61)
497 #define WSAELOOP (WSABASEERR+62)
498 #define WSAENAMETOOLONG (WSABASEERR+63)
499 #define WSAEHOSTDOWN (WSABASEERR+64)
500 #define WSAEHOSTUNREACH (WSABASEERR+65)
501 #define WSAENOTEMPTY (WSABASEERR+66)
502 #define WSAEPROCLIM (WSABASEERR+67)
503 #define WSAEUSERS (WSABASEERR+68)
504 #define WSAEDQUOT (WSABASEERR+69)
505 #define WSAESTALE (WSABASEERR+70)
506 #define WSAEREMOTE (WSABASEERR+71)
508 #define WSASYSNOTREADY (WSABASEERR+91)
509 #define WSAVERNOTSUPPORTED (WSABASEERR+92)
510 #define WSANOTINITIALISED (WSABASEERR+93)
511 #define WSAEDISCON (WSABASEERR+101)
512 #ifndef WSAHOST_NOT_FOUND
513 #define WSAHOST_NOT_FOUND (WSABASEERR+1001)
516 #define WSATRY_AGAIN (WSABASEERR+1002)
518 #ifndef WSANO_RECOVERY
519 #define WSANO_RECOVERY (WSABASEERR+1003)
522 #define WSANO_DATA (WSABASEERR+1004)
525 #define WSAENOMORE (WSABASEERR+102)
526 #define WSAECANCELLED (WSABASEERR+103)
527 #define WSAEINVALIDPROCTABLE (WSABASEERR+104)
528 #define WSAEINVALIDPROVIDER (WSABASEERR+105)
529 #define WSAEPROVIDERFAILEDINIT (WSABASEERR+106)
530 #define WSASYSCALLFAILURE (WSABASEERR+107)
531 #define WSASERVICE_NOT_FOUND (WSABASEERR+108)
532 #define WSATYPE_NOT_FOUND (WSABASEERR+109)
533 #define WSA_E_NO_MORE (WSABASEERR+110)
534 #define WSA_E_CANCELLED (WSABASEERR+111)
535 #define WSAEREFUSED (WSABASEERR+112)
536 #ifndef WSA_QOS_RECEIVERS
537 #define WSA_QOS_RECEIVERS (WSABASEERR + 1005)
539 #ifndef WSA_QOS_SENDERS
540 #define WSA_QOS_SENDERS (WSABASEERR + 1006)
542 #ifndef WSA_QOS_NO_SENDERS
543 #define WSA_QOS_NO_SENDERS (WSABASEERR + 1007)
544 #define WSA_QOS_NO_RECEIVERS (WSABASEERR + 1008)
545 #define WSA_QOS_REQUEST_CONFIRMED (WSABASEERR + 1009)
546 #define WSA_QOS_ADMISSION_FAILURE (WSABASEERR + 1010)
547 #define WSA_QOS_POLICY_FAILURE (WSABASEERR + 1011)
548 #define WSA_QOS_BAD_STYLE (WSABASEERR + 1012)
549 #define WSA_QOS_BAD_OBJECT (WSABASEERR + 1013)
550 #define WSA_QOS_TRAFFIC_CTRL_ERROR (WSABASEERR + 1014)
551 #define WSA_QOS_GENERIC_ERROR (WSABASEERR + 1015)
552 #define WSA_QOS_ESERVICETYPE (WSABASEERR + 1016)
553 #define WSA_QOS_EFLOWSPEC (WSABASEERR + 1017)
554 #define WSA_QOS_EPROVSPECBUF (WSABASEERR + 1018)
556 #ifndef WSA_QOS_EFILTERSTYLE
557 #define WSA_QOS_EFILTERSTYLE (WSABASEERR + 1019)
559 #ifndef WSA_QOS_EFILTERTYPE
560 #define WSA_QOS_EFILTERTYPE (WSABASEERR + 1020)
562 #ifndef WSA_QOS_EFILTERCOUNT
563 #define WSA_QOS_EFILTERCOUNT (WSABASEERR + 1021)
565 #ifndef WSA_QOS_EOBJLENGTH
566 #define WSA_QOS_EOBJLENGTH (WSABASEERR + 1022)
568 #ifndef WSA_QOS_EFLOWCOUNT
569 #define WSA_QOS_EFLOWCOUNT (WSABASEERR + 1023)
571 #ifndef WSA_QOS_EUNKNOWNPSOBJ
572 #define WSA_QOS_EUNKNOWNPSOBJ (WSABASEERR + 1024)
574 #ifndef WSA_QOS_EPOLICYOBJ
575 #define WSA_QOS_EPOLICYOBJ (WSABASEERR + 1025)
577 #ifndef WSA_QOS_EFLOWDESC
578 #define WSA_QOS_EFLOWDESC (WSABASEERR + 1026)
580 #ifndef WSA_QOS_EPSFLOWSPEC
581 #define WSA_QOS_EPSFLOWSPEC (WSABASEERR + 1027)
583 #ifndef WSA_QOS_EPSFILTERSPEC
584 #define WSA_QOS_EPSFILTERSPEC (WSABASEERR + 1028)
586 #ifndef WSA_QOS_ESDMODEOBJ
587 #define WSA_QOS_ESDMODEOBJ (WSABASEERR + 1029)
589 #ifndef WSA_QOS_ESHAPERATEOBJ
590 #define WSA_QOS_ESHAPERATEOBJ (WSABASEERR + 1030)
592 #ifndef WSA_QOS_RESERVED_PETYPE
593 #define WSA_QOS_RESERVED_PETYPE (WSABASEERR + 1031)
597 #define h_errno WSAGetLastError()
598 #define HOST_NOT_FOUND WSAHOST_NOT_FOUND
599 #define TRY_AGAIN WSATRY_AGAIN
600 #define NO_RECOVERY WSANO_RECOVERY
601 #define NO_DATA WSANO_DATA
603 #define WSANO_ADDRESS WSANO_DATA
604 #define NO_ADDRESS WSANO_ADDRESS
607 #define EWOULDBLOCK WSAEWOULDBLOCK
608 #define EINPROGRESS WSAEINPROGRESS
609 #define EALREADY WSAEALREADY
610 #define ENOTSOCK WSAENOTSOCK
611 #define EDESTADDRREQ WSAEDESTADDRREQ
612 #define EMSGSIZE WSAEMSGSIZE
613 #define EPROTOTYPE WSAEPROTOTYPE
614 #define ENOPROTOOPT WSAENOPROTOOPT
615 #define EPROTONOSUPPORT WSAEPROTONOSUPPORT
616 #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
617 #define EOPNOTSUPP WSAEOPNOTSUPP
618 #define EPFNOSUPPORT WSAEPFNOSUPPORT
619 #define EAFNOSUPPORT WSAEAFNOSUPPORT
620 #define EADDRINUSE WSAEADDRINUSE
621 #define EADDRNOTAVAIL WSAEADDRNOTAVAIL
622 #define ENETDOWN WSAENETDOWN
623 #define ENETUNREACH WSAENETUNREACH
624 #define ENETRESET WSAENETRESET
625 #define ECONNABORTED WSAECONNABORTED
626 #define ECONNRESET WSAECONNRESET
627 #define ENOBUFS WSAENOBUFS
628 #define EISCONN WSAEISCONN
629 #define ENOTCONN WSAENOTCONN
630 #define ESHUTDOWN WSAESHUTDOWN
631 #define ETOOMANYREFS WSAETOOMANYREFS
632 #define ETIMEDOUT WSAETIMEDOUT
633 #define ECONNREFUSED WSAECONNREFUSED
634 #define ELOOP WSAELOOP
635 #define ENAMETOOLONG WSAENAMETOOLONG
636 #define EHOSTDOWN WSAEHOSTDOWN
637 #define EHOSTUNREACH WSAEHOSTUNREACH
638 #define ENOTEMPTY WSAENOTEMPTY
639 #define EPROCLIM WSAEPROCLIM
640 #define EUSERS WSAEUSERS
641 #define EDQUOT WSAEDQUOT
642 #define ESTALE WSAESTALE
643 #define EREMOTE WSAEREMOTE
646 #define WSAAPI WINAPI
647 #define WSAEVENT HANDLE
648 #define LPWSAEVENT LPHANDLE
649 #define WSAOVERLAPPED OVERLAPPED
650 typedef struct _OVERLAPPED
*LPWSAOVERLAPPED
;
652 #define WSA_IO_PENDING (ERROR_IO_PENDING)
653 #define WSA_IO_INCOMPLETE (ERROR_IO_INCOMPLETE)
654 #define WSA_INVALID_HANDLE (ERROR_INVALID_HANDLE)
655 #define WSA_INVALID_PARAMETER (ERROR_INVALID_PARAMETER)
656 #define WSA_NOT_ENOUGH_MEMORY (ERROR_NOT_ENOUGH_MEMORY)
657 #define WSA_OPERATION_ABORTED (ERROR_OPERATION_ABORTED)
659 #define WSA_INVALID_EVENT ((WSAEVENT)NULL)
660 #define WSA_MAXIMUM_WAIT_EVENTS (MAXIMUM_WAIT_OBJECTS)
661 #define WSA_WAIT_FAILED (WAIT_FAILED)
662 #define WSA_WAIT_EVENT_0 (WAIT_OBJECT_0)
663 #define WSA_WAIT_IO_COMPLETION (WAIT_IO_COMPLETION)
664 #define WSA_WAIT_TIMEOUT (WAIT_TIMEOUT)
665 #define WSA_INFINITE (INFINITE)
667 typedef struct _WSABUF
{
674 typedef struct _QualityOfService
{
675 FLOWSPEC SendingFlowspec
;
676 FLOWSPEC ReceivingFlowspec
;
677 WSABUF ProviderSpecific
;
680 #define CF_ACCEPT 0x0000
681 #define CF_REJECT 0x0001
682 #define CF_DEFER 0x0002
684 #define SD_RECEIVE 0x00
688 typedef unsigned int GROUP
;
690 #define SG_UNCONSTRAINED_GROUP 0x01
691 #define SG_CONSTRAINED_GROUP 0x02
693 typedef struct _WSANETWORKEVENTS
{
695 int iErrorCode
[FD_MAX_EVENTS
];
696 } WSANETWORKEVENTS
,*LPWSANETWORKEVENTS
;
702 #define MAX_PROTOCOL_CHAIN 7
704 #define BASE_PROTOCOL 1
705 #define LAYERED_PROTOCOL 0
707 typedef struct _WSAPROTOCOLCHAIN
{
710 DWORD ChainEntries
[MAX_PROTOCOL_CHAIN
];
711 } WSAPROTOCOLCHAIN
,*LPWSAPROTOCOLCHAIN
;
713 #define WSAPROTOCOL_LEN 255
715 typedef struct _WSAPROTOCOL_INFOA
{
716 DWORD dwServiceFlags1
;
717 DWORD dwServiceFlags2
;
718 DWORD dwServiceFlags3
;
719 DWORD dwServiceFlags4
;
720 DWORD dwProviderFlags
;
722 DWORD dwCatalogEntryId
;
723 WSAPROTOCOLCHAIN ProtocolChain
;
730 int iProtocolMaxOffset
;
731 int iNetworkByteOrder
;
734 DWORD dwProviderReserved
;
735 CHAR szProtocol
[WSAPROTOCOL_LEN
+1];
736 } WSAPROTOCOL_INFOA
,*LPWSAPROTOCOL_INFOA
;
737 typedef struct _WSAPROTOCOL_INFOW
{
738 DWORD dwServiceFlags1
;
739 DWORD dwServiceFlags2
;
740 DWORD dwServiceFlags3
;
741 DWORD dwServiceFlags4
;
742 DWORD dwProviderFlags
;
744 DWORD dwCatalogEntryId
;
745 WSAPROTOCOLCHAIN ProtocolChain
;
752 int iProtocolMaxOffset
;
753 int iNetworkByteOrder
;
756 DWORD dwProviderReserved
;
757 WCHAR szProtocol
[WSAPROTOCOL_LEN
+1];
758 } WSAPROTOCOL_INFOW
,*LPWSAPROTOCOL_INFOW
;
760 typedef WSAPROTOCOL_INFOW WSAPROTOCOL_INFO
;
761 typedef LPWSAPROTOCOL_INFOW LPWSAPROTOCOL_INFO
;
763 typedef WSAPROTOCOL_INFOA WSAPROTOCOL_INFO
;
764 typedef LPWSAPROTOCOL_INFOA LPWSAPROTOCOL_INFO
;
767 #define PFL_MULTIPLE_PROTO_ENTRIES 0x00000001
768 #define PFL_RECOMMENDED_PROTO_ENTRY 0x00000002
769 #define PFL_HIDDEN 0x00000004
770 #define PFL_MATCHES_PROTOCOL_ZERO 0x00000008
772 #define XP1_CONNECTIONLESS 0x00000001
773 #define XP1_GUARANTEED_DELIVERY 0x00000002
774 #define XP1_GUARANTEED_ORDER 0x00000004
775 #define XP1_MESSAGE_ORIENTED 0x00000008
776 #define XP1_PSEUDO_STREAM 0x00000010
777 #define XP1_GRACEFUL_CLOSE 0x00000020
778 #define XP1_EXPEDITED_DATA 0x00000040
779 #define XP1_CONNECT_DATA 0x00000080
780 #define XP1_DISCONNECT_DATA 0x00000100
781 #define XP1_SUPPORT_BROADCAST 0x00000200
782 #define XP1_SUPPORT_MULTIPOINT 0x00000400
783 #define XP1_MULTIPOINT_CONTROL_PLANE 0x00000800
784 #define XP1_MULTIPOINT_DATA_PLANE 0x00001000
785 #define XP1_QOS_SUPPORTED 0x00002000
786 #define XP1_INTERRUPT 0x00004000
787 #define XP1_UNI_SEND 0x00008000
788 #define XP1_UNI_RECV 0x00010000
789 #define XP1_IFS_HANDLES 0x00020000
790 #define XP1_PARTIAL_MESSAGE 0x00040000
792 #define BIGENDIAN 0x0000
793 #define LITTLEENDIAN 0x0001
795 #define SECURITY_PROTOCOL_NONE 0x0000
797 #define JL_SENDER_ONLY 0x01
798 #define JL_RECEIVER_ONLY 0x02
801 #define WSA_FLAG_OVERLAPPED 0x01
802 #define WSA_FLAG_MULTIPOINT_C_ROOT 0x02
803 #define WSA_FLAG_MULTIPOINT_C_LEAF 0x04
804 #define WSA_FLAG_MULTIPOINT_D_ROOT 0x08
805 #define WSA_FLAG_MULTIPOINT_D_LEAF 0x10
807 #define IOC_UNIX 0x00000000
808 #define IOC_WS2 0x08000000
809 #define IOC_PROTOCOL 0x10000000
810 #define IOC_VENDOR 0x18000000
812 #define _WSAIO(x,y) (IOC_VOID|(x)|(y))
813 #define _WSAIOR(x,y) (IOC_OUT|(x)|(y))
814 #define _WSAIOW(x,y) (IOC_IN|(x)|(y))
815 #define _WSAIORW(x,y) (IOC_INOUT|(x)|(y))
817 #define SIO_ASSOCIATE_HANDLE _WSAIOW(IOC_WS2,1)
818 #define SIO_ENABLE_CIRCULAR_QUEUEING _WSAIO(IOC_WS2,2)
819 #define SIO_FIND_ROUTE _WSAIOR(IOC_WS2,3)
820 #define SIO_FLUSH _WSAIO(IOC_WS2,4)
821 #define SIO_GET_BROADCAST_ADDRESS _WSAIOR(IOC_WS2,5)
822 #define SIO_GET_EXTENSION_FUNCTION_POINTER _WSAIORW(IOC_WS2,6)
823 #define SIO_GET_QOS _WSAIORW(IOC_WS2,7)
824 #define SIO_GET_GROUP_QOS _WSAIORW(IOC_WS2,8)
825 #define SIO_MULTIPOINT_LOOPBACK _WSAIOW(IOC_WS2,9)
826 #define SIO_MULTICAST_SCOPE _WSAIOW(IOC_WS2,10)
827 #define SIO_SET_QOS _WSAIOW(IOC_WS2,11)
828 #define SIO_SET_GROUP_QOS _WSAIOW(IOC_WS2,12)
829 #define SIO_TRANSLATE_HANDLE _WSAIORW(IOC_WS2,13)
830 #define SIO_ROUTING_INTERFACE_QUERY _WSAIORW(IOC_WS2,20)
831 #define SIO_ROUTING_INTERFACE_CHANGE _WSAIOW(IOC_WS2,21)
832 #define SIO_ADDRESS_LIST_QUERY _WSAIOR(IOC_WS2,22)
833 #define SIO_ADDRESS_LIST_CHANGE _WSAIO(IOC_WS2,23)
834 #define SIO_QUERY_TARGET_PNP_HANDLE _WSAIOR(IOC_WS2,24)
835 #define SIO_ADDRESS_LIST_SORT _WSAIORW(IOC_WS2,25)
837 typedef int (CALLBACK
*LPCONDITIONPROC
)(LPWSABUF lpCallerId
,LPWSABUF lpCallerData
,LPQOS lpSQOS
,LPQOS lpGQOS
,LPWSABUF lpCalleeId
,LPWSABUF lpCalleeData
,GROUP
*g
,DWORD_PTR dwCallbackData
);
838 typedef void (CALLBACK
*LPWSAOVERLAPPED_COMPLETION_ROUTINE
)(DWORD dwError
,DWORD cbTransferred
,LPWSAOVERLAPPED lpOverlapped
,DWORD dwFlags
);
840 #define SIO_NSP_NOTIFY_CHANGE _WSAIOW(IOC_WS2,25)
842 typedef enum _WSACOMPLETIONTYPE
{
843 NSP_NOTIFY_IMMEDIATELY
= 0,NSP_NOTIFY_HWND
,NSP_NOTIFY_EVENT
,NSP_NOTIFY_PORT
,NSP_NOTIFY_APC
844 } WSACOMPLETIONTYPE
,*PWSACOMPLETIONTYPE
,*LPWSACOMPLETIONTYPE
;
846 typedef struct _WSACOMPLETION
{
847 WSACOMPLETIONTYPE Type
;
855 LPWSAOVERLAPPED lpOverlapped
;
858 LPWSAOVERLAPPED lpOverlapped
;
859 LPWSAOVERLAPPED_COMPLETION_ROUTINE lpfnCompletionProc
;
862 LPWSAOVERLAPPED lpOverlapped
;
867 } WSACOMPLETION
,*PWSACOMPLETION
,*LPWSACOMPLETION
;
869 #define TH_NETDEV 0x00000001
870 #define TH_TAPI 0x00000002
872 typedef struct sockaddr SOCKADDR
;
873 typedef struct sockaddr
*PSOCKADDR
;
874 typedef struct sockaddr
*LPSOCKADDR
;
875 typedef struct sockaddr_storage SOCKADDR_STORAGE
;
876 typedef struct sockaddr_storage
*PSOCKADDR_STORAGE
;
877 typedef struct sockaddr_storage
*LPSOCKADDR_STORAGE
;
879 #ifndef _tagBLOB_DEFINED
880 #define _tagBLOB_DEFINED
881 #define _BLOB_DEFINED
882 #define _LPBLOB_DEFINED
883 typedef struct _BLOB
{
889 #define SERVICE_MULTIPLE (0x00000001)
895 #define NS_PEER_BROWSE (3)
899 #define NS_TCPIP_LOCAL (10)
900 #define NS_TCPIP_HOSTS (11)
902 #define NS_NETBT (13)
914 #define NS_NISPLUS (42)
918 #define NS_NETDES (60)
920 #define RES_UNUSED_1 (0x00000001)
921 #define RES_FLUSH_CACHE (0x00000002)
923 #define RES_SERVICE (0x00000004)
926 #define SERVICE_TYPE_VALUE_IPXPORTA "IpxSocket"
927 #define SERVICE_TYPE_VALUE_IPXPORTW L"IpxSocket"
928 #define SERVICE_TYPE_VALUE_SAPIDA "SapId"
929 #define SERVICE_TYPE_VALUE_SAPIDW L"SapId"
931 #define SERVICE_TYPE_VALUE_TCPPORTA "TcpPort"
932 #define SERVICE_TYPE_VALUE_TCPPORTW L"TcpPort"
934 #define SERVICE_TYPE_VALUE_UDPPORTA "UdpPort"
935 #define SERVICE_TYPE_VALUE_UDPPORTW L"UdpPort"
937 #define SERVICE_TYPE_VALUE_OBJECTIDA "ObjectId"
938 #define SERVICE_TYPE_VALUE_OBJECTIDW L"ObjectId"
942 #define SERVICE_TYPE_VALUE_SAPID SERVICE_TYPE_VALUE_SAPIDW
943 #define SERVICE_TYPE_VALUE_TCPPORT SERVICE_TYPE_VALUE_TCPPORTW
944 #define SERVICE_TYPE_VALUE_UDPPORT SERVICE_TYPE_VALUE_UDPPORTW
945 #define SERVICE_TYPE_VALUE_OBJECTID SERVICE_TYPE_VALUE_OBJECTIDW
948 #define SERVICE_TYPE_VALUE_SAPID SERVICE_TYPE_VALUE_SAPIDA
949 #define SERVICE_TYPE_VALUE_TCPPORT SERVICE_TYPE_VALUE_TCPPORTA
950 #define SERVICE_TYPE_VALUE_UDPPORT SERVICE_TYPE_VALUE_UDPPORTA
951 #define SERVICE_TYPE_VALUE_OBJECTID SERVICE_TYPE_VALUE_OBJECTIDA
954 #ifndef __CSADDR_DEFINED__
955 #define __CSADDR_DEFINED__
957 typedef struct _SOCKET_ADDRESS
{
958 LPSOCKADDR lpSockaddr
;
960 } SOCKET_ADDRESS
,*PSOCKET_ADDRESS
,*LPSOCKET_ADDRESS
;
962 typedef struct _CSADDR_INFO
{
963 SOCKET_ADDRESS LocalAddr
;
964 SOCKET_ADDRESS RemoteAddr
;
967 } CSADDR_INFO
,*PCSADDR_INFO
,*LPCSADDR_INFO
;
970 typedef struct _SOCKET_ADDRESS_LIST
{
972 SOCKET_ADDRESS Address
[1];
973 } SOCKET_ADDRESS_LIST
,*LPSOCKET_ADDRESS_LIST
;
975 typedef struct _AFPROTOCOLS
{
978 } AFPROTOCOLS
,*PAFPROTOCOLS
,*LPAFPROTOCOLS
;
980 typedef enum _WSAEcomparator
{
981 COMP_EQUAL
= 0,COMP_NOTLESS
982 } WSAECOMPARATOR
,*PWSAECOMPARATOR
,*LPWSAECOMPARATOR
;
984 typedef struct _WSAVersion
{
986 WSAECOMPARATOR ecHow
;
987 } WSAVERSION
,*PWSAVERSION
,*LPWSAVERSION
;
989 typedef struct _WSAQuerySetA
{
991 LPSTR lpszServiceInstanceName
;
992 LPGUID lpServiceClassId
;
993 LPWSAVERSION lpVersion
;
996 LPGUID lpNSProviderId
;
998 DWORD dwNumberOfProtocols
;
999 LPAFPROTOCOLS lpafpProtocols
;
1000 LPSTR lpszQueryString
;
1001 DWORD dwNumberOfCsAddrs
;
1002 LPCSADDR_INFO lpcsaBuffer
;
1003 DWORD dwOutputFlags
;
1005 } WSAQUERYSETA
,*PWSAQUERYSETA
,*LPWSAQUERYSETA
;
1007 typedef struct _WSAQuerySetW
{
1009 LPWSTR lpszServiceInstanceName
;
1010 LPGUID lpServiceClassId
;
1011 LPWSAVERSION lpVersion
;
1014 LPGUID lpNSProviderId
;
1016 DWORD dwNumberOfProtocols
;
1017 LPAFPROTOCOLS lpafpProtocols
;
1018 LPWSTR lpszQueryString
;
1019 DWORD dwNumberOfCsAddrs
;
1020 LPCSADDR_INFO lpcsaBuffer
;
1021 DWORD dwOutputFlags
;
1023 } WSAQUERYSETW
,*PWSAQUERYSETW
,*LPWSAQUERYSETW
;
1026 typedef WSAQUERYSETW WSAQUERYSET
;
1027 typedef PWSAQUERYSETW PWSAQUERYSET
;
1028 typedef LPWSAQUERYSETW LPWSAQUERYSET
;
1030 typedef WSAQUERYSETA WSAQUERYSET
;
1031 typedef PWSAQUERYSETA PWSAQUERYSET
;
1032 typedef LPWSAQUERYSETA LPWSAQUERYSET
;
1035 #define LUP_DEEP 0x0001
1036 #define LUP_CONTAINERS 0x0002
1037 #define LUP_NOCONTAINERS 0x0004
1038 #define LUP_NEAREST 0x0008
1039 #define LUP_RETURN_NAME 0x0010
1040 #define LUP_RETURN_TYPE 0x0020
1041 #define LUP_RETURN_VERSION 0x0040
1042 #define LUP_RETURN_COMMENT 0x0080
1043 #define LUP_RETURN_ADDR 0x0100
1044 #define LUP_RETURN_BLOB 0x0200
1045 #define LUP_RETURN_ALIASES 0x0400
1046 #define LUP_RETURN_QUERY_STRING 0x0800
1047 #define LUP_RETURN_ALL 0x0FF0
1048 #define LUP_RES_SERVICE 0x8000
1050 #define LUP_FLUSHCACHE 0x1000
1051 #define LUP_FLUSHPREVIOUS 0x2000
1053 #define RESULT_IS_ALIAS 0x0001
1054 #define RESULT_IS_ADDED 0x0010
1055 #define RESULT_IS_CHANGED 0x0020
1056 #define RESULT_IS_DELETED 0x0040
1058 typedef enum _WSAESETSERVICEOP
{
1059 RNRSERVICE_REGISTER
=0,RNRSERVICE_DEREGISTER
,RNRSERVICE_DELETE
1060 } WSAESETSERVICEOP
,*PWSAESETSERVICEOP
,*LPWSAESETSERVICEOP
;
1062 typedef struct _WSANSClassInfoA
{
1068 } WSANSCLASSINFOA
,*PWSANSCLASSINFOA
,*LPWSANSCLASSINFOA
;
1070 typedef struct _WSANSClassInfoW
{
1076 } WSANSCLASSINFOW
,*PWSANSCLASSINFOW
,*LPWSANSCLASSINFOW
;
1079 typedef WSANSCLASSINFOW WSANSCLASSINFO
;
1080 typedef PWSANSCLASSINFOW PWSANSCLASSINFO
;
1081 typedef LPWSANSCLASSINFOW LPWSANSCLASSINFO
;
1083 typedef WSANSCLASSINFOA WSANSCLASSINFO
;
1084 typedef PWSANSCLASSINFOA PWSANSCLASSINFO
;
1085 typedef LPWSANSCLASSINFOA LPWSANSCLASSINFO
;
1088 typedef struct _WSAServiceClassInfoA
{
1089 LPGUID lpServiceClassId
;
1090 LPSTR lpszServiceClassName
;
1092 LPWSANSCLASSINFOA lpClassInfos
;
1093 } WSASERVICECLASSINFOA
,*PWSASERVICECLASSINFOA
,*LPWSASERVICECLASSINFOA
;
1095 typedef struct _WSAServiceClassInfoW
{
1096 LPGUID lpServiceClassId
;
1097 LPWSTR lpszServiceClassName
;
1099 LPWSANSCLASSINFOW lpClassInfos
;
1100 } WSASERVICECLASSINFOW
,*PWSASERVICECLASSINFOW
,*LPWSASERVICECLASSINFOW
;
1103 typedef WSASERVICECLASSINFOW WSASERVICECLASSINFO
;
1104 typedef PWSASERVICECLASSINFOW PWSASERVICECLASSINFO
;
1105 typedef LPWSASERVICECLASSINFOW LPWSASERVICECLASSINFO
;
1107 typedef WSASERVICECLASSINFOA WSASERVICECLASSINFO
;
1108 typedef PWSASERVICECLASSINFOA PWSASERVICECLASSINFO
;
1109 typedef LPWSASERVICECLASSINFOA LPWSASERVICECLASSINFO
;
1112 typedef struct _WSANAMESPACE_INFOA
{
1117 LPSTR lpszIdentifier
;
1118 } WSANAMESPACE_INFOA
,*PWSANAMESPACE_INFOA
,*LPWSANAMESPACE_INFOA
;
1120 typedef struct _WSANAMESPACE_INFOW
{
1125 LPWSTR lpszIdentifier
;
1126 } WSANAMESPACE_INFOW
,*PWSANAMESPACE_INFOW
,*LPWSANAMESPACE_INFOW
;
1129 typedef WSANAMESPACE_INFOW WSANAMESPACE_INFO
;
1130 typedef PWSANAMESPACE_INFOW PWSANAMESPACE_INFO
;
1131 typedef LPWSANAMESPACE_INFOW LPWSANAMESPACE_INFO
;
1133 typedef WSANAMESPACE_INFOA WSANAMESPACE_INFO
;
1134 typedef PWSANAMESPACE_INFOA PWSANAMESPACE_INFO
;
1135 typedef LPWSANAMESPACE_INFOA LPWSANAMESPACE_INFO
;
1138 #if INCL_WINSOCK_API_TYPEDEFS
1140 #define LPFN_WSADUPLICATESOCKET LPFN_WSADUPLICATESOCKETW
1141 #define LPFN_WSAENUMPROTOCOLS LPFN_WSAENUMPROTOCOLSW
1142 #define LPFN_WSASOCKET LPFN_WSASOCKETW
1143 #define LPFN_WSAADDRESSTOSTRING LPFN_WSAADDRESSTOSTRINGW
1144 #define LPFN_WSASTRINGTOADDRESS LPFN_WSASTRINGTOADDRESSW
1145 #define LPFN_WSALOOKUPSERVICEBEGIN LPFN_WSALOOKUPSERVICEBEGINW
1146 #define LPFN_WSALOOKUPSERVICENEXT LPFN_WSALOOKUPSERVICENEXTW
1147 #define LPFN_WSAINSTALLSERVICECLASS LPFN_WSAINSTALLSERVICECLASSW
1148 #define LPFN_WSAGETSERVICECLASSINFO LPFN_WSAGETSERVICECLASSINFOW
1149 #define LPFN_WSAENUMNAMESPACEPROVIDERS LPFN_WSAENUMNAMESPACEPROVIDERSW
1150 #define LPFN_WSAGETSERVICECLASSNAMEBYCLASSID LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW
1151 #define LPFN_WSASETSERVICE LPFN_WSASETSERVICEW
1153 #define LPFN_WSADUPLICATESOCKET LPFN_WSADUPLICATESOCKETA
1154 #define LPFN_WSAENUMPROTOCOLS LPFN_WSAENUMPROTOCOLSA
1155 #define LPFN_WSASOCKET LPFN_WSASOCKETA
1156 #define LPFN_WSAADDRESSTOSTRING LPFN_WSAADDRESSTOSTRINGA
1157 #define LPFN_WSASTRINGTOADDRESS LPFN_WSASTRINGTOADDRESSA
1158 #define LPFN_WSALOOKUPSERVICEBEGIN LPFN_WSALOOKUPSERVICEBEGINA
1159 #define LPFN_WSALOOKUPSERVICENEXT LPFN_WSALOOKUPSERVICENEXTA
1160 #define LPFN_WSAINSTALLSERVICECLASS LPFN_WSAINSTALLSERVICECLASSA
1161 #define LPFN_WSAGETSERVICECLASSINFO LPFN_WSAGETSERVICECLASSINFOA
1162 #define LPFN_WSAENUMNAMESPACEPROVIDERS LPFN_WSAENUMNAMESPACEPROVIDERSA
1163 #define LPFN_WSAGETSERVICECLASSNAMEBYCLASSID LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA
1164 #define LPFN_WSASETSERVICE LPFN_WSASETSERVICEA
1167 typedef SOCKET (WSAAPI
*LPFN_ACCEPT
)(SOCKET s
,struct sockaddr
*addr
,int *addrlen
);
1168 typedef int (WSAAPI
*LPFN_BIND
)(SOCKET s
,const struct sockaddr
*name
,int namelen
);
1169 typedef int (WSAAPI
*LPFN_CLOSESOCKET
)(SOCKET s
);
1170 typedef int (WSAAPI
*LPFN_CONNECT
)(SOCKET s
,const struct sockaddr
*name
,int namelen
);
1171 typedef int (WSAAPI
*LPFN_IOCTLSOCKET
)(SOCKET s
,long cmd
,u_long
*argp
);
1172 typedef int (WSAAPI
*LPFN_GETPEERNAME
)(SOCKET s
,struct sockaddr
*name
,int *namelen
);
1173 typedef int (WSAAPI
*LPFN_GETSOCKNAME
)(SOCKET s
,struct sockaddr
*name
,int *namelen
);
1174 typedef int (WSAAPI
*LPFN_GETSOCKOPT
)(SOCKET s
,int level
,int optname
,char *optval
,int *optlen
);
1175 typedef u_long (WSAAPI
*LPFN_HTONL
)(u_long hostlong
);
1176 typedef u_short (WSAAPI
*LPFN_HTONS
)(u_short hostshort
);
1177 typedef unsigned long (WSAAPI
*LPFN_INET_ADDR
)(const char *cp
);
1178 typedef char *(WSAAPI
*LPFN_INET_NTOA
)(struct in_addr in
);
1179 typedef int (WSAAPI
*LPFN_LISTEN
)(SOCKET s
,int backlog
);
1180 typedef u_long (WSAAPI
*LPFN_NTOHL
)(u_long netlong
);
1181 typedef u_short (WSAAPI
*LPFN_NTOHS
)(u_short netshort
);
1182 typedef int (WSAAPI
*LPFN_RECV
)(SOCKET s
,char *buf
,int len
,int flags
);
1183 typedef int (WSAAPI
*LPFN_RECVFROM
)(SOCKET s
,char *buf
,int len
,int flags
,struct sockaddr
*from
,int *fromlen
);
1184 typedef int (WSAAPI
*LPFN_SELECT
)(int nfds
,fd_set
*readfds
,fd_set
*writefds
,fd_set
*exceptfds
,const struct timeval
*timeout
);
1185 typedef int (WSAAPI
*LPFN_SEND
)(SOCKET s
,const char *buf
,int len
,int flags
);
1186 typedef int (WSAAPI
*LPFN_SENDTO
)(SOCKET s
,const char *buf
,int len
,int flags
,const struct sockaddr
*to
,int tolen
);
1187 typedef int (WSAAPI
*LPFN_SETSOCKOPT
)(SOCKET s
,int level
,int optname
,const char *optval
,int optlen
);
1188 typedef int (WSAAPI
*LPFN_SHUTDOWN
)(SOCKET s
,int how
);
1189 typedef SOCKET (WSAAPI
*LPFN_SOCKET
)(int af
,int type
,int protocol
);
1190 typedef struct hostent
*(WSAAPI
*LPFN_GETHOSTBYADDR
)(const char *addr
,int len
,int type
);
1191 typedef struct hostent
*(WSAAPI
*LPFN_GETHOSTBYNAME
)(const char *name
);
1192 typedef int (WSAAPI
*LPFN_GETHOSTNAME
)(char *name
,int namelen
);
1193 typedef struct servent
*(WSAAPI
*LPFN_GETSERVBYPORT
)(int port
,const char *proto
);
1194 typedef struct servent
*(WSAAPI
*LPFN_GETSERVBYNAME
)(const char *name
,const char *proto
);
1195 typedef struct protoent
*(WSAAPI
*LPFN_GETPROTOBYNUMBER
)(int number
);
1196 typedef struct protoent
*(WSAAPI
*LPFN_GETPROTOBYNAME
)(const char *name
);
1197 typedef int (WSAAPI
*LPFN_WSASTARTUP
)(WORD wVersionRequested
,LPWSADATA lpWSAData
);
1198 typedef int (WSAAPI
*LPFN_WSACLEANUP
)(void);
1199 typedef void (WSAAPI
*LPFN_WSASETLASTERROR
)(int iError
);
1200 typedef int (WSAAPI
*LPFN_WSAGETLASTERROR
)(void);
1201 typedef WINBOOL (WSAAPI
*LPFN_WSAISBLOCKING
)(void);
1202 typedef int (WSAAPI
*LPFN_WSAUNHOOKBLOCKINGHOOK
)(void);
1203 typedef FARPROC (WSAAPI
*LPFN_WSASETBLOCKINGHOOK
)(FARPROC lpBlockFunc
);
1204 typedef int (WSAAPI
*LPFN_WSACANCELBLOCKINGCALL
)(void);
1205 typedef HANDLE (WSAAPI
*LPFN_WSAASYNCGETSERVBYNAME
)(HWND hWnd
,u_int wMsg
,const char *name
,const char *proto
,char *buf
,int buflen
);
1206 typedef HANDLE (WSAAPI
*LPFN_WSAASYNCGETSERVBYPORT
)(HWND hWnd
,u_int wMsg
,int port
,const char *proto
,char *buf
,int buflen
);
1207 typedef HANDLE (WSAAPI
*LPFN_WSAASYNCGETPROTOBYNAME
)(HWND hWnd
,u_int wMsg
,const char *name
,char *buf
,int buflen
);
1208 typedef HANDLE (WSAAPI
*LPFN_WSAASYNCGETPROTOBYNUMBER
)(HWND hWnd
,u_int wMsg
,int number
,char *buf
,int buflen
);
1209 typedef HANDLE (WSAAPI
*LPFN_WSAASYNCGETHOSTBYNAME
)(HWND hWnd
,u_int wMsg
,const char *name
,char *buf
,int buflen
);
1210 typedef HANDLE (WSAAPI
*LPFN_WSAASYNCGETHOSTBYADDR
)(HWND hWnd
,u_int wMsg
,const char *addr
,int len
,int type
,char *buf
,int buflen
);
1211 typedef int (WSAAPI
*LPFN_WSACANCELASYNCREQUEST
)(HANDLE hAsyncTaskHandle
);
1212 typedef int (WSAAPI
*LPFN_WSAASYNCSELECT
)(SOCKET s
,HWND hWnd
,u_int wMsg
,long lEvent
);
1213 typedef SOCKET (WSAAPI
*LPFN_WSAACCEPT
)(SOCKET s
,struct sockaddr
*addr
,LPINT addrlen
,LPCONDITIONPROC lpfnCondition
,DWORD_PTR dwCallbackData
);
1214 typedef WINBOOL (WSAAPI
*LPFN_WSACLOSEEVENT
)(WSAEVENT hEvent
);
1215 typedef int (WSAAPI
*LPFN_WSACONNECT
)(SOCKET s
,const struct sockaddr
*name
,int namelen
,LPWSABUF lpCallerData
,LPWSABUF lpCalleeData
,LPQOS lpSQOS
,LPQOS lpGQOS
);
1216 typedef WSAEVENT (WSAAPI
*LPFN_WSACREATEEVENT
)(void);
1217 typedef int (WSAAPI
*LPFN_WSADUPLICATESOCKETA
)(SOCKET s
,DWORD dwProcessId
,LPWSAPROTOCOL_INFOA lpProtocolInfo
);
1218 typedef int (WSAAPI
*LPFN_WSADUPLICATESOCKETW
)(SOCKET s
,DWORD dwProcessId
,LPWSAPROTOCOL_INFOW lpProtocolInfo
);
1219 typedef int (WSAAPI
*LPFN_WSAENUMNETWORKEVENTS
)(SOCKET s
,WSAEVENT hEventObject
,LPWSANETWORKEVENTS lpNetworkEvents
);
1220 typedef int (WSAAPI
*LPFN_WSAENUMPROTOCOLSA
)(LPINT lpiProtocols
,LPWSAPROTOCOL_INFOA lpProtocolBuffer
,LPDWORD lpdwBufferLength
);
1221 typedef int (WSAAPI
*LPFN_WSAENUMPROTOCOLSW
)(LPINT lpiProtocols
,LPWSAPROTOCOL_INFOW lpProtocolBuffer
,LPDWORD lpdwBufferLength
);
1222 typedef int (WSAAPI
*LPFN_WSAEVENTSELECT
)(SOCKET s
,WSAEVENT hEventObject
,long lNetworkEvents
);
1223 typedef WINBOOL (WSAAPI
*LPFN_WSAGETOVERLAPPEDRESULT
)(SOCKET s
,LPWSAOVERLAPPED lpOverlapped
,LPDWORD lpcbTransfer
,WINBOOL fWait
,LPDWORD lpdwFlags
);
1224 typedef WINBOOL (WSAAPI
*LPFN_WSAGETQOSBYNAME
)(SOCKET s
,LPWSABUF lpQOSName
,LPQOS lpQOS
);
1225 typedef int (WSAAPI
*LPFN_WSAHTONL
)(SOCKET s
,u_long hostlong
,u_long
*lpnetlong
);
1226 typedef int (WSAAPI
*LPFN_WSAHTONS
)(SOCKET s
,u_short hostshort
,u_short
*lpnetshort
);
1227 typedef int (WSAAPI
*LPFN_WSAIOCTL
)(SOCKET s
,DWORD dwIoControlCode
,LPVOID lpvInBuffer
,DWORD cbInBuffer
,LPVOID lpvOutBuffer
,DWORD cbOutBuffer
,LPDWORD lpcbBytesReturned
,LPWSAOVERLAPPED lpOverlapped
,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
1228 typedef SOCKET (WSAAPI
*LPFN_WSAJOINLEAF
)(SOCKET s
,const struct sockaddr
*name
,int namelen
,LPWSABUF lpCallerData
,LPWSABUF lpCalleeData
,LPQOS lpSQOS
,LPQOS lpGQOS
,DWORD dwFlags
);
1229 typedef int (WSAAPI
*LPFN_WSANTOHL
)(SOCKET s
,u_long netlong
,u_long
*lphostlong
);
1230 typedef int (WSAAPI
*LPFN_WSANTOHS
)(SOCKET s
,u_short netshort
,u_short
*lphostshort
);
1231 typedef int (WSAAPI
*LPFN_WSARECV
)(SOCKET s
,LPWSABUF lpBuffers
,DWORD dwBufferCount
,LPDWORD lpNumberOfBytesRecvd
,LPDWORD lpFlags
,LPWSAOVERLAPPED lpOverlapped
,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
1232 typedef int (WSAAPI
*LPFN_WSARECVDISCONNECT
)(SOCKET s
,LPWSABUF lpInboundDisconnectData
);
1233 typedef int (WSAAPI
*LPFN_WSARECVFROM
)(SOCKET s
,LPWSABUF lpBuffers
,DWORD dwBufferCount
,LPDWORD lpNumberOfBytesRecvd
,LPDWORD lpFlags
,struct sockaddr
*lpFrom
,LPINT lpFromlen
,LPWSAOVERLAPPED lpOverlapped
,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
1234 typedef WINBOOL (WSAAPI
*LPFN_WSARESETEVENT
)(WSAEVENT hEvent
);
1235 typedef int (WSAAPI
*LPFN_WSASEND
)(SOCKET s
,LPWSABUF lpBuffers
,DWORD dwBufferCount
,LPDWORD lpNumberOfBytesSent
,DWORD dwFlags
,LPWSAOVERLAPPED lpOverlapped
,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
1236 typedef int (WSAAPI
*LPFN_WSASENDDISCONNECT
)(SOCKET s
,LPWSABUF lpOutboundDisconnectData
);
1237 typedef int (WSAAPI
*LPFN_WSASENDTO
)(SOCKET s
,LPWSABUF lpBuffers
,DWORD dwBufferCount
,LPDWORD lpNumberOfBytesSent
,DWORD dwFlags
,const struct sockaddr
*lpTo
,int iTolen
,LPWSAOVERLAPPED lpOverlapped
,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
1238 typedef WINBOOL (WSAAPI
*LPFN_WSASETEVENT
)(WSAEVENT hEvent
);
1239 typedef SOCKET (WSAAPI
*LPFN_WSASOCKETA
)(int af
,int type
,int protocol
,LPWSAPROTOCOL_INFOA lpProtocolInfo
,GROUP g
,DWORD dwFlags
);
1240 typedef SOCKET (WSAAPI
*LPFN_WSASOCKETW
)(int af
,int type
,int protocol
,LPWSAPROTOCOL_INFOW lpProtocolInfo
,GROUP g
,DWORD dwFlags
);
1241 typedef DWORD (WSAAPI
*LPFN_WSAWAITFORMULTIPLEEVENTS
)(DWORD cEvents
,const WSAEVENT
*lphEvents
,WINBOOL fWaitAll
,DWORD dwTimeout
,WINBOOL fAlertable
);
1242 typedef INT (WSAAPI
*LPFN_WSAADDRESSTOSTRINGA
)(LPSOCKADDR lpsaAddress
,DWORD dwAddressLength
,LPWSAPROTOCOL_INFOA lpProtocolInfo
,LPSTR lpszAddressString
,LPDWORD lpdwAddressStringLength
);
1243 typedef INT (WSAAPI
*LPFN_WSAADDRESSTOSTRINGW
)(LPSOCKADDR lpsaAddress
,DWORD dwAddressLength
,LPWSAPROTOCOL_INFOW lpProtocolInfo
,LPWSTR lpszAddressString
,LPDWORD lpdwAddressStringLength
);
1244 typedef INT (WSAAPI
*LPFN_WSASTRINGTOADDRESSA
)(LPSTR AddressString
,INT AddressFamily
,LPWSAPROTOCOL_INFOA lpProtocolInfo
,LPSOCKADDR lpAddress
,LPINT lpAddressLength
);
1245 typedef INT (WSAAPI
*LPFN_WSASTRINGTOADDRESSW
)(LPWSTR AddressString
,INT AddressFamily
,LPWSAPROTOCOL_INFOW lpProtocolInfo
,LPSOCKADDR lpAddress
,LPINT lpAddressLength
);
1246 typedef INT (WSAAPI
*LPFN_WSALOOKUPSERVICEBEGINA
)(LPWSAQUERYSETA lpqsRestrictions
,DWORD dwControlFlags
,LPHANDLE lphLookup
);
1247 typedef INT (WSAAPI
*LPFN_WSALOOKUPSERVICEBEGINW
)(LPWSAQUERYSETW lpqsRestrictions
,DWORD dwControlFlags
,LPHANDLE lphLookup
);
1248 typedef INT (WSAAPI
*LPFN_WSALOOKUPSERVICENEXTA
)(HANDLE hLookup
,DWORD dwControlFlags
,LPDWORD lpdwBufferLength
,LPWSAQUERYSETA lpqsResults
);
1249 typedef INT (WSAAPI
*LPFN_WSALOOKUPSERVICENEXTW
)(HANDLE hLookup
,DWORD dwControlFlags
,LPDWORD lpdwBufferLength
,LPWSAQUERYSETW lpqsResults
);
1250 typedef INT (WSAAPI
*LPFN_WSANSPIOCTL
)(HANDLE hLookup
,DWORD dwControlCode
,LPVOID lpvInBuffer
,DWORD cbInBuffer
,LPVOID lpvOutBuffer
,DWORD cbOutBuffer
,LPDWORD lpcbBytesReturned
,LPWSACOMPLETION lpCompletion
);
1251 typedef INT (WSAAPI
*LPFN_WSALOOKUPSERVICEEND
)(HANDLE hLookup
);
1252 typedef INT (WSAAPI
*LPFN_WSAINSTALLSERVICECLASSA
)(LPWSASERVICECLASSINFOA lpServiceClassInfo
);
1253 typedef INT (WSAAPI
*LPFN_WSAINSTALLSERVICECLASSW
)(LPWSASERVICECLASSINFOW lpServiceClassInfo
);
1254 typedef INT (WSAAPI
*LPFN_WSAREMOVESERVICECLASS
)(LPGUID lpServiceClassId
);
1255 typedef INT (WSAAPI
*LPFN_WSAGETSERVICECLASSINFOA
)(LPGUID lpProviderId
,LPGUID lpServiceClassId
,LPDWORD lpdwBufSize
,LPWSASERVICECLASSINFOA lpServiceClassInfo
);
1256 typedef INT (WSAAPI
*LPFN_WSAGETSERVICECLASSINFOW
)(LPGUID lpProviderId
,LPGUID lpServiceClassId
,LPDWORD lpdwBufSize
,LPWSASERVICECLASSINFOW lpServiceClassInfo
);
1257 typedef INT (WSAAPI
*LPFN_WSAENUMNAMESPACEPROVIDERSA
)(LPDWORD lpdwBufferLength
,LPWSANAMESPACE_INFOA lpnspBuffer
);
1258 typedef INT (WSAAPI
*LPFN_WSAENUMNAMESPACEPROVIDERSW
)(LPDWORD lpdwBufferLength
,LPWSANAMESPACE_INFOW lpnspBuffer
);
1259 typedef INT (WSAAPI
*LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA
)(LPGUID lpServiceClassId
,LPSTR lpszServiceClassName
,LPDWORD lpdwBufferLength
);
1260 typedef INT (WSAAPI
*LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW
)(LPGUID lpServiceClassId
,LPWSTR lpszServiceClassName
,LPDWORD lpdwBufferLength
);
1261 typedef INT (WSAAPI
*LPFN_WSASETSERVICEA
)(LPWSAQUERYSETA lpqsRegInfo
,WSAESETSERVICEOP essoperation
,DWORD dwControlFlags
);
1262 typedef INT (WSAAPI
*LPFN_WSASETSERVICEW
)(LPWSAQUERYSETW lpqsRegInfo
,WSAESETSERVICEOP essoperation
,DWORD dwControlFlags
);
1263 typedef INT (WSAAPI
*LPFN_WSAPROVIDERCONFIGCHANGE
)(LPHANDLE lpNotificationHandle
,LPWSAOVERLAPPED lpOverlapped
,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
1267 #define WSADuplicateSocket WSADuplicateSocketW
1268 #define WSAEnumProtocols WSAEnumProtocolsW
1269 #define WSAAddressToString WSAAddressToStringW
1270 #define WSASocket WSASocketW
1271 #define WSAStringToAddress WSAStringToAddressW
1272 #define WSALookupServiceBegin WSALookupServiceBeginW
1273 #define WSALookupServiceNext WSALookupServiceNextW
1274 #define WSAInstallServiceClass WSAInstallServiceClassW
1275 #define WSAGetServiceClassInfo WSAGetServiceClassInfoW
1276 #define WSAEnumNameSpaceProviders WSAEnumNameSpaceProvidersW
1277 #define WSAGetServiceClassNameByClassId WSAGetServiceClassNameByClassIdW
1278 #define WSASetService WSASetServiceW
1280 #define WSADuplicateSocket WSADuplicateSocketA
1281 #define WSAEnumProtocols WSAEnumProtocolsA
1282 #define WSASocket WSASocketA
1283 #define WSAAddressToString WSAAddressToStringA
1284 #define WSAStringToAddress WSAStringToAddressA
1285 #define WSALookupServiceBegin WSALookupServiceBeginA
1286 #define WSALookupServiceNext WSALookupServiceNextA
1287 #define WSAInstallServiceClass WSAInstallServiceClassA
1288 #define WSAGetServiceClassInfo WSAGetServiceClassInfoA
1289 #define WSAEnumNameSpaceProviders WSAEnumNameSpaceProvidersA
1290 #define WSAGetServiceClassNameByClassId WSAGetServiceClassNameByClassIdA
1291 #define WSASetService WSASetServiceA
1294 WINSOCK_API_LINKAGE SOCKET WSAAPI
accept(SOCKET s
,struct sockaddr
*addr
,int *addrlen
);
1295 WINSOCK_API_LINKAGE
int WSAAPI
bind(SOCKET s
,const struct sockaddr
*name
,int namelen
);
1296 WINSOCK_API_LINKAGE
int WSAAPI
closesocket(SOCKET s
);
1297 WINSOCK_API_LINKAGE
int WSAAPI
connect(SOCKET s
,const struct sockaddr
*name
,int namelen
);
1298 WINSOCK_API_LINKAGE
int WSAAPI
ioctlsocket(SOCKET s
,long cmd
,u_long
*argp
);
1299 WINSOCK_API_LINKAGE
int WSAAPI
getpeername(SOCKET s
,struct sockaddr
*name
,int *namelen
);
1300 WINSOCK_API_LINKAGE
int WSAAPI
getsockname(SOCKET s
,struct sockaddr
*name
,int *namelen
);
1301 WINSOCK_API_LINKAGE
int WSAAPI
getsockopt(SOCKET s
,int level
,int optname
,char *optval
,int *optlen
);
1302 WINSOCK_API_LINKAGE u_long WSAAPI
htonl(u_long hostlong
);
1303 WINSOCK_API_LINKAGE u_short WSAAPI
htons(u_short hostshort
);
1304 WINSOCK_API_LINKAGE
unsigned long WSAAPI
inet_addr(const char *cp
);
1305 WINSOCK_API_LINKAGE
char *WSAAPI
inet_ntoa(struct in_addr in
);
1306 WINSOCK_API_LINKAGE
int WSAAPI
listen(SOCKET s
,int backlog
);
1307 WINSOCK_API_LINKAGE u_long WSAAPI
ntohl(u_long netlong
);
1308 WINSOCK_API_LINKAGE u_short WSAAPI
ntohs(u_short netshort
);
1309 WINSOCK_API_LINKAGE
int WSAAPI
recv(SOCKET s
,char *buf
,int len
,int flags
);
1310 WINSOCK_API_LINKAGE
int WSAAPI
recvfrom(SOCKET s
,char *buf
,int len
,int flags
,struct sockaddr
*from
,int *fromlen
);
1311 WINSOCK_API_LINKAGE
int WSAAPI
select(int nfds
,fd_set
*readfds
,fd_set
*writefds
,fd_set
*exceptfds
,const struct timeval
*timeout
);
1312 WINSOCK_API_LINKAGE
int WSAAPI
send(SOCKET s
,const char *buf
,int len
,int flags
);
1313 WINSOCK_API_LINKAGE
int WSAAPI
sendto(SOCKET s
,const char *buf
,int len
,int flags
,const struct sockaddr
*to
,int tolen
);
1314 WINSOCK_API_LINKAGE
int WSAAPI
setsockopt(SOCKET s
,int level
,int optname
,const char *optval
,int optlen
);
1315 WINSOCK_API_LINKAGE
int WSAAPI
shutdown(SOCKET s
,int how
);
1316 WINSOCK_API_LINKAGE SOCKET WSAAPI
socket(int af
,int type
,int protocol
);
1317 WINSOCK_API_LINKAGE
struct hostent
*WSAAPI
gethostbyaddr(const char *addr
,int len
,int type
);
1318 WINSOCK_API_LINKAGE
struct hostent
*WSAAPI
gethostbyname(const char *name
);
1319 WINSOCK_API_LINKAGE
int WSAAPI
gethostname(char *name
,int namelen
);
1320 WINSOCK_API_LINKAGE
struct servent
*WSAAPI
getservbyport(int port
,const char *proto
);
1321 WINSOCK_API_LINKAGE
struct servent
*WSAAPI
getservbyname(const char *name
,const char *proto
);
1322 WINSOCK_API_LINKAGE
struct protoent
*WSAAPI
getprotobynumber(int number
);
1323 WINSOCK_API_LINKAGE
struct protoent
*WSAAPI
getprotobyname(const char *name
);
1324 WINSOCK_API_LINKAGE
int WSAAPI
WSAStartup(WORD wVersionRequested
,LPWSADATA lpWSAData
);
1325 WINSOCK_API_LINKAGE
int WSAAPI
WSACleanup(void);
1326 WINSOCK_API_LINKAGE
void WSAAPI
WSASetLastError(int iError
);
1327 WINSOCK_API_LINKAGE
int WSAAPI
WSAGetLastError(void);
1328 WINSOCK_API_LINKAGE WINBOOL WSAAPI
WSAIsBlocking(void);
1329 WINSOCK_API_LINKAGE
int WSAAPI
WSAUnhookBlockingHook(void);
1330 WINSOCK_API_LINKAGE FARPROC WSAAPI
WSASetBlockingHook(FARPROC lpBlockFunc
);
1331 WINSOCK_API_LINKAGE
int WSAAPI
WSACancelBlockingCall(void);
1332 WINSOCK_API_LINKAGE HANDLE WSAAPI
WSAAsyncGetServByName(HWND hWnd
,u_int wMsg
,const char *name
,const char *proto
,char *buf
,int buflen
);
1333 WINSOCK_API_LINKAGE HANDLE WSAAPI
WSAAsyncGetServByPort(HWND hWnd
,u_int wMsg
,int port
,const char *proto
,char *buf
,int buflen
);
1334 WINSOCK_API_LINKAGE HANDLE WSAAPI
WSAAsyncGetProtoByName(HWND hWnd
,u_int wMsg
,const char *name
,char *buf
,int buflen
);
1335 WINSOCK_API_LINKAGE HANDLE WSAAPI
WSAAsyncGetProtoByNumber(HWND hWnd
,u_int wMsg
,int number
,char *buf
,int buflen
);
1336 WINSOCK_API_LINKAGE HANDLE WSAAPI
WSAAsyncGetHostByName(HWND hWnd
,u_int wMsg
,const char *name
,char *buf
,int buflen
);
1337 WINSOCK_API_LINKAGE HANDLE WSAAPI
WSAAsyncGetHostByAddr(HWND hWnd
,u_int wMsg
,const char *addr
,int len
,int type
,char *buf
,int buflen
);
1338 WINSOCK_API_LINKAGE
int WSAAPI
WSACancelAsyncRequest(HANDLE hAsyncTaskHandle
);
1339 WINSOCK_API_LINKAGE
int WSAAPI
WSAAsyncSelect(SOCKET s
,HWND hWnd
,u_int wMsg
,long lEvent
);
1340 WINSOCK_API_LINKAGE SOCKET WSAAPI
WSAAccept(SOCKET s
,struct sockaddr
*addr
,LPINT addrlen
,LPCONDITIONPROC lpfnCondition
,DWORD_PTR dwCallbackData
);
1341 WINSOCK_API_LINKAGE WINBOOL WSAAPI
WSACloseEvent(WSAEVENT hEvent
);
1342 WINSOCK_API_LINKAGE
int WSAAPI
WSAConnect(SOCKET s
,const struct sockaddr
*name
,int namelen
,LPWSABUF lpCallerData
,LPWSABUF lpCalleeData
,LPQOS lpSQOS
,LPQOS lpGQOS
);
1343 WINSOCK_API_LINKAGE WSAEVENT WSAAPI
WSACreateEvent(void);
1344 WINSOCK_API_LINKAGE
int WSAAPI
WSADuplicateSocketA(SOCKET s
,DWORD dwProcessId
,LPWSAPROTOCOL_INFOA lpProtocolInfo
);
1345 WINSOCK_API_LINKAGE
int WSAAPI
WSADuplicateSocketW(SOCKET s
,DWORD dwProcessId
,LPWSAPROTOCOL_INFOW lpProtocolInfo
);
1346 WINSOCK_API_LINKAGE
int WSAAPI
WSAEnumNetworkEvents(SOCKET s
,WSAEVENT hEventObject
,LPWSANETWORKEVENTS lpNetworkEvents
);
1347 WINSOCK_API_LINKAGE
int WSAAPI
WSAEnumProtocolsA(LPINT lpiProtocols
,LPWSAPROTOCOL_INFOA lpProtocolBuffer
,LPDWORD lpdwBufferLength
);
1348 WINSOCK_API_LINKAGE
int WSAAPI
WSAEnumProtocolsW(LPINT lpiProtocols
,LPWSAPROTOCOL_INFOW lpProtocolBuffer
,LPDWORD lpdwBufferLength
);
1349 WINSOCK_API_LINKAGE
int WSAAPI
WSAEventSelect(SOCKET s
,WSAEVENT hEventObject
,long lNetworkEvents
);
1350 WINSOCK_API_LINKAGE WINBOOL WSAAPI
WSAGetOverlappedResult(SOCKET s
,LPWSAOVERLAPPED lpOverlapped
,LPDWORD lpcbTransfer
,WINBOOL fWait
,LPDWORD lpdwFlags
);
1351 WINSOCK_API_LINKAGE WINBOOL WSAAPI
WSAGetQOSByName(SOCKET s
,LPWSABUF lpQOSName
,LPQOS lpQOS
);
1352 WINSOCK_API_LINKAGE
int WSAAPI
WSAHtonl(SOCKET s
,u_long hostlong
,u_long
*lpnetlong
);
1353 WINSOCK_API_LINKAGE
int WSAAPI
WSAHtons(SOCKET s
,u_short hostshort
,u_short
*lpnetshort
);
1354 WINSOCK_API_LINKAGE
int WSAAPI
WSAIoctl(SOCKET s
,DWORD dwIoControlCode
,LPVOID lpvInBuffer
,DWORD cbInBuffer
,LPVOID lpvOutBuffer
,DWORD cbOutBuffer
,LPDWORD lpcbBytesReturned
,LPWSAOVERLAPPED lpOverlapped
,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
1355 WINSOCK_API_LINKAGE SOCKET WSAAPI
WSAJoinLeaf(SOCKET s
,const struct sockaddr
*name
,int namelen
,LPWSABUF lpCallerData
,LPWSABUF lpCalleeData
,LPQOS lpSQOS
,LPQOS lpGQOS
,DWORD dwFlags
);
1356 WINSOCK_API_LINKAGE
int WSAAPI
WSANtohl(SOCKET s
,u_long netlong
,u_long
*lphostlong
);
1357 WINSOCK_API_LINKAGE
int WSAAPI
WSANtohs(SOCKET s
,u_short netshort
,u_short
*lphostshort
);
1358 WINSOCK_API_LINKAGE
int WSAAPI
WSARecv(SOCKET s
,LPWSABUF lpBuffers
,DWORD dwBufferCount
,LPDWORD lpNumberOfBytesRecvd
,LPDWORD lpFlags
,LPWSAOVERLAPPED lpOverlapped
,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
1359 WINSOCK_API_LINKAGE
int WSAAPI
WSARecvDisconnect(SOCKET s
,LPWSABUF lpInboundDisconnectData
);
1360 WINSOCK_API_LINKAGE
int WSAAPI
WSARecvFrom(SOCKET s
,LPWSABUF lpBuffers
,DWORD dwBufferCount
,LPDWORD lpNumberOfBytesRecvd
,LPDWORD lpFlags
,struct sockaddr
*lpFrom
,LPINT lpFromlen
,LPWSAOVERLAPPED lpOverlapped
,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
1361 WINSOCK_API_LINKAGE WINBOOL WSAAPI
WSAResetEvent(WSAEVENT hEvent
);
1362 WINSOCK_API_LINKAGE
int WSAAPI
WSASend(SOCKET s
,LPWSABUF lpBuffers
,DWORD dwBufferCount
,LPDWORD lpNumberOfBytesSent
,DWORD dwFlags
,LPWSAOVERLAPPED lpOverlapped
,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
1363 WINSOCK_API_LINKAGE
int WSAAPI
WSASendDisconnect(SOCKET s
,LPWSABUF lpOutboundDisconnectData
);
1364 WINSOCK_API_LINKAGE
int WSAAPI
WSASendTo(SOCKET s
,LPWSABUF lpBuffers
,DWORD dwBufferCount
,LPDWORD lpNumberOfBytesSent
,DWORD dwFlags
,const struct sockaddr
*lpTo
,int iTolen
,LPWSAOVERLAPPED lpOverlapped
,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
1365 WINSOCK_API_LINKAGE WINBOOL WSAAPI
WSASetEvent(WSAEVENT hEvent
);
1366 WINSOCK_API_LINKAGE SOCKET WSAAPI
WSASocketA(int af
,int type
,int protocol
,LPWSAPROTOCOL_INFOA lpProtocolInfo
,GROUP g
,DWORD dwFlags
);
1367 WINSOCK_API_LINKAGE SOCKET WSAAPI
WSASocketW(int af
,int type
,int protocol
,LPWSAPROTOCOL_INFOW lpProtocolInfo
,GROUP g
,DWORD dwFlags
);
1368 WINSOCK_API_LINKAGE DWORD WSAAPI
WSAWaitForMultipleEvents(DWORD cEvents
,const WSAEVENT
*lphEvents
,WINBOOL fWaitAll
,DWORD dwTimeout
,WINBOOL fAlertable
);
1369 WINSOCK_API_LINKAGE INT WSAAPI
WSAAddressToStringA(LPSOCKADDR lpsaAddress
,DWORD dwAddressLength
,LPWSAPROTOCOL_INFOA lpProtocolInfo
,LPSTR lpszAddressString
,LPDWORD lpdwAddressStringLength
);
1370 WINSOCK_API_LINKAGE INT WSAAPI
WSAAddressToStringW(LPSOCKADDR lpsaAddress
,DWORD dwAddressLength
,LPWSAPROTOCOL_INFOW lpProtocolInfo
,LPWSTR lpszAddressString
,LPDWORD lpdwAddressStringLength
);
1371 WINSOCK_API_LINKAGE INT WSAAPI
WSAStringToAddressA(LPSTR AddressString
,INT AddressFamily
,LPWSAPROTOCOL_INFOA lpProtocolInfo
,LPSOCKADDR lpAddress
,LPINT lpAddressLength
);
1372 WINSOCK_API_LINKAGE INT WSAAPI
WSAStringToAddressW(LPWSTR AddressString
,INT AddressFamily
,LPWSAPROTOCOL_INFOW lpProtocolInfo
,LPSOCKADDR lpAddress
,LPINT lpAddressLength
);
1373 WINSOCK_API_LINKAGE INT WSAAPI
WSALookupServiceBeginA(LPWSAQUERYSETA lpqsRestrictions
,DWORD dwControlFlags
,LPHANDLE lphLookup
);
1374 WINSOCK_API_LINKAGE INT WSAAPI
WSALookupServiceBeginW(LPWSAQUERYSETW lpqsRestrictions
,DWORD dwControlFlags
,LPHANDLE lphLookup
);
1375 WINSOCK_API_LINKAGE INT WSAAPI
WSALookupServiceNextA(HANDLE hLookup
,DWORD dwControlFlags
,LPDWORD lpdwBufferLength
,LPWSAQUERYSETA lpqsResults
);
1376 WINSOCK_API_LINKAGE INT WSAAPI
WSALookupServiceNextW(HANDLE hLookup
,DWORD dwControlFlags
,LPDWORD lpdwBufferLength
,LPWSAQUERYSETW lpqsResults
);
1377 WINSOCK_API_LINKAGE INT WSAAPI
WSANSPIoctl(HANDLE hLookup
,DWORD dwControlCode
,LPVOID lpvInBuffer
,DWORD cbInBuffer
,LPVOID lpvOutBuffer
,DWORD cbOutBuffer
,LPDWORD lpcbBytesReturned
,LPWSACOMPLETION lpCompletion
);
1378 WINSOCK_API_LINKAGE INT WSAAPI
WSALookupServiceEnd(HANDLE hLookup
);
1379 WINSOCK_API_LINKAGE INT WSAAPI
WSAInstallServiceClassA(LPWSASERVICECLASSINFOA lpServiceClassInfo
);
1380 WINSOCK_API_LINKAGE INT WSAAPI
WSAInstallServiceClassW(LPWSASERVICECLASSINFOW lpServiceClassInfo
);
1381 WINSOCK_API_LINKAGE INT WSAAPI
WSARemoveServiceClass(LPGUID lpServiceClassId
);
1382 WINSOCK_API_LINKAGE INT WSAAPI
WSAGetServiceClassInfoA(LPGUID lpProviderId
,LPGUID lpServiceClassId
,LPDWORD lpdwBufSize
,LPWSASERVICECLASSINFOA lpServiceClassInfo
);
1383 WINSOCK_API_LINKAGE INT WSAAPI
WSAGetServiceClassInfoW(LPGUID lpProviderId
,LPGUID lpServiceClassId
,LPDWORD lpdwBufSize
,LPWSASERVICECLASSINFOW lpServiceClassInfo
);
1384 WINSOCK_API_LINKAGE INT WSAAPI
WSAEnumNameSpaceProvidersA(LPDWORD lpdwBufferLength
,LPWSANAMESPACE_INFOA lpnspBuffer
);
1385 WINSOCK_API_LINKAGE INT WSAAPI
WSAEnumNameSpaceProvidersW(LPDWORD lpdwBufferLength
,LPWSANAMESPACE_INFOW lpnspBuffer
);
1386 WINSOCK_API_LINKAGE INT WSAAPI
WSAGetServiceClassNameByClassIdA(LPGUID lpServiceClassId
,LPSTR lpszServiceClassName
,LPDWORD lpdwBufferLength
);
1387 WINSOCK_API_LINKAGE INT WSAAPI
WSAGetServiceClassNameByClassIdW(LPGUID lpServiceClassId
,LPWSTR lpszServiceClassName
,LPDWORD lpdwBufferLength
);
1388 WINSOCK_API_LINKAGE INT WSAAPI
WSASetServiceA(LPWSAQUERYSETA lpqsRegInfo
,WSAESETSERVICEOP essoperation
,DWORD dwControlFlags
);
1389 WINSOCK_API_LINKAGE INT WSAAPI
WSASetServiceW(LPWSAQUERYSETW lpqsRegInfo
,WSAESETSERVICEOP essoperation
,DWORD dwControlFlags
);
1390 WINSOCK_API_LINKAGE INT WSAAPI
WSAProviderConfigChange(LPHANDLE lpNotificationHandle
,LPWSAOVERLAPPED lpOverlapped
,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
1392 typedef struct sockaddr_in SOCKADDR_IN
;
1393 typedef struct sockaddr_in
*PSOCKADDR_IN
;
1394 typedef struct sockaddr_in
*LPSOCKADDR_IN
;
1396 typedef struct linger LINGER
;
1397 typedef struct linger
*PLINGER
;
1398 typedef struct linger
*LPLINGER
;
1400 typedef struct in_addr IN_ADDR
;
1401 typedef struct in_addr
*PIN_ADDR
;
1402 typedef struct in_addr
*LPIN_ADDR
;
1404 typedef struct fd_set FD_SET
;
1405 typedef struct fd_set
*PFD_SET
;
1406 typedef struct fd_set
*LPFD_SET
;
1408 typedef struct hostent HOSTENT
;
1409 typedef struct hostent
*PHOSTENT
;
1410 typedef struct hostent
*LPHOSTENT
;
1412 typedef struct servent SERVENT
;
1413 typedef struct servent
*PSERVENT
;
1414 typedef struct servent
*LPSERVENT
;
1416 typedef struct protoent PROTOENT
;
1417 typedef struct protoent
*PPROTOENT
;
1418 typedef struct protoent
*LPPROTOENT
;
1420 typedef struct timeval TIMEVAL
;
1421 typedef struct timeval
*PTIMEVAL
;
1422 typedef struct timeval
*LPTIMEVAL
;
1424 #define WSAMAKEASYNCREPLY(buflen,error) MAKELONG(buflen,error)
1425 #define WSAMAKESELECTREPLY(event,error) MAKELONG(event,error)
1426 #define WSAGETASYNCBUFLEN(lParam) LOWORD(lParam)
1427 #define WSAGETASYNCERROR(lParam) HIWORD(lParam)
1428 #define WSAGETSELECTEVENT(lParam) LOWORD(lParam)
1429 #define WSAGETSELECTERROR(lParam) HIWORD(lParam)
1431 /* #if (_WIN32_WINNT >= 0x0600) */
1432 #define POLLRDNORM 0x0100
1433 #define POLLRDBAND 0x0200
1434 #define POLLIN (POLLRDNORM | POLLRDBAND)
1435 #define POLLPRI 0x0400
1437 #define POLLWRNORM 0x0010
1438 #define POLLOUT (POLLWRNORM)
1439 #define POLLWRBAND 0x0020
1441 #define POLLERR 0x0001
1442 #define POLLHUP 0x0002
1443 #define POLLNVAL 0x0004
1445 typedef struct pollfd
{
1449 } WSAPOLLFD
, *PWSAPOLLFD
, FAR
*LPWSAPOLLFD
;
1451 WINSOCK_API_LINKAGE
int WSAAPI
WSAPoll(LPWSAPOLLFD fdArray
, ULONG fds
, INT timeout
);
1452 /* #endif // (_WIN32_WINNT >= 0x0600) */
1458 #ifdef _NEED_POPPACK
1459 #include <poppack.h>
1463 #include <wsipv6ok.h>
1466 #ifndef _WINSOCKAPI_
1467 #define _WINSOCKAPI_
1470 #ifdef _INC_WINSOCK_H
1471 #include <mswsock.h>