ReactOS  0.4.13-dev-257-gfabbd7c
winsock.h
Go to the documentation of this file.
1 /*
2  Definitions for winsock 1.1
3 
4  Portions Copyright (c) 1980, 1983, 1988, 1993
5  The Regents of the University of California. All rights reserved.
6 
7  Portions Copyright (c) 1993 by Digital Equipment Corporation.
8  */
9 
10 #pragma once
11 
12 #define _WINSOCKAPI_
13 
14 #ifndef _INC_WINDOWS
15 #include <windows.h>
16 #endif
17 
18 #if defined(__LP64__) || (!defined(_M_AMD64) && defined(__WINESRC__))
19 #if !defined(__ROS_LONG64__)
20 #define __ROS_LONG64__
21 #endif
22 #endif
23 
24 #define _GNU_H_WINDOWS32_SOCKETS
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #if !defined ( _BSDTYPES_DEFINED )
31 
32 /* also defined in gmon.h and in cygwin's sys/types */
33 typedef unsigned char u_char;
34 typedef unsigned short u_short;
35 typedef unsigned int u_int;
36 
37 #ifndef __ROS_LONG64__
38 typedef unsigned long u_long;
39 #else
40 typedef unsigned int u_long;
41 #endif
42 
43 #define _BSDTYPES_DEFINED
44 
45 #endif /* !defined ( _BSDTYPES_DEFINED ) */
46 
47 typedef UINT_PTR SOCKET;
48 
49 #ifndef FD_SETSIZE
50 #define FD_SETSIZE 64
51 #endif
52 
53 /* shutdown() how types */
54 #define SD_RECEIVE 0x00
55 #define SD_SEND 0x01
56 #define SD_BOTH 0x02
57 
58 #ifndef _SYS_TYPES_FD_SET
59 
60 /* fd_set may have be defined by the newlib <sys/types.h>
61  * if __USE_W32_SOCKETS not defined.
62  */
63 #ifdef fd_set
64 #undef fd_set
65 #endif
66 typedef struct fd_set {
69 } fd_set;
70 
71 extern int PASCAL __WSAFDIsSet(SOCKET,fd_set FAR*);
72 
73 #ifndef FD_CLR
74 #define FD_CLR(fd,set) do { u_int __i;\
75 for (__i = 0; __i < ((fd_set FAR*)(set))->fd_count ; __i++) {\
76  if (((fd_set FAR*)(set))->fd_array[__i] == (fd)) {\
77  while (__i < ((fd_set FAR*)(set))->fd_count-1) {\
78  ((fd_set FAR*)(set))->fd_array[__i] = ((fd_set FAR*)(set))->fd_array[__i+1];\
79  __i++;\
80  }\
81  ((fd_set FAR*)(set))->fd_count--;\
82  break;\
83  }\
84 }\
85 } while (0)
86 #endif /* FD_CLR */
87 
88 #ifndef FD_SET
89 #define FD_SET(fd, set) do { \
90  if (((fd_set FAR*)(set))->fd_count < FD_SETSIZE) \
91  ((fd_set FAR*)(set))->fd_array[((fd_set FAR*)(set))->fd_count++]=(fd);\
92 }while (0)
93 #endif
94 
95 #ifndef FD_ZERO
96 #define FD_ZERO(set) (((fd_set FAR*)(set))->fd_count=0)
97 #endif
98 
99 #ifndef FD_ISSET
100 #define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (fd_set FAR*)(set))
101 #endif
102 
103 
104 
105 #elif !defined(USE_SYS_TYPES_FD_SET)
106 #warning "fd_set and associated macros have been defined in sys/types. \
107  This can cause runtime problems with W32 sockets"
108 #endif /* ndef _SYS_TYPES_FD_SET */
109 
110 #if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
111 
112 #ifndef _TIMEVAL_DEFINED /* also in sys/time.h */
113 #define _TIMEVAL_DEFINED
114 
115 struct timeval {
118 };
119 
120 #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
121 
122 #define timercmp(tvp, uvp, cmp) \
123  (((tvp)->tv_sec != (uvp)->tv_sec) ? \
124  ((tvp)->tv_sec cmp (uvp)->tv_sec) : \
125  ((tvp)->tv_usec cmp (uvp)->tv_usec))
126 
127 #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
128 
129 #endif /* _TIMEVAL_DEFINED */
130 
131 #define h_addr h_addr_list[0]
132 
133 struct hostent {
134  char *h_name;
135  char **h_aliases;
136  short h_addrtype;
137  short h_length;
138  char **h_addr_list;
139 };
140 
141 struct linger {
144 };
145 
146 #define _IO(x,y) (IOC_VOID|((x)<<8)|(y))
147 #define _IOR(x,y,t) (IOC_OUT|(((LONG)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
148 #define _IOW(x,y,t) (IOC_IN|(((LONG)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
149 #define FIONBIO _IOW('f', 126, u_long)
150 
151 struct netent {
152  char * n_name;
153  char **n_aliases;
154  short n_addrtype;
156 };
157 
158 struct servent {
159  char *s_name;
160  char **s_aliases;
161 #ifdef _WIN64
162  char *s_proto;
163  short s_port;
164 #else
165  short s_port;
166  char *s_proto;
167 #endif
168 };
169 
170 struct protoent {
171  char *p_name;
172  char **p_aliases;
173  short p_proto;
174 };
175 
176 #define IP_OPTIONS 1
177 
178 #define SO_DEBUG 1
179 #define SO_ACCEPTCONN 2
180 #define SO_REUSEADDR 4
181 #define SO_KEEPALIVE 8
182 #define SO_DONTROUTE 16
183 #define SO_BROADCAST 32
184 #define SO_USELOOPBACK 64
185 #define SO_LINGER 128
186 #define SO_OOBINLINE 256
187 #define SO_DONTLINGER (u_int)(~SO_LINGER)
188 #define SO_SNDBUF 0x1001
189 #define SO_RCVBUF 0x1002
190 #define SO_SNDLOWAT 0x1003
191 #define SO_RCVLOWAT 0x1004
192 #define SO_SNDTIMEO 0x1005
193 #define SO_RCVTIMEO 0x1006
194 #define SO_ERROR 0x1007
195 #define SO_TYPE 0x1008
196 
197 #define SO_CONNDATA 0x7000
198 #define SO_CONNOPT 0x7001
199 #define SO_DISCDATA 0x7002
200 #define SO_DISCOPT 0x7003
201 #define SO_CONNDATALEN 0x7004
202 #define SO_CONNOPTLEN 0x7005
203 #define SO_DISCDATALEN 0x7006
204 #define SO_DISCOPTLEN 0x7007
205 #define SO_OPENTYPE 0x7008
206 #define SO_MAXDG 0x7009
207 #define SO_MAXPATHDG 0x700A
208 #define SO_UPDATE_ACCEPT_CONTEXT 0x700B
209 #define SO_CONNECT_TIME 0x700C
210 
211 #define SO_SYNCHRONOUS_ALERT 0x10
212 #define SO_SYNCHRONOUS_NONALERT 0x20
213 
214 #define AF_MAX 24
215 
216 struct sockaddr {
218  char sa_data[14];
219 };
220 
221 #define MSG_OOB 1
222 #define MSG_PEEK 2
223 #define MSG_DONTROUTE 4
224 
225 #define h_errno WSAGetLastError()
226 #define HOST_NOT_FOUND WSAHOST_NOT_FOUND
227 #define TRY_AGAIN WSATRY_AGAIN
228 #define NO_RECOVERY WSANO_RECOVERY
229 #define NO_DATA WSANO_DATA
230 #define NO_ADDRES WSANO_ADDRESS
231 
236 int PASCAL select(int nfds,fd_set*,fd_set*,fd_set*,const struct timeval*);
237 int PASCAL gethostname(char*,int);
238 
239 #endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
240 
241 #define IOCPARM_MASK 0x7f
242 #define IOC_VOID 0x20000000
243 #define IOC_OUT 0x40000000
244 #define IOC_IN 0x80000000
245 #define IOC_INOUT (IOC_IN|IOC_OUT)
246 
247 #define FIONREAD _IOR('f', 127, u_long)
248 #define FIOASYNC _IOW('f', 125, u_long)
249 #define SIOCSHIWAT _IOW('s', 0, u_long)
250 #define SIOCGHIWAT _IOR('s', 1, u_long)
251 #define SIOCSLOWAT _IOW('s', 2, u_long)
252 #define SIOCGLOWAT _IOR('s', 3, u_long)
253 #define SIOCATMARK _IOR('s', 7, u_long)
254 
255 #define IPPROTO_IP 0
256 #define IPPROTO_ICMP 1
257 #define IPPROTO_IGMP 2
258 #define IPPROTO_GGP 3
259 #define IPPROTO_TCP 6
260 #define IPPROTO_PUP 12
261 #define IPPROTO_UDP 17
262 #define IPPROTO_IDP 22
263 #define IPPROTO_ND 77
264 #define IPPROTO_RAW 255
265 #define IPPROTO_MAX 256
266 #define IPPORT_ECHO 7
267 #define IPPORT_DISCARD 9
268 #define IPPORT_SYSTAT 11
269 #define IPPORT_DAYTIME 13
270 #define IPPORT_NETSTAT 15
271 #define IPPORT_FTP 21
272 #define IPPORT_TELNET 23
273 #define IPPORT_SMTP 25
274 #define IPPORT_TIMESERVER 37
275 #define IPPORT_NAMESERVER 42
276 #define IPPORT_WHOIS 43
277 #define IPPORT_MTP 57
278 #define IPPORT_TFTP 69
279 #define IPPORT_RJE 77
280 #define IPPORT_FINGER 79
281 #define IPPORT_TTYLINK 87
282 #define IPPORT_SUPDUP 95
283 #define IPPORT_EXECSERVER 512
284 #define IPPORT_LOGINSERVER 513
285 #define IPPORT_CMDSERVER 514
286 #define IPPORT_EFSSERVER 520
287 #define IPPORT_BIFFUDP 512
288 #define IPPORT_WHOSERVER 513
289 #define IPPORT_ROUTESERVER 520
290 #define IPPORT_RESERVED 1024
291 #define IMPLINK_IP 155
292 #define IMPLINK_LOWEXPER 156
293 #define IMPLINK_HIGHEXPER 158
294 
295 #include <inaddr.h>
296 
297 #define IN_CLASSA(i) ((LONG)(i)&0x80000000)
298 #define IN_CLASSA_NET 0xff000000
299 #define IN_CLASSA_NSHIFT 24
300 #define IN_CLASSA_HOST 0x00ffffff
301 #define IN_CLASSA_MAX 128
302 #define IN_CLASSB(i) (((LONG)(i)&0xc0000000)==0x80000000)
303 #define IN_CLASSB_NET 0xffff0000
304 #define IN_CLASSB_NSHIFT 16
305 #define IN_CLASSB_HOST 0x0000ffff
306 #define IN_CLASSB_MAX 65536
307 #define IN_CLASSC(i) (((LONG)(i)&0xe0000000)==0xc0000000)
308 #define IN_CLASSC_NET 0xffffff00
309 #define IN_CLASSC_NSHIFT 8
310 #define IN_CLASSC_HOST 0xff
311 #define INADDR_ANY (u_long)0
312 #define INADDR_LOOPBACK 0x7f000001
313 #define INADDR_BROADCAST (u_long)0xffffffff
314 #define INADDR_NONE 0xffffffff
315 
316 #define WSADESCRIPTION_LEN 256
317 #define WSASYS_STATUS_LEN 128
318 
319 #define IP_MULTICAST_IF 2
320 #define IP_MULTICAST_TTL 3
321 #define IP_MULTICAST_LOOP 4
322 #define IP_ADD_MEMBERSHIP 5
323 #define IP_DROP_MEMBERSHIP 6
324 #define IP_TTL 7
325 #define IP_TOS 8
326 #define IP_DONTFRAGMENT 9
327 
328 #define IP_DEFAULT_MULTICAST_TTL 1
329 #define IP_DEFAULT_MULTICAST_LOOP 1
330 #define IP_MAX_MEMBERSHIPS 20
331 
332 #define INVALID_SOCKET (SOCKET)(~0)
333 #define SOCKET_ERROR (-1)
334 
335 #define SOCK_STREAM 1
336 #define SOCK_DGRAM 2
337 #define SOCK_RAW 3
338 #define SOCK_RDM 4
339 #define SOCK_SEQPACKET 5
340 
341 #define TCP_NODELAY 0x0001
342 #define TCP_BSDURGENT 0x7000
343 
344 #define AF_UNSPEC 0
345 #define AF_UNIX 1
346 #define AF_INET 2
347 #define AF_IMPLINK 3
348 #define AF_PUP 4
349 #define AF_CHAOS 5
350 #define AF_IPX 6
351 #define AF_NS 6
352 #define AF_ISO 7
353 #define AF_OSI AF_ISO
354 #define AF_ECMA 8
355 #define AF_DATAKIT 9
356 #define AF_CCITT 10
357 #define AF_SNA 11
358 #define AF_DECnet 12
359 #define AF_DLI 13
360 #define AF_LAT 14
361 #define AF_HYLINK 15
362 #define AF_APPLETALK 16
363 #define AF_NETBIOS 17
364 #define AF_VOICEVIEW 18
365 #define AF_FIREFOX 19
366 #define AF_UNKNOWN1 20
367 #define AF_BAN 21
368 #define AF_ATM 22
369 #define AF_INET6 23
370 
371 #define PF_UNSPEC AF_UNSPEC
372 #define PF_UNIX AF_UNIX
373 #define PF_INET AF_INET
374 #define PF_IMPLINK AF_IMPLINK
375 #define PF_PUP AF_PUP
376 #define PF_CHAOS AF_CHAOS
377 #define PF_NS AF_NS
378 #define PF_IPX AF_IPX
379 #define PF_ISO AF_ISO
380 #define PF_OSI AF_OSI
381 #define PF_ECMA AF_ECMA
382 #define PF_DATAKIT AF_DATAKIT
383 #define PF_CCITT AF_CCITT
384 #define PF_SNA AF_SNA
385 #define PF_DECnet AF_DECnet
386 #define PF_DLI AF_DLI
387 #define PF_LAT AF_LAT
388 #define PF_HYLINK AF_HYLINK
389 #define PF_APPLETALK AF_APPLETALK
390 #define PF_VOICEVIEW AF_VOICEVIEW
391 #define PF_FIREFOX AF_FIREFOX
392 #define PF_UNKNOWN1 AF_UNKNOWN1
393 #define PF_BAN AF_BAN
394 #define PF_ATM AF_ATM
395 #define PF_INET6 AF_INET6
396 #define PF_MAX AF_MAX
397 
398 #define SOL_SOCKET 0xffff
399 #define SOMAXCONN 5
400 
401 #define MSG_MAXIOVLEN 16
402 #define MSG_PARTIAL 0x8000
403 #define MAXGETHOSTSTRUCT 1024
404 
405 #define FD_READ 1
406 #define FD_WRITE 2
407 #define FD_OOB 4
408 #define FD_ACCEPT 8
409 #define FD_CONNECT 16
410 #define FD_CLOSE 32
411 
412 #ifndef WSABASEERR
413 
414 #define WSABASEERR 10000
415 #define WSAEINTR (WSABASEERR+4)
416 #define WSAEBADF (WSABASEERR+9)
417 #define WSAEACCES (WSABASEERR+13)
418 #define WSAEFAULT (WSABASEERR+14)
419 #define WSAEINVAL (WSABASEERR+22)
420 #define WSAEMFILE (WSABASEERR+24)
421 #define WSAEWOULDBLOCK (WSABASEERR+35)
422 #define WSAEINPROGRESS (WSABASEERR+36)
423 #define WSAEALREADY (WSABASEERR+37)
424 #define WSAENOTSOCK (WSABASEERR+38)
425 #define WSAEDESTADDRREQ (WSABASEERR+39)
426 #define WSAEMSGSIZE (WSABASEERR+40)
427 #define WSAEPROTOTYPE (WSABASEERR+41)
428 #define WSAENOPROTOOPT (WSABASEERR+42)
429 #define WSAEPROTONOSUPPORT (WSABASEERR+43)
430 #define WSAESOCKTNOSUPPORT (WSABASEERR+44)
431 #define WSAEOPNOTSUPP (WSABASEERR+45)
432 #define WSAEPFNOSUPPORT (WSABASEERR+46)
433 #define WSAEAFNOSUPPORT (WSABASEERR+47)
434 #define WSAEADDRINUSE (WSABASEERR+48)
435 #define WSAEADDRNOTAVAIL (WSABASEERR+49)
436 #define WSAENETDOWN (WSABASEERR+50)
437 #define WSAENETUNREACH (WSABASEERR+51)
438 #define WSAENETRESET (WSABASEERR+52)
439 #define WSAECONNABORTED (WSABASEERR+53)
440 #define WSAECONNRESET (WSABASEERR+54)
441 #define WSAENOBUFS (WSABASEERR+55)
442 #define WSAEISCONN (WSABASEERR+56)
443 #define WSAENOTCONN (WSABASEERR+57)
444 #define WSAESHUTDOWN (WSABASEERR+58)
445 #define WSAETOOMANYREFS (WSABASEERR+59)
446 #define WSAETIMEDOUT (WSABASEERR+60)
447 #define WSAECONNREFUSED (WSABASEERR+61)
448 #define WSAELOOP (WSABASEERR+62)
449 #define WSAENAMETOOLONG (WSABASEERR+63)
450 #define WSAEHOSTDOWN (WSABASEERR+64)
451 #define WSAEHOSTUNREACH (WSABASEERR+65)
452 #define WSAENOTEMPTY (WSABASEERR+66)
453 #define WSAEPROCLIM (WSABASEERR+67)
454 #define WSAEUSERS (WSABASEERR+68)
455 #define WSAEDQUOT (WSABASEERR+69)
456 #define WSAESTALE (WSABASEERR+70)
457 #define WSAEREMOTE (WSABASEERR+71)
458 #define WSASYSNOTREADY (WSABASEERR+91)
459 #define WSAVERNOTSUPPORTED (WSABASEERR+92)
460 #define WSANOTINITIALISED (WSABASEERR+93)
461 #define WSAEDISCON (WSABASEERR+101)
462 #define WSAHOST_NOT_FOUND (WSABASEERR+1001)
463 #define WSATRY_AGAIN (WSABASEERR+1002)
464 #define WSANO_RECOVERY (WSABASEERR+1003)
465 #define WSANO_DATA (WSABASEERR+1004)
466 #define WSA_SECURE_HOST_NOT_FOUND (WSABASEERR+1032)
467 #define WSA_IPSEC_NAME_POLICY_ERROR (WSABASEERR+1033)
468 
469 #endif /* !WSABASEERR */
470 
471 #define WSANO_ADDRESS WSANO_DATA
472 
473 #define TF_DISCONNECT 0x01
474 #define TF_REUSE_SOCKET 0x02
475 #define TF_WRITE_BEHIND 0x04
476 
477 #define WSAMAKEASYNCREPLY(b,e) MAKELONG(b,e)
478 #define WSAMAKESELECTREPLY(e,error) MAKELONG(e,error)
479 #define WSAGETASYNCBUFLEN(l) LOWORD(l)
480 #define WSAGETASYNCERROR(l) HIWORD(l)
481 #define WSAGETSELECTEVENT(l) LOWORD(l)
482 #define WSAGETSELECTERROR(l) HIWORD(l)
483 
484 typedef struct sockaddr SOCKADDR;
485 typedef struct sockaddr *PSOCKADDR;
486 typedef struct sockaddr *LPSOCKADDR;
487 typedef struct sockaddr_in SOCKADDR_IN;
488 typedef struct sockaddr_in *PSOCKADDR_IN;
489 typedef struct sockaddr_in *LPSOCKADDR_IN;
490 typedef struct linger LINGER;
491 typedef struct linger *PLINGER;
492 typedef struct linger *LPLINGER;
493 typedef struct fd_set FD_SET;
494 typedef struct fd_set *PFD_SET;
495 typedef struct fd_set *LPFD_SET;
496 typedef struct hostent HOSTENT;
497 typedef struct hostent *PHOSTENT;
498 typedef struct hostent *LPHOSTENT;
499 typedef struct servent SERVENT;
500 typedef struct servent *PSERVENT;
501 typedef struct servent *LPSERVENT;
502 typedef struct protoent PROTOENT;
503 typedef struct protoent *PPROTOENT;
504 typedef struct protoent *LPPROTOENT;
505 typedef struct timeval TIMEVAL;
506 typedef struct timeval *PTIMEVAL;
507 typedef struct timeval *LPTIMEVAL;
508 
509 struct sockaddr_in {
510  short sin_family;
513  char sin_zero[8];
514 };
515 
516 typedef struct WSAData {
519 #ifdef _WIN64
520  unsigned short iMaxSockets;
521  unsigned short iMaxUdpDg;
522  char *lpVendorInfo;
525 #else
528  unsigned short iMaxSockets;
529  unsigned short iMaxUdpDg;
531 #endif
532 } WSADATA, FAR *LPWSADATA;
533 
534 struct ip_mreq {
537 };
538 
539 struct sockproto {
542 };
543 
544 SOCKET
545 PASCAL FAR
546 accept(
547  _In_ SOCKET s,
548  _Out_writes_bytes_opt_(*addrlen) struct sockaddr FAR *addr,
549  _Inout_opt_ int FAR *addrlen);
550 
551 int
552 PASCAL FAR
553 bind(
554  _In_ SOCKET s,
555  _In_reads_bytes_(namelen) const struct sockaddr FAR *addr,
556  _In_ int namelen);
557 
558 int
559 PASCAL FAR
561  _In_ SOCKET s);
562 
563 int
564 PASCAL FAR
565 connect(
566  _In_ SOCKET s,
567  _In_reads_bytes_(namelen) const struct sockaddr FAR *name,
568  _In_ int namelen);
569 
570 int
571 PASCAL FAR
573  _In_ SOCKET s,
574  _In_ long cmd,
575  _Inout_ u_long FAR *argp);
576 
577 int
578 PASCAL FAR
580  _In_ SOCKET s,
582  _Inout_ int FAR *namelen);
583 
584 int
585 PASCAL FAR
587  _In_ SOCKET s,
589  _Inout_ int FAR *namelen);
590 
591 int
592 PASCAL FAR
593 getsockopt(
594  _In_ SOCKET s,
595  _In_ int level,
596  _In_ int optname,
597  _Out_writes_bytes_(*optlen) char FAR *optval,
598  _Inout_ int FAR *optlen);
599 
600 u_long
601 PASCAL FAR
602 htonl(
603  _In_ u_long hostlong);
604 
605 u_short
606 PASCAL FAR
607 htons(
608  _In_ u_short hostshort);
609 
610 unsigned long
611 PASCAL FAR
612 inet_addr(
613  _In_z_ const char FAR *cp);
614 
615 char FAR
616 *PASCAL FAR
617 inet_ntoa(
618  _In_ struct in_addr in);
619 
620 int
621 PASCAL FAR
622 listen(
623  _In_ SOCKET s,
624  _In_ int backlog);
625 
626 u_long
627 PASCAL FAR
628 ntohl(
629  _In_ u_long netlong);
630 
631 u_short
632 PASCAL FAR
633 ntohs(
634  _In_ u_short netshort);
635 
636 int
637 PASCAL FAR
638 recv(
639  _In_ SOCKET s,
641  _In_ int len,
642  _In_ int flags);
643 
644 int
645 PASCAL FAR
646 recvfrom(
647  _In_ SOCKET s,
649  _In_ int len,
650  _In_ int flags,
651  _Out_writes_bytes_to_opt_(*fromlen, *fromlen) struct sockaddr FAR *from,
652  _Inout_opt_ int FAR * fromlen);
653 
654 int
655 PASCAL FAR
656 select(
657  _In_ int nfds,
658  _Inout_opt_ fd_set FAR *readfds,
659  _Inout_opt_ fd_set FAR *writefds,
660  _Inout_opt_ fd_set FAR *exceptfds,
661  _In_opt_ const struct timeval FAR *timeout);
662 
663 int
664 PASCAL FAR
665 send(
666  _In_ SOCKET s,
667  _In_reads_bytes_(len) const char FAR *buf,
668  _In_ int len,
669  _In_ int flags);
670 
671 int
672 PASCAL FAR
673 sendto(
674  _In_ SOCKET s,
675  _In_reads_bytes_(len) const char FAR *buf,
676  _In_ int len,
677  _In_ int flags,
678  _In_reads_bytes_opt_(tolen) const struct sockaddr FAR *to,
679  _In_ int tolen);
680 
681 int
682 PASCAL FAR
683 setsockopt(
684  _In_ SOCKET s,
685  _In_ int level,
686  _In_ int optname,
687  _In_reads_bytes_opt_(optlen) const char FAR *optval,
688  _In_ int optlen);
689 
690 int
691 PASCAL FAR
692 shutdown(
693  _In_ SOCKET s,
694  _In_ int how);
695 
696 SOCKET
697 PASCAL FAR
698 socket(
699  _In_ int af,
700  _In_ int type,
701  _In_ int protocol);
702 
703 struct hostent FAR
704 *PASCAL FAR
706  _In_reads_bytes_(len) const char FAR *addr,
707  _In_ int len,
708  _In_ int type);
709 
710 struct hostent FAR
711 *PASCAL FAR
713  _In_z_ const char FAR *name);
714 
715 int
716 PASCAL FAR
718  _Out_writes_bytes_to_(namelen, return) char FAR *name,
719  _In_ int namelen);
720 
721 struct servent FAR
722 *PASCAL FAR
724  _In_ int port,
725  _In_z_ const char FAR *proto);
726 
727 struct servent FAR
728 *PASCAL FAR
730  _In_z_ const char FAR *name,
731  _In_z_ const char FAR *proto);
732 
733 struct protoent FAR
734 *PASCAL FAR
736  _In_ int number);
737 
738 struct protoent FAR
739 *PASCAL FAR
741  _In_z_ const char FAR *name);
742 
743 int
744 PASCAL FAR
745 WSAStartup(
746  _In_ WORD wVersionRequired,
747  _Out_ LPWSADATA lpWSAData);
748 
749 int
750 PASCAL FAR
751 WSACleanup(void);
752 
753 void
754 PASCAL FAR
756  _In_ int iError);
757 
758 int
759 PASCAL FAR
760 WSAGetLastError(void);
761 
762 BOOL
763 PASCAL FAR
764 WSAIsBlocking(void);
765 
766 int
767 PASCAL FAR
769 
770 FARPROC
771 PASCAL FAR
773  _In_ FARPROC lpBlockFunc);
774 
775 int
776 PASCAL FAR
778 
779 HANDLE
780 PASCAL FAR
782  _In_ HWND hWnd,
783  _In_ u_int wMsg,
784  _In_z_ const char FAR *name,
785  _In_z_ const char FAR *proto,
786  _Out_writes_bytes_(buflen) char FAR *buf,
787  _In_ int buflen);
788 
789 HANDLE
790 PASCAL FAR
792  _In_ HWND hWnd,
793  _In_ u_int wMsg,
794  _In_ int port,
795  _In_ const char FAR *proto,
796  _Out_writes_bytes_(buflen) char FAR *buf,
797  _In_ int buflen);
798 
799 HANDLE
800 PASCAL FAR
802  _In_ HWND hWnd,
803  _In_ u_int wMsg,
804  _In_z_ const char FAR *name,
805  _Out_writes_bytes_(buflen) char FAR *buf,
806  _In_ int buflen);
807 
808 HANDLE
809 PASCAL FAR
811  _In_ HWND hWnd,
812  _In_ u_int wMsg,
813  _In_ int number,
814  _Out_writes_bytes_(buflen) char FAR *buf,
815  _In_ int buflen);
816 
817 HANDLE
818 PASCAL FAR
820  _In_ HWND hWnd,
821  _In_ u_int wMsg,
822  _In_z_ const char FAR *name,
823  _Out_writes_bytes_(buflen) char FAR *buf,
824  _In_ int buflen);
825 
826 HANDLE
827 PASCAL FAR
829  _In_ HWND hWnd,
830  _In_ u_int wMsg,
831  _In_ const char FAR *addr,
832  _In_ int len,
833  _In_ int type,
834  _Out_writes_bytes_(buflen) char FAR *buf,
835  _In_ int buflen);
836 
837 int
838 PASCAL FAR
840  _In_ HANDLE hAsyncTaskHandle);
841 
842 int
843 PASCAL FAR
845  _In_ SOCKET s,
846  _In_ HWND hWnd,
847  _In_ u_int wMsg,
848  _In_ long lEvent);
849 
850 int
851 PASCAL FAR
852 WSARecvEx(
853  _In_ SOCKET s,
855  _In_ int len,
856  _Inout_ int FAR *flags);
857 
858 typedef struct _TRANSMIT_FILE_BUFFERS {
864 
865 BOOL
866 PASCAL FAR
868  _In_ SOCKET hSocket,
869  _In_ HANDLE hFile,
875 
876 BOOL
877 PASCAL FAR
878 AcceptEx(
879  _In_ SOCKET sListenSocket,
887 
888 VOID
889 PASCAL FAR
899 
900 #if(_WIN32_WINNT >= 0x0501)
901 
902 #ifdef IPV6STRICT
903 #error WINSOCK2 required.
904 #endif
905 
906 #endif /* (_WIN32_WINNT >= 0x0501) */
907 
908 #ifdef __cplusplus
909 }
910 #endif
struct sockaddr_in * LPSOCKADDR_IN
Definition: winsock.h:489
Definition: winsock.h:66
int PASCAL FAR WSAUnhookBlockingHook(void)
Definition: bhook.c:130
SOCKET fd_array[FD_SETSIZE]
Definition: winsock.h:68
_In_ DWORD _In_ DWORD _In_ DWORD _Outptr_result_bytebuffer_ LocalSockaddrLength struct sockaddr ** LocalSockaddr
Definition: mswsock.h:114
struct WSAData WSADATA
GLint level
Definition: gl.h:1546
char ** h_addr_list
Definition: winsock.h:138
SOCKET PASCAL FAR socket(_In_ int af, _In_ int type, _In_ int protocol)
struct in_addr imr_interface
Definition: winsock.h:536
_In_ SOCKET _In_ DWORD _In_ DWORD _In_ DWORD _Out_ LPDWORD lpdwBytesReceived
Definition: mswsock.h:102
unsigned int u_int
Definition: winsock.h:35
u_short sin_port
Definition: winsock.h:511
unsigned long u_long
Definition: linux.h:269
_In_ DWORD _In_ DWORD _In_ DWORD _Outptr_result_bytebuffer_ LocalSockaddrLength struct sockaddr _Out_ LPINT LocalSockaddrLength
Definition: mswsock.h:114
int PASCAL FAR shutdown(_In_ SOCKET s, _In_ int how)
#define _Out_writes_bytes_to_(size, count)
Definition: no_sal2.h:374
int PASCAL FAR getsockopt(_In_ SOCKET s, _In_ int level, _In_ int optname, _Out_writes_bytes_(*optlen) char FAR *optval, _Inout_ int FAR *optlen)
#define _Out_writes_bytes_to_opt_(size, count)
Definition: no_sal2.h:375
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
Definition: ftp_var.h:139
int PASCAL FAR getsockname(_In_ SOCKET s, _Out_writes_bytes_to_(*namelen, *namelen) struct sockaddr FAR *name, _Inout_ int FAR *namelen)
WORD wVersion
Definition: winsock.h:517
char * h_name
Definition: winsock.h:134
u_short l_linger
Definition: winsock.h:143
#define _In_reads_bytes_opt_(size)
Definition: no_sal2.h:230
struct protoent FAR *PASCAL FAR getprotobyname(_In_z_ const char FAR *name)
HANDLE PASCAL FAR WSAAsyncGetServByPort(_In_ HWND hWnd, _In_ u_int wMsg, _In_ int port, _In_ const char FAR *proto, _Out_writes_bytes_(buflen) char FAR *buf, _In_ int buflen)
struct fd_set * LPFD_SET
Definition: winsock.h:495
struct hostent FAR *PASCAL FAR gethostbyname(_In_z_ const char FAR *name)
HWND hWnd
Definition: settings.c:17
char ** h_aliases
Definition: winsock.h:135
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
HANDLE PASCAL FAR WSAAsyncGetProtoByName(_In_ HWND hWnd, _In_ u_int wMsg, _In_z_ const char FAR *name, _Out_writes_bytes_(buflen) char FAR *buf, _In_ int buflen)
struct fd_set fd_set
Definition: dhcpd.h:245
struct sockaddr * PSOCKADDR
Definition: winsock.h:485
_In_ DWORD _In_ DWORD _In_ DWORD _Outptr_result_bytebuffer_ LocalSockaddrLength struct sockaddr _Out_ LPINT _Outptr_result_bytebuffer_ RemoteSockaddrLength struct sockaddr ** RemoteSockaddr
Definition: mswsock.h:116
LONG tv_usec
Definition: winsock.h:117
struct timeval * LPTIMEVAL
Definition: winsock.h:507
int PASCAL FAR WSACleanup(void)
Definition: startup.c:60
unsigned short iMaxUdpDg
Definition: winsock.h:529
GLint namelen
Definition: glext.h:7232
struct servent * LPSERVENT
Definition: winsock.h:501
u_int fd_count
Definition: winsock.h:67
u_short sp_protocol
Definition: winsock.h:541
char sa_data[14]
Definition: winsock.h:218
#define _In_opt_
Definition: no_sal2.h:213
struct in_addr imr_multiaddr
Definition: winsock.h:535
int PASCAL __WSAFDIsSet(SOCKET, fd_set FAR *)
int PASCAL FAR getpeername(_In_ SOCKET s, _Out_writes_bytes_to_(*namelen, *namelen) struct sockaddr FAR *name, _Inout_ int FAR *namelen)
struct fd_set * PFD_SET
Definition: winsock.h:494
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
unsigned int BOOL
Definition: ntddk_ex.h:94
struct protoent FAR *PASCAL FAR getprotobynumber(_In_ int number)
long LONG
Definition: pedump.c:60
_In_ SOCKET _In_ DWORD _In_ DWORD _In_ DWORD dwRemoteAddressLength
Definition: mswsock.h:102
u_short PASCAL ntohs(u_short)
static size_t double number
Definition: printf.c:64
u_short sp_family
Definition: winsock.h:540
HANDLE PASCAL FAR WSAAsyncGetServByName(_In_ HWND hWnd, _In_ u_int wMsg, _In_z_ const char FAR *name, _In_z_ const char FAR *proto, _Out_writes_bytes_(buflen) char FAR *buf, _In_ int buflen)
#define FAR
Definition: guiddef.h:36
int PASCAL FAR connect(_In_ SOCKET s, _In_reads_bytes_(namelen) const struct sockaddr FAR *name, _In_ int namelen)
short h_length
Definition: winsock.h:137
short p_proto
Definition: winsock.h:173
#define _Out_writes_bytes_opt_(a)
Definition: btrfs_drv.h:171
int PASCAL FAR listen(_In_ SOCKET s, _In_ int backlog)
int PASCAL FAR WSAAsyncSelect(_In_ SOCKET s, _In_ HWND hWnd, _In_ u_int wMsg, _In_ long lEvent)
#define _Out_writes_bytes_(size)
Definition: no_sal2.h:370
#define _Out_
Definition: no_sal2.h:323
int PASCAL FAR ioctlsocket(_In_ SOCKET s, _In_ long cmd, _Inout_ u_long FAR *argp)
struct hostent FAR *PASCAL FAR gethostbyaddr(_In_reads_bytes_(len) const char FAR *addr, _In_ int len, _In_ int type)
unsigned long u_long
Definition: winsock.h:38
int PASCAL FAR recvfrom(_In_ SOCKET s, _Out_writes_bytes_to_(len, return) __out_data_source(NETWORK) char FAR *buf, _In_ int len, _In_ int flags, _Out_writes_bytes_to_opt_(*fromlen, *fromlen) struct sockaddr FAR *from, _Inout_opt_ int FAR *fromlen)
struct servent * PSERVENT
Definition: winsock.h:500
char szSystemStatus[WSASYS_STATUS_LEN+1]
Definition: winsock.h:527
u_short PASCAL htons(u_short)
Definition: connect.c:20
u_short l_onoff
Definition: winsock.h:142
_In_ HANDLE _In_ DWORD _In_ DWORD nNumberOfBytesPerSend
Definition: mswsock.h:90
#define WSADESCRIPTION_LEN
Definition: winsock.h:316
#define WSASYS_STATUS_LEN
Definition: winsock.h:317
char FAR *PASCAL FAR inet_ntoa(_In_ struct in_addr in)
BOOL PASCAL FAR WSAIsBlocking(void)
Definition: bhook.c:65
struct protoent * PPROTOENT
Definition: winsock.h:503
void PASCAL FAR WSASetLastError(_In_ int iError)
#define FD_SETSIZE
Definition: winsock.h:50
int PASCAL FAR sendto(_In_ SOCKET s, _In_reads_bytes_(len) const char FAR *buf, _In_ int len, _In_ int flags, _In_reads_bytes_opt_(tolen) const struct sockaddr FAR *to, _In_ int tolen)
unsigned short iMaxSockets
Definition: winsock.h:528
HANDLE PASCAL FAR WSAAsyncGetProtoByNumber(_In_ HWND hWnd, _In_ u_int wMsg, _In_ int number, _Out_writes_bytes_(buflen) char FAR *buf, _In_ int buflen)
struct timeval * PTIMEVAL
Definition: winsock.h:506
LONG tv_sec
Definition: winsock.h:116
Definition: tcpip.h:125
int PASCAL FAR setsockopt(_In_ SOCKET s, _In_ int level, _In_ int optname, _In_reads_bytes_opt_(optlen) const char FAR *optval, _In_ int optlen)
struct protoent * LPPROTOENT
Definition: winsock.h:504
char ** n_aliases
Definition: winsock.h:153
u_long n_net
Definition: winsock.h:155
char * s_name
Definition: winsock.h:159
int PASCAL gethostname(char *, int)
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define _Inout_
Definition: no_sal2.h:244
struct linger * LPLINGER
Definition: winsock.h:492
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned short u_short
Definition: types.h:81
HANDLE PASCAL FAR WSAAsyncGetHostByName(_In_ HWND hWnd, _In_ u_int wMsg, _In_z_ const char FAR *name, _Out_writes_bytes_(buflen) char FAR *buf, _In_ int buflen)
char * lpVendorInfo
Definition: winsock.h:530
GLbitfield flags
Definition: glext.h:7161
struct servent FAR *PASCAL FAR getservbyname(_In_z_ const char FAR *name, _In_z_ const char FAR *proto)
_In_ SOCKET sAcceptSocket
Definition: mswsock.h:100
_In_ _In_opt_ _Out_writes_bytes_to_opt_ lpdwBufferLength __out_data_source(NETWORK) LPVOID
u_long PASCAL htonl(u_long)
char sin_zero[8]
Definition: winsock.h:513
u_long PASCAL ntohl(u_long)
GLenum const GLvoid * addr
Definition: glext.h:9621
int PASCAL FAR closesocket(_In_ SOCKET s)
_In_ SOCKET _In_ DWORD _In_ DWORD dwLocalAddressLength
Definition: mswsock.h:102
struct _TRANSMIT_FILE_BUFFERS * PTRANSMIT_FILE_BUFFERS
int PASCAL FAR WSACancelAsyncRequest(_In_ HANDLE hAsyncTaskHandle)
int PASCAL FAR WSACancelBlockingCall(void)
Definition: bhook.c:23
char * n_name
Definition: winsock.h:152
HANDLE lEvent
Definition: tftpd.cpp:56
GLenum GLsizei len
Definition: glext.h:6722
VOID PASCAL FAR GetAcceptExSockaddrs(_In_reads_bytes_(dwReceiveDataLength+dwLocalAddressLength+dwRemoteAddressLength) PVOID lpOutputBuffer, _In_ DWORD dwReceiveDataLength, _In_ DWORD dwLocalAddressLength, _In_ DWORD dwRemoteAddressLength, _Outptr_result_bytebuffer_(*LocalSockaddrLength) struct sockaddr **LocalSockaddr, _Out_ LPINT LocalSockaddrLength, _Outptr_result_bytebuffer_(*RemoteSockaddrLength) struct sockaddr **RemoteSockaddr, _Out_ LPINT RemoteSockaddrLength)
GLdouble s
Definition: gl.h:2039
int PASCAL select(int nfds, fd_set *, fd_set *, fd_set *, const struct timeval *)
#define PASCAL
Definition: windef.h:133
BOOL PASCAL FAR TransmitFile(_In_ SOCKET hSocket, _In_ HANDLE hFile, _In_ DWORD nNumberOfBytesToWrite, _In_ DWORD nNumberOfBytesPerSend, _Inout_opt_ LPOVERLAPPED lpOverlapped, _In_opt_ LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers, _In_ DWORD dwReserved)
_In_ HANDLE hFile
Definition: mswsock.h:90
char szDescription[WSADESCRIPTION_LEN+1]
Definition: winsock.h:526
#define _In_reads_bytes_(size)
Definition: no_sal2.h:229
short n_addrtype
Definition: winsock.h:154
int PASCAL FAR WSAStartup(_In_ WORD wVersionRequired, _Out_ LPWSADATA lpWSAData)
short h_addrtype
Definition: winsock.h:136
struct in_addr sin_addr
Definition: winsock.h:512
u_short sa_family
Definition: winsock.h:217
#define _In_
Definition: no_sal2.h:204
GLuint in
Definition: glext.h:9616
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
Definition: mswsock.h:90
char ** p_aliases
Definition: winsock.h:172
int PASCAL FAR bind(_In_ SOCKET s, _In_reads_bytes_(namelen) const struct sockaddr FAR *addr, _In_ int namelen)
struct hostent * LPHOSTENT
Definition: winsock.h:498
UINT32 u_int
Definition: types.h:82
#define _In_z_
Definition: no_sal2.h:239
short s_port
Definition: winsock.h:165
struct sockaddr_in * PSOCKADDR_IN
Definition: winsock.h:488
_In_ SOCKET _In_ DWORD dwReceiveDataLength
Definition: mswsock.h:102
FARPROC PASCAL FAR WSASetBlockingHook(_In_ FARPROC lpBlockFunc)
struct _TRANSMIT_FILE_BUFFERS * LPTRANSMIT_FILE_BUFFERS
struct servent FAR *PASCAL FAR getservbyport(_In_ int port, _In_z_ const char FAR *proto)
int PASCAL FAR WSAGetLastError(void)
Definition: dllmain.c:112
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers
Definition: mswsock.h:90
struct linger * PLINGER
Definition: winsock.h:491
POINT cp
Definition: magnifier.c:61
Definition: name.c:36
uint32_t * LPDWORD
Definition: typedefs.h:57
char * s_proto
Definition: winsock.h:166
#define _Outptr_result_bytebuffer_(size)
Definition: no_sal2.h:420
char ** s_aliases
Definition: winsock.h:160
BOOL PASCAL FAR AcceptEx(_In_ SOCKET sListenSocket, _In_ SOCKET sAcceptSocket, _Out_writes_bytes_to_(dwReceiveDataLength+dwLocalAddressLength+dwRemoteAddressLength, *lpdwBytesReceived) PVOID lpOutputBuffer, _In_ DWORD dwReceiveDataLength, _In_ DWORD dwLocalAddressLength, _In_ DWORD dwRemoteAddressLength, _Out_ LPDWORD lpdwBytesReceived, _Inout_ LPOVERLAPPED lpOverlapped)
int PASCAL FAR send(_In_ SOCKET s, _In_reads_bytes_(len) const char FAR *buf, _In_ int len, _In_ int flags)
HANDLE PASCAL FAR WSAAsyncGetHostByAddr(_In_ HWND hWnd, _In_ u_int wMsg, _In_ const char FAR *addr, _In_ int len, _In_ int type, _Out_writes_bytes_(buflen) char FAR *buf, _In_ int buflen)
WORD wHighVersion
Definition: winsock.h:518
UINT_PTR SOCKET
Definition: winsock.h:47
_In_ DWORD _In_ DWORD _In_ DWORD _Outptr_result_bytebuffer_ LocalSockaddrLength struct sockaddr _Out_ LPINT _Outptr_result_bytebuffer_ RemoteSockaddrLength struct sockaddr _Out_ LPINT RemoteSockaddrLength
Definition: mswsock.h:116
struct hostent * PHOSTENT
Definition: winsock.h:497
struct _TRANSMIT_FILE_BUFFERS TRANSMIT_FILE_BUFFERS
int PASCAL FAR WSARecvEx(_In_ SOCKET s, _Out_writes_bytes_to_(len, return) __out_data_source(NETWORK) char FAR *buf, _In_ int len, _Inout_ int FAR *flags)
_In_ HANDLE _In_ DWORD nNumberOfBytesToWrite
Definition: mswsock.h:90
CardRegion * from
Definition: spigame.cpp:19
int PASCAL FAR recv(_In_ SOCKET s, _Out_writes_bytes_to_(len, return) __out_data_source(NETWORK) char FAR *buf, _In_ int len, _In_ int flags)
struct WSAData * LPWSADATA
USHORT port
Definition: uri.c:227
unsigned short u_short
Definition: winsock.h:34
unsigned char u_char
Definition: winsock.h:33
short sin_family
Definition: winsock.h:510
unsigned long PASCAL FAR inet_addr(_In_z_ const char FAR *cp)
int(* FARPROC)()
Definition: compat.h:28
#define NETWORK
Definition: config.h:292
#define _Inout_opt_
Definition: no_sal2.h:258
char * p_name
Definition: winsock.h:171
int * LPINT
Definition: windef.h:178
SOCKET PASCAL FAR accept(_In_ SOCKET s, _Out_writes_bytes_opt_(*addrlen) struct sockaddr FAR *addr, _Inout_opt_ int FAR *addrlen)
struct sockaddr * LPSOCKADDR
Definition: winsock.h:486