ReactOS 0.4.16-dev-122-g325d74c
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
27extern "C" {
28#endif
29
30#if !defined ( _BSDTYPES_DEFINED )
31
32/* also defined in gmon.h and in cygwin's sys/types */
33typedef unsigned char u_char;
34typedef unsigned short u_short;
35typedef unsigned int u_int;
36
37#ifndef __ROS_LONG64__
38typedef unsigned long u_long;
39#else
40typedef unsigned int u_long;
41#endif
42
43#define _BSDTYPES_DEFINED
44
45#endif /* !defined ( _BSDTYPES_DEFINED ) */
46
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
66typedef struct fd_set {
70
72
73#ifndef FD_CLR
74#define FD_CLR(fd,set) do { u_int __i;\
75for (__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
115struct 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
133struct hostent {
134 char *h_name;
135 char **h_aliases;
137 short h_length;
139};
140
141struct 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
151struct netent {
152 char * n_name;
153 char **n_aliases;
156};
157
158struct 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
170struct 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
216struct 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
236int PASCAL select(int nfds,fd_set*,fd_set*,fd_set*,const struct timeval*);
237int 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
484typedef struct sockaddr SOCKADDR;
485typedef struct sockaddr *PSOCKADDR;
486typedef struct sockaddr *LPSOCKADDR;
488typedef struct sockaddr_in *PSOCKADDR_IN;
490typedef struct linger LINGER;
491typedef struct linger *PLINGER;
492typedef struct linger *LPLINGER;
493typedef struct fd_set FD_SET;
494typedef struct fd_set *PFD_SET;
495typedef struct fd_set *LPFD_SET;
496typedef struct hostent HOSTENT;
497typedef struct hostent *PHOSTENT;
498typedef struct hostent *LPHOSTENT;
499typedef struct servent SERVENT;
500typedef struct servent *PSERVENT;
501typedef struct servent *LPSERVENT;
502typedef struct protoent PROTOENT;
503typedef struct protoent *PPROTOENT;
504typedef struct protoent *LPPROTOENT;
505typedef struct timeval TIMEVAL;
506typedef struct timeval *PTIMEVAL;
507typedef struct timeval *LPTIMEVAL;
508
513 char sin_zero[8];
514};
515
516typedef 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
533
534struct ip_mreq {
537};
538
539struct sockproto {
542};
543
544SOCKET
547 _In_ SOCKET s,
548 _Out_writes_bytes_opt_(*addrlen) struct sockaddr FAR *addr,
549 _Inout_opt_ int FAR *addrlen);
550
551int
554 _In_ SOCKET s,
556 _In_ int namelen);
557
558int
561 _In_ SOCKET s);
562
563int
566 _In_ SOCKET s,
568 _In_ int namelen);
569
570int
573 _In_ SOCKET s,
574 _In_ long cmd,
575 _Inout_ u_long FAR *argp);
576
577int
580 _In_ SOCKET s,
582 _Inout_ int FAR *namelen);
583
584int
587 _In_ SOCKET s,
589 _Inout_ int FAR *namelen);
590
591int
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
600u_long
603 _In_ u_long hostlong);
604
608 _In_ u_short hostshort);
609
610unsigned long
613 _In_z_ const char FAR *cp);
614
615char FAR
616*PASCAL FAR
618 _In_ struct in_addr in);
619
620int
623 _In_ SOCKET s,
624 _In_ int backlog);
625
626u_long
629 _In_ u_long netlong);
630
634 _In_ u_short netshort);
635
636int
639 _In_ SOCKET s,
641 _In_ int len,
642 _In_ int flags);
643
644int
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
654int
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
663int
666 _In_ SOCKET s,
667 _In_reads_bytes_(len) const char FAR *buf,
668 _In_ int len,
669 _In_ int flags);
670
671int
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
681int
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
690int
693 _In_ SOCKET s,
694 _In_ int how);
695
696SOCKET
699 _In_ int af,
700 _In_ int type,
701 _In_ int protocol);
702
703struct hostent FAR
704*PASCAL FAR
706 _In_reads_bytes_(len) const char FAR *addr,
707 _In_ int len,
708 _In_ int type);
709
710struct hostent FAR
711*PASCAL FAR
713 _In_z_ const char FAR *name);
714
715int
718 _Out_writes_bytes_to_(namelen, return) char FAR *name,
719 _In_ int namelen);
720
721struct servent FAR
722*PASCAL FAR
724 _In_ int port,
725 _In_z_ const char FAR *proto);
726
727struct servent FAR
728*PASCAL FAR
730 _In_z_ const char FAR *name,
731 _In_z_ const char FAR *proto);
732
733struct protoent FAR
734*PASCAL FAR
736 _In_ int number);
737
738struct protoent FAR
739*PASCAL FAR
741 _In_z_ const char FAR *name);
742
743int
746 _In_ WORD wVersionRequired,
747 _Out_ LPWSADATA lpWSAData);
748
749int
751WSACleanup(void);
752
753void
756 _In_ int iError);
757
758int
760WSAGetLastError(void);
761
762BOOL
764WSAIsBlocking(void);
765
766int
769
773 _In_ FARPROC lpBlockFunc);
774
775int
778
779HANDLE
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
789HANDLE
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
799HANDLE
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
808HANDLE
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
817HANDLE
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
826HANDLE
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
837int
840 _In_ HANDLE hAsyncTaskHandle);
841
842int
845 _In_ SOCKET s,
846 _In_ HWND hWnd,
847 _In_ u_int wMsg,
848 _In_ long lEvent);
849
850int
853 _In_ SOCKET s,
855 _In_ int len,
856 _Inout_ int FAR *flags);
857
858typedef struct _TRANSMIT_FILE_BUFFERS {
864
865BOOL
868 _In_ SOCKET hSocket,
875
876BOOL
879 _In_ SOCKET sListenSocket,
887
888VOID
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
HWND hWnd
Definition: settings.c:17
UINT32 u_int
Definition: types.h:82
unsigned short u_short
Definition: types.h:81
int(* FARPROC)()
Definition: compat.h:36
#define FAR
Definition: zlib.h:34
USHORT port
Definition: uri.c:228
unsigned long u_long
Definition: linux.h:269
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLint level
Definition: gl.h:1546
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
GLint namelen
Definition: glext.h:7232
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint in
Definition: glext.h:9616
GLbitfield flags
Definition: glext.h:7161
GLenum const GLvoid * addr
Definition: glext.h:9621
GLenum GLsizei len
Definition: glext.h:6722
#define inet_addr(cp)
Definition: inet.h:98
#define inet_ntoa(addr)
Definition: inet.h:100
POINT cp
Definition: magnifier.c:59
#define htons(x)
Definition: module.h:215
#define ntohl(x)
Definition: module.h:205
#define ntohs(x)
Definition: module.h:210
#define htonl(x)
Definition: module.h:214
static unsigned int number
Definition: dsound.c:1479
#define _Outptr_result_bytebuffer_(size)
Definition: ms_sal.h:472
#define _In_reads_bytes_(size)
Definition: ms_sal.h:321
#define _Inout_
Definition: ms_sal.h:378
#define _Out_writes_bytes_(size)
Definition: ms_sal.h:350
#define _Out_writes_bytes_to_(size, count)
Definition: ms_sal.h:360
#define _In_z_
Definition: ms_sal.h:313
#define _Inout_opt_
Definition: ms_sal.h:379
#define _Out_
Definition: ms_sal.h:345
#define _Out_writes_bytes_to_opt_(size, count)
Definition: ms_sal.h:361
#define _In_
Definition: ms_sal.h:308
#define _In_reads_bytes_opt_(size)
Definition: ms_sal.h:322
#define _In_opt_
Definition: ms_sal.h:309
#define _Out_writes_bytes_opt_(size)
Definition: ms_sal.h:351
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
_In_ DWORD _In_ DWORD _In_ DWORD _Outptr_result_bytebuffer_ LocalSockaddrLength struct sockaddr ** LocalSockaddr
Definition: mswsock.h:114
_In_ SOCKET sAcceptSocket
Definition: mswsock.h:100
_In_ DWORD _In_ DWORD _In_ DWORD _Outptr_result_bytebuffer_ LocalSockaddrLength struct sockaddr _Out_ LPINT LocalSockaddrLength
Definition: mswsock.h:115
_In_ HANDLE _In_ DWORD _In_ DWORD nNumberOfBytesPerSend
Definition: mswsock.h:92
_In_ HANDLE hFile
Definition: mswsock.h:90
_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
_In_ HANDLE _In_ DWORD nNumberOfBytesToWrite
Definition: mswsock.h:91
_In_ SOCKET _In_ DWORD _In_ DWORD _In_ DWORD _Out_ LPDWORD lpdwBytesReceived
Definition: mswsock.h:105
_In_ SOCKET _In_ DWORD dwReceiveDataLength
Definition: mswsock.h:102
_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:117
_In_ SOCKET _In_ DWORD _In_ DWORD _In_ DWORD dwRemoteAddressLength
Definition: mswsock.h:104
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers
Definition: mswsock.h:94
_In_ SOCKET _In_ DWORD _In_ DWORD dwLocalAddressLength
Definition: mswsock.h:103
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
Definition: mswsock.h:93
#define ioctlsocket
Definition: ncftp.h:481
#define closesocket
Definition: ncftp.h:477
long LONG
Definition: pedump.c:60
#define NETWORK
Definition: config.h:328
#define __out_data_source(src_sym)
Definition: specstrings.h:349
CardRegion * from
Definition: spigame.cpp:19
char szDescription[WSADESCRIPTION_LEN+1]
Definition: winsock.h:526
unsigned short iMaxUdpDg
Definition: winsock.h:529
char * lpVendorInfo
Definition: winsock.h:530
char szSystemStatus[WSASYS_STATUS_LEN+1]
Definition: winsock.h:527
WORD wVersion
Definition: winsock.h:517
WORD wHighVersion
Definition: winsock.h:518
unsigned short iMaxSockets
Definition: winsock.h:528
Definition: ftp_var.h:139
Definition: winsock.h:66
u_int fd_count
Definition: winsock.h:67
SOCKET fd_array[FD_SETSIZE]
Definition: winsock.h:68
char * h_name
Definition: winsock.h:134
short h_length
Definition: winsock.h:137
char ** h_aliases
Definition: winsock.h:135
short h_addrtype
Definition: winsock.h:136
char ** h_addr_list
Definition: winsock.h:138
Definition: tcpip.h:126
struct in_addr imr_interface
Definition: winsock.h:536
struct in_addr imr_multiaddr
Definition: winsock.h:535
u_short l_onoff
Definition: winsock.h:142
u_short l_linger
Definition: winsock.h:143
Definition: name.c:39
u_long n_net
Definition: winsock.h:155
char * n_name
Definition: winsock.h:152
short n_addrtype
Definition: winsock.h:154
char ** n_aliases
Definition: winsock.h:153
char ** p_aliases
Definition: winsock.h:172
short p_proto
Definition: winsock.h:173
char * p_name
Definition: winsock.h:171
char * s_name
Definition: winsock.h:159
short s_port
Definition: winsock.h:165
char * s_proto
Definition: winsock.h:166
char ** s_aliases
Definition: winsock.h:160
char sin_zero[8]
Definition: winsock.h:513
struct in_addr sin_addr
Definition: winsock.h:512
short sin_family
Definition: winsock.h:510
u_short sin_port
Definition: winsock.h:511
u_short sa_family
Definition: winsock.h:217
char sa_data[14]
Definition: winsock.h:218
u_short sp_protocol
Definition: winsock.h:541
u_short sp_family
Definition: winsock.h:540
Definition: dhcpd.h:245
LONG tv_usec
Definition: winsock.h:117
LONG tv_sec
Definition: winsock.h:116
HANDLE lEvent
Definition: tftpd.cpp:56
uint32_t * LPDWORD
Definition: typedefs.h:59
int * LPINT
Definition: windef.h:178
#define PASCAL
Definition: windef.h:133
UINT_PTR SOCKET
Definition: winsock2.h:72
#define FD_SETSIZE
Definition: winsock2.h:75
unsigned long u_long
Definition: winsock2.h:59
unsigned short u_short
Definition: winsock2.h:56
unsigned int u_int
Definition: winsock2.h:57
#define WSASYS_STATUS_LEN
Definition: winsock2.h:240
#define WSADESCRIPTION_LEN
Definition: winsock2.h:239
int PASCAL FAR send(_In_ SOCKET s, _In_reads_bytes_(len) const char FAR *buf, _In_ int len, _In_ int flags)
struct _TRANSMIT_FILE_BUFFERS * LPTRANSMIT_FILE_BUFFERS
int PASCAL FAR getsockopt(_In_ SOCKET s, _In_ int level, _In_ int optname, _Out_writes_bytes_(*optlen) char FAR *optval, _Inout_ int FAR *optlen)
void PASCAL FAR WSASetLastError(_In_ int iError)
int PASCAL FAR WSACancelAsyncRequest(_In_ HANDLE hAsyncTaskHandle)
struct sockaddr_in * LPSOCKADDR_IN
Definition: winsock.h:489
int PASCAL FAR WSAGetLastError(void)
Definition: dllmain.c:112
BOOL PASCAL FAR WSAIsBlocking(void)
Definition: bhook.c:65
int PASCAL FAR WSACleanup(void)
Definition: startup.c:60
struct fd_set * LPFD_SET
Definition: winsock.h:495
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)
struct hostent * LPHOSTENT
Definition: winsock.h:498
int PASCAL FAR shutdown(_In_ SOCKET s, _In_ int how)
struct hostent * PHOSTENT
Definition: winsock.h:497
struct servent * LPSERVENT
Definition: winsock.h:501
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 hostent FAR *PASCAL FAR gethostbyname(_In_z_ const char FAR *name)
int PASCAL FAR getpeername(_In_ SOCKET s, _Out_writes_bytes_to_(*namelen, *namelen) struct sockaddr FAR *name, _Inout_ int FAR *namelen)
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)
struct servent FAR *PASCAL FAR getservbyname(_In_z_ const char FAR *name, _In_z_ const char FAR *proto)
struct fd_set * PFD_SET
Definition: winsock.h:494
struct _TRANSMIT_FILE_BUFFERS * PTRANSMIT_FILE_BUFFERS
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)
struct sockaddr_in * PSOCKADDR_IN
Definition: winsock.h:488
int PASCAL FAR WSACancelBlockingCall(void)
Definition: bhook.c:23
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)
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)
UINT_PTR SOCKET
Definition: winsock.h:47
struct sockaddr * PSOCKADDR
Definition: winsock.h:485
int PASCAL FAR bind(_In_ SOCKET s, _In_reads_bytes_(namelen) const struct sockaddr FAR *addr, _In_ int namelen)
struct servent FAR *PASCAL FAR getservbyport(_In_ int port, _In_z_ const char FAR *proto)
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)
FARPROC PASCAL FAR WSASetBlockingHook(_In_ FARPROC lpBlockFunc)
struct timeval * PTIMEVAL
Definition: winsock.h:506
int PASCAL FAR WSAAsyncSelect(_In_ SOCKET s, _In_ HWND hWnd, _In_ u_int wMsg, _In_ long lEvent)
struct WSAData * LPWSADATA
unsigned long u_long
Definition: winsock.h:38
struct timeval * LPTIMEVAL
Definition: winsock.h:507
struct servent * PSERVENT
Definition: winsock.h:500
struct protoent FAR *PASCAL FAR getprotobyname(_In_z_ const char FAR *name)
int PASCAL FAR WSAStartup(_In_ WORD wVersionRequired, _Out_ LPWSADATA lpWSAData)
SOCKET PASCAL FAR accept(_In_ SOCKET s, _Out_writes_bytes_opt_(*addrlen) struct sockaddr FAR *addr, _Inout_opt_ int FAR *addrlen)
struct _TRANSMIT_FILE_BUFFERS TRANSMIT_FILE_BUFFERS
unsigned short u_short
Definition: winsock.h:34
struct protoent * PPROTOENT
Definition: winsock.h:503
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 WSADATA
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)
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)
int PASCAL gethostname(char *, int)
struct fd_set fd_set
struct hostent FAR *PASCAL FAR gethostbyaddr(_In_reads_bytes_(len) const char FAR *addr, _In_ int len, _In_ int type)
SOCKET PASCAL FAR socket(_In_ int af, _In_ int type, _In_ int protocol)
struct protoent * LPPROTOENT
Definition: winsock.h:504
struct sockaddr * LPSOCKADDR
Definition: winsock.h:486
int PASCAL select(int nfds, fd_set *, fd_set *, fd_set *, const struct timeval *)
int PASCAL __WSAFDIsSet(SOCKET, fd_set FAR *)
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)
unsigned int u_int
Definition: winsock.h:35
HANDLE PASCAL FAR WSAAsyncGetProtoByNumber(_In_ HWND hWnd, _In_ u_int wMsg, _In_ int number, _Out_writes_bytes_(buflen) char FAR *buf, _In_ int buflen)
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)
int PASCAL FAR listen(_In_ SOCKET s, _In_ int backlog)
int PASCAL FAR WSAUnhookBlockingHook(void)
Definition: bhook.c:130
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 linger * PLINGER
Definition: winsock.h:491
struct protoent FAR *PASCAL FAR getprotobynumber(_In_ int number)
unsigned char u_char
Definition: winsock.h:33
int PASCAL FAR getsockname(_In_ SOCKET s, _Out_writes_bytes_to_(*namelen, *namelen) struct sockaddr FAR *name, _Inout_ int FAR *namelen)
struct linger * LPLINGER
Definition: winsock.h:492