Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
winsock2.h
Go to the documentation of this file.
1/*
2 * This file is part of the Ultibo project, https://ultibo.org/
3 *
4 * The MIT License (MIT)
5 *
6 * Copyright (c) 2026 Garry Wood <garry@softoz.com.au>
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 */
26#ifndef _ULTIBO_WINSOCK2_H
27#define _ULTIBO_WINSOCK2_H
28
29#define _ULTIBO_WINSOCK_H
30#define _WINSOCK2API_
31#define _WINSOCKAPI_
32
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41#include "ultibo/globaltypes.h"
42#include "ultibo/globalconst.h"
43#include "ultibo/ultibo.h"
44
46#ifdef _SYS_TYPES_FD_SET
47#undef _SYS_TYPES_FD_SET
48#undef NBBY
49#undef NFDBITS
50#undef fd_set
51#undef FD_SET
52#undef FD_CLR
53#undef FD_ISSET
54#undef FD_ZERO
55#endif
56
58#define WINSOCK_VERSION 0x0202
59
60#ifndef FD_SETSIZE
61#define FD_SETSIZE 64
62#endif
63
64#define IOCPARM_MASK 0x7f
65#define IOC_VOID 0x20000000
66#define IOC_OUT 0x40000000
67#define IOC_IN 0x80000000
68#define IOC_INOUT (IOC_IN | IOC_OUT)
69
70#define _IO(x,y) (IOC_VOID|((x)<<8)|(y))
71
72#define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
73
74#define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
75
76#define FIONREAD _IOR('f', 127, u_long)
77#define FIONBIO _IOW('f', 126, u_long)
78#define FIOASYNC _IOW('f', 125, u_long)
79
81#define SIOCSHIWAT _IOW('s', 0, u_long)
82#define SIOCGHIWAT _IOR('s', 1, u_long)
83#define SIOCSLOWAT _IOW('s', 2, u_long)
84#define SIOCGLOWAT _IOR('s', 3, u_long)
85#define SIOCATMARK _IOR('s', 7, u_long)
86
88#define IPPROTO_IP 0
89#define IPPROTO_ICMP 1
90#define IPPROTO_IGMP 2
91#define IPPROTO_GGP 3
92#define IPPROTO_TCP 6
93#define IPPROTO_EGP 8
94#define IPPROTO_PUP 12
95#define IPPROTO_UDP 17
96#define IPPROTO_HMP 20
97#define IPPROTO_IDP 22
98#define IPPROTO_RDP 27
99#define IPPROTO_IPV6 41
100#define IPPROTO_ROUTING 43
101#define IPPROTO_FRAGMENT 44
102#define IPPROTO_ICMPV6 58
103#define IPPROTO_RVD 66
104#define IPPROTO_ND 77
105#define IPPROTO_RAW 255
106#define IPPROTO_MAX 256
107
108#define NSPROTO_IPX 1000
109#define NSPROTO_SPX 1256
110#define NSPROTO_SPXII 1257
111
113#define IPPORT_ANY 0
114#define IPPORT_ECHO 7
115#define IPPORT_DISCARD 9
116#define IPPORT_SYSTAT 11
117#define IPPORT_DAYTIME 13
118#define IPPORT_NETSTAT 15
119#define IPPORT_FTP 21
120#define IPPORT_TELNET 23
121#define IPPORT_SMTP 25
122#define IPPORT_TIMESERVER 37
123#define IPPORT_NAMESERVER 42
124#define IPPORT_WHOIS 43
125#define IPPORT_DNS 53
126#define IPPORT_MTP 57
127#define IPPORT_BOOTPS 67
128#define IPPORT_BOOTPC 68
129
131#define IPPORT_TFTP 69
132#define IPPORT_RJE 77
133#define IPPORT_FINGER 79
134#define IPPORT_TTYLINK 87
135#define IPPORT_SUPDUP 95
136
138#define IPPORT_EXECSERVER 512
139#define IPPORT_LOGINSERVER 513
140#define IPPORT_CMDSERVER 514
141#define IPPORT_EFSSERVER 520
142
144#define IPPORT_BIFFUDP 512
145#define IPPORT_WHOSERVER 513
146#define IPPORT_ROUTESERVER 520
147
150#define IPPORT_RESERVED 1024
151
153#define IMPLINK_IP 155
154#define IMPLINK_LOWEXPER 156
155#define IMPLINK_HIGHEXPER 158
156
157#define TF_DISCONNECT 0x01
158#define TF_REUSE_SOCKET 0x02
159#define TF_WRITE_BEHIND 0x04
160
162#define IP_OPTIONS 1
163#define IP_MULTICAST_IF 2
164#define IP_MULTICAST_TTL 3
165#define IP_MULTICAST_LOOP 4
166#define IP_ADD_MEMBERSHIP 5
167#define IP_DROP_MEMBERSHIP 6
168#define IP_TTL 7
169#define IP_TOS 8
170#define IP_DONTFRAGMENT 9
171#define IP_HDRINCL 10
172
173#define IP_DEFAULT_MULTICAST_TTL 1
174#define IP_DEFAULT_MULTICAST_LOOP 1
175#define IP_MAX_MEMBERSHIPS 20
176
178#define INVALID_SOCKET (SOCKET)(~0)
179#define SOCKET_ERROR -1
180
182#define SOCK_UNSPEC 0
183#define SOCK_STREAM 1
184#define SOCK_DGRAM 2
185#define SOCK_RAW 3
186#define SOCK_RDM 4
187#define SOCK_SEQPACKET 5
188#define SOCK_PACKET 10
189 // getting packets at the dev
190 // level. For writing rarp and
191 // other similar things on the
192 // user level.
193
195#define SO_DEBUG 0x0001
196#define SO_ACCEPTCONN 0x0002
197#define SO_REUSEADDR 0x0004
198#define SO_KEEPALIVE 0x0008
199#define SO_DONTROUTE 0x0010
200#define SO_BROADCAST 0x0020
201#define SO_USELOOPBACK 0x0040
202#define SO_LINGER 0x0080
203#define SO_OOBINLINE 0x0100
204
205#define SO_DONTLINGER 0xff7f
206
208#define SO_SNDBUF 0x1001
209#define SO_RCVBUF 0x1002
210#define SO_SNDLOWAT 0x1003
211#define SO_RCVLOWAT 0x1004
212#define SO_SNDTIMEO 0x1005
213#define SO_RCVTIMEO 0x1006
214#define SO_ERROR 0x1007
215#define SO_TYPE 0x1008
216#define SO_CONNTIMEO 0x1009
217
220#define SO_CONNDATA 0x7000
221#define SO_CONNOPT 0x7001
222#define SO_DISCDATA 0x7002
223#define SO_DISCOPT 0x7003
224#define SO_CONNDATALEN 0x7004
225#define SO_CONNOPTLEN 0x7005
226#define SO_DISCDATALEN 0x7006
227#define SO_DISCOPTLEN 0x7007
228
230#define SO_OPENTYPE 0x7008
231#define SO_SYNCHRONOUS_ALERT 0x10
232#define SO_SYNCHRONOUS_NONALERT 0x20
233
235#define SO_MAXDG 0x7009
236#define SO_MAXPATHDG 0x700A
237#define SO_UPDATE_ACCEPT_CONTEXT 0x700B
238#define SO_CONNECT_TIME 0x700C
239
241#define TCP_NODELAY 0x0001
242#define TCP_MAXSEG 0x0002
243#define TCP_NOPUSH 0x0004
244#define TCP_NOOPT 0x0008
245#define TCP_BSDURGENT 0x7000
246
247#define TCP_WSCALE 0x0010
248#define TCP_NOSACK 0x0020
249
251#define UDP_NOCHECKSUM 0x0001
252
254#define AF_UNSPEC 0
255#define AF_UNIX 1
256#define AF_INET 2
257#define AF_IMPLINK 3
258#define AF_PUP 4
259#define AF_CHAOS 5
260#define AF_IPX 6
261#define AF_NS 6
262#define AF_ISO 7
263#define AF_OSI AF_ISO
264#define AF_ECMA 8
265#define AF_DATAKIT 9
266#define AF_CCITT 10
267#define AF_SNA 11
268#define AF_DECnet 12
269#define AF_DLI 13
270#define AF_LAT 14
271#define AF_HYLINK 15
272#define AF_APPLETALK 16
273#define AF_NETBIOS 17
274#define AF_VOICEVIEW 18
275#define AF_FIREFOX 19
276#define AF_UNKNOWN1 20
277#define AF_BAN 21
278#define AF_ATM 22
279#define AF_INET6 23
280#define AF_CLUSTER 24
281#define AF_12844 25
282#define AF_IRDA 26
283#define AF_NETDES 28
284
285#define AF_MAX 29
286
288#define _SS_MAXSIZE 128
289#define _SS_ALIGNSIZE (sizeof(__int64_t))
290#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(unsigned short))
291#define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof(unsigned short) + _SS_PAD1SIZE + _SS_ALIGNSIZE))
292
294#define PF_UNSPEC AF_UNSPEC
295#define PF_UNIX AF_UNIX
296#define PF_INET AF_INET
297#define PF_IMPLINK AF_IMPLINK
298#define PF_PUP AF_PUP
299#define PF_CHAOS AF_CHAOS
300#define PF_NS AF_NS
301#define PF_IPX AF_IPX
302#define PF_ISO AF_ISO
303#define PF_OSI AF_OSI
304#define PF_ECMA AF_ECMA
305#define PF_DATAKIT AF_DATAKIT
306#define PF_CCITT AF_CCITT
307#define PF_SNA AF_SNA
308#define PF_DECnet AF_DECnet
309#define PF_DLI AF_DLI
310#define PF_LAT AF_LAT
311#define PF_HYLINK AF_HYLINK
312#define PF_APPLETALK AF_APPLETALK
313#define PF_VOICEVIEW AF_VOICEVIEW
314#define PF_FIREFOX AF_FIREFOX
315#define PF_UNKNOWN1 AF_UNKNOWN1
316#define PF_BAN AF_BAN
317#define PF_ATM AF_ATM
318#define PF_INET6 AF_INET6
319#define PF_CLUSTER AF_CLUSTER
320#define PF_12844 AF_12844
321#define PF_IRDA AF_IRDA
322#define PF_NETDES AF_NETDES
323
324#define PF_MAX AF_MAX
325
327#define SOL_SOCKET 0xffff
328
330#define SOMAXCONN 0x7fffffff
331
332#define MSG_OOB 0x1
333#define MSG_PEEK 0x2
334#define MSG_DONTROUTE 0x4
335#define MSG_WAITALL 0x8;
336
337#define MSG_INTERRUPT 0x10
338#define MSG_MAXIOVLEN 16
339
340#define MSG_PARTIAL 0x8000
341
343#define MAXGETHOSTSTRUCT 1024
344
346#define FD_READ_BIT 0
347#define FD_READ (1 << FD_READ_BIT)
348#define FD_WRITE_BIT 1
349#define FD_WRITE (1 << FD_WRITE_BIT)
350#define FD_OOB_BIT 2
351#define FD_OOB (1 << FD_OOB_BIT)
352#define FD_ACCEPT_BIT 3
353#define FD_ACCEPT (1 << FD_ACCEPT_BIT)
354#define FD_CONNECT_BIT 4
355#define FD_CONNECT (1 << FD_CONNECT_BIT)
356#define FD_CLOSE_BIT 5
357#define FD_CLOSE (1 << FD_CLOSE_BIT)
358#define FD_QOS_BIT 6
359#define FD_QOS (1 << FD_QOS_BIT)
360#define FD_GROUP_QOS_BIT 7
361#define FD_GROUP_QOS (1 << FD_GROUP_QOS_BIT)
362#define FD_MAX_EVENTS 8
363#define FD_ALL_EVENTS ((1 << FD_MAX_EVENTS) - 1)
364
366#define WSABASEERR 10000
367
369
370#define WSAEINTR (WSABASEERR+4)
371#define WSAEBADF (WSABASEERR+9)
372#define WSAEACCES (WSABASEERR+13)
373#define WSAEFAULT (WSABASEERR+14)
374#define WSAEINVAL (WSABASEERR+22)
375#define WSAEMFILE (WSABASEERR+24)
376
378
379#define WSAEWOULDBLOCK (WSABASEERR+35)
380#define WSAEINPROGRESS (WSABASEERR+36)
381#define WSAEALREADY (WSABASEERR+37)
382#define WSAENOTSOCK (WSABASEERR+38)
383#define WSAEDESTADDRREQ (WSABASEERR+39)
384#define WSAEMSGSIZE (WSABASEERR+40)
385#define WSAEPROTOTYPE (WSABASEERR+41)
386#define WSAENOPROTOOPT (WSABASEERR+42)
387#define WSAEPROTONOSUPPORT (WSABASEERR+43)
388#define WSAESOCKTNOSUPPORT (WSABASEERR+44)
389#define WSAEOPNOTSUPP (WSABASEERR+45)
390#define WSAEPFNOSUPPORT (WSABASEERR+46)
391#define WSAEAFNOSUPPORT (WSABASEERR+47)
392#define WSAEADDRINUSE (WSABASEERR+48)
393#define WSAEADDRNOTAVAIL (WSABASEERR+49)
394#define WSAENETDOWN (WSABASEERR+50)
395#define WSAENETUNREACH (WSABASEERR+51)
396#define WSAENETRESET (WSABASEERR+52)
397#define WSAECONNABORTED (WSABASEERR+53)
398#define WSAECONNRESET (WSABASEERR+54)
399#define WSAENOBUFS (WSABASEERR+55)
400#define WSAEISCONN (WSABASEERR+56)
401#define WSAENOTCONN (WSABASEERR+57)
402#define WSAESHUTDOWN (WSABASEERR+58)
403#define WSAETOOMANYREFS (WSABASEERR+59)
404#define WSAETIMEDOUT (WSABASEERR+60)
405#define WSAECONNREFUSED (WSABASEERR+61)
406#define WSAELOOP (WSABASEERR+62)
407#define WSAENAMETOOLONG (WSABASEERR+63)
408#define WSAEHOSTDOWN (WSABASEERR+64)
409#define WSAEHOSTUNREACH (WSABASEERR+65)
410#define WSAENOTEMPTY (WSABASEERR+66)
411#define WSAEPROCLIM (WSABASEERR+67)
412#define WSAEUSERS (WSABASEERR+68)
413#define WSAEDQUOT (WSABASEERR+69)
414#define WSAESTALE (WSABASEERR+70)
415#define WSAEREMOTE (WSABASEERR+71)
416
417#define WSAEDISCON (WSABASEERR+101)
418
420
421#define WSASYSNOTREADY (WSABASEERR+91)
422#define WSAVERNOTSUPPORTED (WSABASEERR+92)
423#define WSANOTINITIALISED (WSABASEERR+93)
424
425#define WSAENOMORE (WSABASEERR+102)
426#define WSAECANCELLED (WSABASEERR+103)
427#define WSAEINVALIDPROCTABLE (WSABASEERR+104)
428#define WSAEINVALIDPROVIDER (WSABASEERR+105)
429#define WSAEPROVIDERFAILEDINIT (WSABASEERR+106)
430#define WSASYSCALLFAILURE (WSABASEERR+107)
431#define WSASERVICE_NOT_FOUND (WSABASEERR+108)
432#define WSATYPE_NOT_FOUND (WSABASEERR+109)
433#define WSA_E_NO_MORE (WSABASEERR+110)
434#define WSA_E_CANCELLED (WSABASEERR+111)
435#define WSAEREFUSED (WSABASEERR+112)
436
445
447
448#define WSAHOST_NOT_FOUND (WSABASEERR+1001)
449#define HOST_NOT_FOUND WSAHOST_NOT_FOUND
450
452
453#define WSATRY_AGAIN (WSABASEERR+1002)
454#define TRY_AGAIN WSATRY_AGAIN
455
457
458#define WSANO_RECOVERY (WSABASEERR+1003)
459#define NO_RECOVERY WSANO_RECOVERY
460
462
463#define WSANO_DATA (WSABASEERR+1004)
464#define NO_DATA WSANO_DATA
465
467
468#define WSANO_ADDRESS WSANO_DATA
469#define NO_ADDRESS WSANO_ADDRESS
470
472#define WSA_IO_PENDING ERROR_IO_PENDING
473#define WSA_IO_INCOMPLETE ERROR_IO_INCOMPLETE
474#define WSA_INVALID_HANDLE ERROR_INVALID_HANDLE
475#define WSA_INVALID_PARAMETER ERROR_INVALID_PARAMETER
476#define WSA_NOT_ENOUGH_MEMORY ERROR_NOT_ENOUGH_MEMORY
477#define WSA_OPERATION_ABORTED ERROR_OPERATION_ABORTED
478#define WSA_INVALID_EVENT (WSAEVENT)NULL
479#define WSA_MAXIMUM_WAIT_EVENTS MAXIMUM_WAIT_OBJECTS
480#define WSA_WAIT_FAILED 0xffffffff
481#define WSA_WAIT_EVENT_0 WAIT_OBJECT_0
482#define WSA_WAIT_IO_COMPLETION WAIT_IO_COMPLETION
483#define WSA_WAIT_TIMEOUT WAIT_TIMEOUT
484#define WSA_INFINITE INFINITE
485
489
490#define EWOULDBLOCK WSAEWOULDBLOCK
491#define EINPROGRESS WSAEINPROGRESS
492#define EALREADY WSAEALREADY
493#define ENOTSOCK WSAENOTSOCK
494#define EDESTADDRREQ WSAEDESTADDRREQ
495#define EMSGSIZE WSAEMSGSIZE
496#define EPROTOTYPE WSAEPROTOTYPE
497#define ENOPROTOOPT WSAENOPROTOOPT
498#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
499#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
500#define EOPNOTSUPP WSAEOPNOTSUPP
501#define EPFNOSUPPORT WSAEPFNOSUPPORT
502#define EAFNOSUPPORT WSAEAFNOSUPPORT
503#define EADDRINUSE WSAEADDRINUSE
504#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
505#define ENETDOWN WSAENETDOWN
506#define ENETUNREACH WSAENETUNREACH
507#define ENETRESET WSAENETRESET
508#define ECONNABORTED WSAECONNABORTED
509#define ECONNRESET WSAECONNRESET
510#define ENOBUFS WSAENOBUFS
511#define EISCONN WSAEISCONN
512#define ENOTCONN WSAENOTCONN
513#define ESHUTDOWN WSAESHUTDOWN
514#define ETOOMANYREFS WSAETOOMANYREFS
515#define ETIMEDOUT WSAETIMEDOUT
516#define ECONNREFUSED WSAECONNREFUSED
517#define ELOOP WSAELOOP
518#define ENAMETOOLONG WSAENAMETOOLONG
519#define EHOSTDOWN WSAEHOSTDOWN
520#define EHOSTUNREACH WSAEHOSTUNREACH
521#define ENOTEMPTY WSAENOTEMPTY
522#define EPROCLIM WSAEPROCLIM
523#define EUSERS WSAEUSERS
524#define EDQUOT WSAEDQUOT
525#define ESTALE WSAESTALE
526#define EREMOTE WSAEREMOTE
527
528#define ENOTREADY WSASYSNOTREADY
529#define EVERNOTSUPPORTED WSAVERNOTSUPPORTED
530#define ENOTINITIALISED WSANOTINITIALISED
531
532#define WSADESCRIPTION_LEN 256
533#define WSASYS_STATUS_LEN 128
534#define MAX_PROTOCOL_CHAIN 7
535#define BASE_PROTOCOL 1
536#define LAYERED_PROTOCOL 0
537#define WSAPROTOCOL_LEN 255
538
540#define SERVICETYPE_NOTRAFFIC 0x00000000
541#define SERVICETYPE_BESTEFFORT 0x00000001
542#define SERVICETYPE_CONTROLLEDLOAD 0x00000002
543#define SERVICETYPE_GUARANTEED 0x00000003
544#define SERVICETYPE_NETWORK_UNAVAILABLE 0x00000004
545#define SERVICETYPE_GENERAL_INFORMATION 0x00000005
546#define SERVICETYPE_NOCHANGE 0x00000006
547
548#define SERVICE_IMMEDIATE_TRAFFIC_CONTROL 0x80000000
549
551#define CF_ACCEPT 0x0000
552#define CF_REJECT 0x0001
553#define CF_DEFER 0x0002
554
556#define SD_RECEIVE 0x00
557#define SD_SEND 0x01
558#define SD_BOTH 0x02
559
561#define SG_UNCONSTRAINED_GROUP 0x01
562#define SG_CONSTRAINED_GROUP 0x02
563
565#define PFL_MULTIPLE_PROTO_ENTRIES 0x00000001
566#define PFL_RECOMMENDED_PROTO_ENTRY 0x00000002
567#define PFL_HIDDEN 0x00000004
568#define PFL_MATCHES_PROTOCOL_ZERO 0x00000008
569
571#define XP1_CONNECTIONLESS 0x00000001
572#define XP1_GUARANTEED_DELIVERY 0x00000002
573#define XP1_GUARANTEED_ORDER 0x00000004
574#define XP1_MESSAGE_ORIENTED 0x00000008
575#define XP1_PSEUDO_STREAM 0x00000010
576#define XP1_GRACEFUL_CLOSE 0x00000020
577#define XP1_EXPEDITED_DATA 0x00000040
578#define XP1_CONNECT_DATA 0x00000080
579#define XP1_DISCONNECT_DATA 0x00000100
580#define XP1_SUPPORT_BROADCAST 0x00000200
581#define XP1_SUPPORT_MULTIPOINT 0x00000400
582#define XP1_MULTIPOINT_CONTROL_PLANE 0x00000800
583#define XP1_MULTIPOINT_DATA_PLANE 0x00001000
584#define XP1_QOS_SUPPORTED 0x00002000
585#define XP1_INTERRUPT 0x00004000
586#define XP1_UNI_SEND 0x00008000
587#define XP1_UNI_RECV 0x00010000
588#define XP1_IFS_HANDLES 0x00020000
589#define XP1_PARTIAL_MESSAGE 0x00040000
590
591#define BIGENDIAN 0x0000
592#define LITTLEENDIAN 0x0001
593
594#define SECURITY_PROTOCOL_NONE 0x0000
595
597#define JL_SENDER_ONLY 0x01
598#define JL_RECEIVER_ONLY 0x02
599#define JL_BOTH 0x04
600
602#define WSA_FLAG_OVERLAPPED 0x01
603#define WSA_FLAG_MULTIPOINT_C_ROOT 0x02
604#define WSA_FLAG_MULTIPOINT_C_LEAF 0x04
605#define WSA_FLAG_MULTIPOINT_D_ROOT 0x08
606#define WSA_FLAG_MULTIPOINT_D_LEAF 0x10
607
609#define IOC_UNIX 0x00000000
610#define IOC_WS2 0x08000000
611#define IOC_PROTOCOL 0x10000000
612#define IOC_VENDOR 0x18000000
613
614#define SIO_ASSOCIATE_HANDLE IOC_IN | IOC_WS2 | 1
615#define SIO_ENABLE_CIRCULAR_QUEUEING IOC_WS2 | 2
616#define SIO_FIND_ROUTE IOC_OUT | IOC_WS2 | 3
617#define SIO_FLUSH IOC_WS2 | 4
618#define SIO_GET_BROADCAST_ADDRESS IOC_OUT | IOC_WS2 | 5
619#define SIO_GET_EXTENSION_FUNCTION_POINTER IOC_INOUT | IOC_WS2 | 6
620#define SIO_GET_QOS IOC_INOUT | IOC_WS2 | 7
621#define SIO_GET_GROUP_QOS IOC_INOUT | IOC_WS2 | 8
622#define SIO_MULTIPOINT_LOOPBACK IOC_IN | IOC_WS2 | 9
623#define SIO_MULTICAST_SCOPE IOC_IN | IOC_WS2 | 10
624#define SIO_SET_QOS IOC_IN | IOC_WS2 | 11
625#define SIO_SET_GROUP_QOS IOC_IN | IOC_WS2 | 12
626#define SIO_TRANSLATE_HANDLE IOC_INOUT | IOC_WS2 | 13
627
629#define TH_NETDEV 0x00000001
630#define TH_TAPI 0x00000002
631
632#define SERVICE_MULTIPLE 0x00000001
633
635#define NS_ALL (0)
636
637#define NS_SAP (1)
638#define NS_NDS (2)
639#define NS_PEER_BROWSE (3)
640
641#define NS_TCPIP_LOCAL (10)
642#define NS_TCPIP_HOSTS (11)
643#define NS_DNS (12)
644#define NS_NETBT (13)
645#define NS_WINS (14)
646
647#define NS_NBP (20)
648
649#define NS_MS (30)
650#define NS_STDA (31)
651#define NS_NTDS (32)
652
653#define NS_X500 (40)
654#define NS_NIS (41)
655#define NS_NISPLUS (42)
656
657#define NS_WRQ (50)
658
660#define RES_UNUSED_1 0x00000001
661#define RES_FLUSH_CACHE 0x00000002
662#define RES_SERVICE 0x00000004
663
665#define SERVICE_TYPE_VALUE_IPXPORTA "IpxSocket"
666#define SERVICE_TYPE_VALUE_IPXPORTW L"IpxSocket"
667
668#define SERVICE_TYPE_VALUE_SAPIDA "SapId"
669#define SERVICE_TYPE_VALUE_SAPIDW L"SapId"
670
671#define SERVICE_TYPE_VALUE_TCPPORTA "TcpPort"
672#define SERVICE_TYPE_VALUE_TCPPORTW L"TcpPort"
673
674#define SERVICE_TYPE_VALUE_UDPPORTA "UdpPort"
675#define SERVICE_TYPE_VALUE_UDPPORTW L"UdpPort"
676
677#define SERVICE_TYPE_VALUE_OBJECTIDA "ObjectId"
678#define SERVICE_TYPE_VALUE_OBJECTIDW L"ObjectId"
679
680#define SERVICE_TYPE_VALUE_SAPID SERVICE_TYPE_VALUE_SAPIDA
681#define SERVICE_TYPE_VALUE_TCPPORT SERVICE_TYPE_VALUE_TCPPORTA
682#define SERVICE_TYPE_VALUE_UDPPORT SERVICE_TYPE_VALUE_UDPPORTA
683#define SERVICE_TYPE_VALUE_OBJECTID SERVICE_TYPE_VALUE_OBJECTIDA
684
685#define LUP_DEEP 0x0001
686#define LUP_CONTAINERS 0x0002
687#define LUP_NOCONTAINERS 0x0004
688#define LUP_NEAREST 0x0008
689#define LUP_RETURN_NAME 0x0010
690#define LUP_RETURN_TYPE 0x0020
691#define LUP_RETURN_VERSION 0x0040
692#define LUP_RETURN_COMMENT 0x0080
693#define LUP_RETURN_ADDR 0x0100
694#define LUP_RETURN_BLOB 0x0200
695#define LUP_RETURN_ALIASES 0x0400
696#define LUP_RETURN_QUERY_STRING 0x0800
697#define LUP_RETURN_ALL 0x0FF0
698#define LUP_RES_SERVICE 0x8000
699
700#define LUP_FLUSHCACHE 0x1000
701#define LUP_FLUSHPREVIOUS 0x2000
702
704#define RESULT_IS_ALIAS 0x0001
705
707#define MSG_TRUNC 0x0100
708#define MSG_CTRUNC 0x0200
709#define MSG_BCAST 0x0400
710#define MSG_MCAST 0x0800
711
713#define POLLRDNORM 0x0100
714#define POLLRDBAND 0x0200
715#define POLLIN (POLLRDNORM | POLLRDBAND)
716#define POLLPRI 0x0400
717
718#define POLLWRNORM 0x0010
719#define POLLOUT (POLLWRNORM)
720#define POLLWRBAND 0x0020
721
722#define POLLERR 0x0001
723#define POLLHUP 0x0002
724#define POLLNVAL 0x0004
725
727#define EAI_AGAIN WSATRY_AGAIN
728#define EAI_BADFLAGS WSAEINVAL
729#define EAI_FAIL WSANO_RECOVERY
730#define EAI_FAMILY WSAEAFNOSUPPORT
731#define EAI_MEMORY WSA_NOT_ENOUGH_MEMORY
733#define EAI_NONAME WSAHOST_NOT_FOUND
734#define EAI_SERVICE WSATYPE_NOT_FOUND
735#define EAI_SOCKTYPE WSAESOCKTNOSUPPORT
736
737#define EAI_NODATA EAI_NONAME
738
741#define AI_PASSIVE 0x00000001
742#define AI_CANONNAME 0x00000002
743#define AI_NUMERICHOST 0x00000004
744#define AI_NUMERICSERV 0x00000008
745#define AI_ALL 0x00000100
746#define AI_ADDRCONFIG 0x00000400
747#define AI_V4MAPPED 0x00000800
748#define AI_NON_AUTHORITATIVE 0x00004000
749#define AI_SECURE 0x00008000
750#define AI_RETURN_PREFERRED_NAMES 0x00010000
751#define AI_FQDN 0x00020000
752#define AI_FILESERVER 0x00040000
753
755#define NI_NOFQDN 0x01
756#define NI_NUMERICHOST 0x02
757#define NI_NAMEREQD 0x04
758#define NI_NUMERICSERV 0x08
759#define NI_DGRAM 0x10
760
761#define NI_MAXHOST 1025
762#define NI_MAXSERV 32
763
764#define INET_ADDRSTR_ANY "0.0.0.0"
765#define INET6_ADDRSTR_ANY "::"
766
767#define INET_ADDRSTR_BROADCAST "255.255.255.255"
768
769#define INET_ADDRSTRLEN 16
770#define INET6_ADDRSTRLEN 46
771
772#define IN6ADDR_ANY_INIT {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
773#define IN6ADDR_LOOPBACK_INIT {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
774
776typedef unsigned char u_char;
777typedef unsigned short u_short;
778typedef unsigned int u_int;
779typedef unsigned long u_long;
780
781typedef char MBChar;
782
783typedef struct _fd_set
784{
788
789typedef struct _wstimeval
790{
791 int32_t tv_sec;
792 int32_t tv_usec;
794
795typedef struct _hostent
796{
797 char *h_name;
798 char **h_aliases;
799 int16_t h_addrtype;
800 int16_t h_length;
801 char **h_addr_list;
803
804typedef struct _netent
805{
806 char *n_name;
807 char **n_aliases;
808 int16_t n_addrtype;
811
812typedef struct _servent
813{
814 char *s_name;
815 char **s_aliases;
816 int16_t s_port;
817 char *s_proto;
819
820typedef struct _protoent
821{
822 char *p_name;
823 char **p_aliases;
824 int16_t p_proto;
826
827typedef struct _in_addr
828{
829 union
830 {
832 struct { u_short s_w1,s_w2; } S_un_w;
834 u_char S_bytes[4];
836#define s_addr S_un.S_addr
838
840typedef struct _in6_addr
841{
842 union
843 {
844 uint8_t u6_addr8[16];
845 uint16_t u6_addr16[8];
846 uint32_t u6_addr32[4];
847 int8_t s6_addr8[16];
848 int8_t s6_addr[16];
849 int16_t s6_addr16[8];
850 int32_t s6_addr32[4];
851 };
853
855typedef struct _ipx_addr
856{
857 uint8_t s_net[4];
858 uint8_t s_node[6];
859 uint16_t s_socket;
861
862typedef struct _sockaddr_in
863{
867 char sin_zero[8];
869
879
886
888typedef struct _sockaddr
889{
891 char sa_data[14];
893
894typedef sockaddr SOCKADDR;
895
897typedef struct _sockproto
898{
902
904typedef struct _sockaddr_storage
905{
907
909 // implementation specific pad up to
910 // alignment field that follows explicit
911 // in the data structure
912 __int64_t __ss_align;
914 // _SS_MAXSIZE value minus size of
915 // ss_family, __ss_pad1, and
916 // __ss_align fields is 112
918
920typedef struct _linger
921{
925
926typedef struct _WSADATA
927{
928 uint16_t wversion;
929 uint16_t whighversion;
932 uint16_t imaxsockets;
933 uint16_t imaxudpdg;
934 char *lpvendorinfo;
936
938
939typedef struct _BLOB
940{
941 uint32_t cbsize;
942 uint8_t *pblobdata;
944
946typedef struct _WSABUF
947{
948 uint32_t len;
949 char *buf;
951
952typedef int32_t SERVICETYPE;
953
965
972
973typedef u_long GROUP;
974
981
982typedef struct _WSAPROTOCOLCHAIN
983{
985 // length = 0 means layered protocol,
986 // length = 1 means base protocol,
987 // length > 1 means protocol chain
990
1014
1038
1045
1054
1061
1063typedef struct _AFPROTOCOLS
1064{
1066 int32_t iprotocol;
1068
1070
1077
1083
1102
1121
1123
1133
1134typedef struct _WSAPOLLFD
1135{
1137 short events;
1138 short revents;
1140
1148
1158
1167
1169
1177
1185
1187
1196
1205
1207
1210typedef int32_t STDCALL (*LPCONDITIONPROC)(WSABUF *lpcallerid, WSABUF *lpcallerdata, QOS *lpsqos, QOS *lpgqos, WSABUF *lpcalleeid, WSABUF *lpcalleedata, GROUP *g, uintptr_t dwcallbackdata);
1211typedef void STDCALL (*LPWSAOVERLAPPED_COMPLETION_ROUTINE)(uint32_t dwerror, uint32_t cbtransferred, WSAOVERLAPPED *lpoverlapped, uint32_t dwflags);
1212
1214typedef struct _ADDRINFO ADDRINFO;
1226
1230
1231void STDCALL WS2AsyncStart(void *data);
1232
1234
1239SOCKET STDCALL accept(SOCKET s, SOCKADDR *addr, int32_t *addrlen);
1240
1245int32_t STDCALL bind(SOCKET s, SOCKADDR *addr, int32_t namelen);
1246
1252
1257int32_t STDCALL connect(SOCKET s, SOCKADDR *name, int32_t namelen);
1258
1263int32_t STDCALL ioctlsocket(SOCKET s, int32_t cmd, u_long *arg);
1264
1269int32_t STDCALL getpeername(SOCKET s, SOCKADDR *name, int32_t *namelen);
1270
1275int32_t STDCALL getsockname(SOCKET s, SOCKADDR *name, int32_t *namelen);
1276
1281int32_t STDCALL getsockopt(SOCKET s, int32_t level, int32_t optname, char *optval, int32_t *optlen);
1282
1287uint64_t STDCALL htond(double_t hostdouble);
1288
1293uint32_t STDCALL htonf(float_t hostfloat);
1294
1300
1305uint64_t STDCALL htonll(uint64_t hostlonglong);
1306
1312
1318u_long STDCALL inet_addr(const char *cp);
1319
1329
1334int32_t STDCALL listen(SOCKET s, int32_t backlog);
1335
1340double_t STDCALL ntohd(uint64_t netdouble);
1341
1346float_t STDCALL ntohf(uint32_t netfloat);
1347
1353
1358uint64_t STDCALL ntohll(uint64_t netlonglong);
1359
1365
1370int32_t STDCALL recv(SOCKET s, char *buf, int32_t len, int32_t flags);
1371
1376int32_t STDCALL recvfrom(SOCKET s, char *buf, int32_t len, int32_t flags, SOCKADDR *from, int32_t *fromlen);
1377
1383int32_t STDCALL select(int32_t nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, wstimeval *timeout);
1384
1389int32_t STDCALL send(SOCKET s, const char *buf, int32_t len, int32_t flags);
1390
1395int32_t STDCALL sendto(SOCKET s, const char *buf, int32_t len, int32_t flags, SOCKADDR *addrto, int32_t tolen);
1396
1401int32_t STDCALL setsockopt(SOCKET s, int32_t level, int32_t optname, const char *optval, int32_t optlen);
1402
1407int32_t STDCALL shutdown(SOCKET s, int32_t how);
1408
1413SOCKET STDCALL socket(int32_t af, int32_t type, int32_t protocol);
1414
1420hostent * STDCALL gethostbyaddr(void *addr, int32_t len, int32_t family);
1421
1426hostent * STDCALL gethostbyname(const char *name);
1427
1432int32_t STDCALL gethostname(char *name, int32_t len);
1433
1439servent * STDCALL getservbyport(int32_t port, const char *proto);
1440
1445servent * STDCALL getservbyname(const char *name, const char *proto);
1446
1452
1457protoent * STDCALL getprotobyname(const char *name);
1458
1463int32_t STDCALL getaddrinfo(const char *pnodename, const char *pservicename, ADDRINFO *phints, ADDRINFO **ppresult);
1464
1470
1475int STDCALL getnameinfo(SOCKADDR *sa, int salen, char *host, uint32_t hostlen, char *serv, uint32_t servlen, int flags);
1476
1481int32_t STDCALL WSAStartup(uint16_t wversionrequired, WSADATA *wsdata);
1482
1487int32_t STDCALL WSACleanup(void);
1488
1493void STDCALL WSASetLastError(int32_t ierror);
1494
1504HANDLE STDCALL WSAAsyncGetServByName(HWND hwindow, u_int wmsg, const char *name, const char *proto, char *buf, int32_t buflen);
1505HANDLE STDCALL WSAAsyncGetServByPort(HWND hwindow, u_int wmsg, u_int port, const char *proto, char *buf, int32_t buflen);
1506HANDLE STDCALL WSAAsyncGetProtoByName(HWND hwindow, u_int wmsg, const char *name, char *buf, int32_t buflen);
1507HANDLE STDCALL WSAAsyncGetProtoByNumber(HWND hwindow, u_int wmsg, int32_t number, char *buf, int32_t buflen);
1508HANDLE STDCALL WSAAsyncGetHostByName(HWND hwindow, u_int wmsg, const char *name, char *buf, int32_t buflen);
1509HANDLE STDCALL WSAAsyncGetHostByAddr(HWND hwindow, u_int wmsg, const char *addr, int32_t len, int32_t family, char *buf, int32_t buflen);
1510int32_t STDCALL WSACancelAsyncRequest(HANDLE hasynctaskhandle);
1511int32_t STDCALL WSAAsyncSelect(SOCKET s, HWND hwindow, u_int wmsg, int32_t levent);
1512
1518
1520
1526int32_t STDCALL inet_pton(int32_t family, const char *pszaddrstring, void *paddrbuf);
1527
1533int32_t STDCALL InetPtonA(int32_t family, const char *pszaddrstring, void *paddrbuf);
1534
1540int32_t STDCALL InetPtonW(int32_t family, const WCHAR *pszaddrstring, void *paddrbuf);
1541
1547char * STDCALL inet_ntop(int32_t family, void *paddr, char *pstringbuf, int32_t stringbufsize);
1548
1554char * STDCALL InetNtopA(int32_t family, void *paddr, char *pstringbuf, int32_t stringbufsize);
1555
1561WCHAR * STDCALL InetNtopW(int32_t family, void *paddr, WCHAR *pstringbuf, int32_t stringbufsize);
1562
1567SOCKET STDCALL WSAAccept(SOCKET s, SOCKADDR *addr, int32_t *addrlen, LPCONDITIONPROC lpfncondition, uintptr_t dwcallbackdata);
1568
1574
1580int32_t STDCALL WSAConnect(SOCKET s, SOCKADDR *name, int32_t namelen, WSABUF *lpcallerdata, WSABUF *lpcalleedata, QOS *lpsqos, QOS *lpgqos);
1581BOOL STDCALL WSAConnectByList(SOCKET s, SOCKET_ADDRESS_LIST *socketaddresslist, uint32_t *localaddresslength, SOCKADDR *localaddress, uint32_t *remoteaddresslength, SOCKADDR *remoteaddress, wstimeval *timeout, WSAOVERLAPPED *reserved);
1582BOOL STDCALL WSAConnectByNameA(SOCKET s, char *nodename, char *servicename, uint32_t *localaddresslength, SOCKADDR *localaddress, uint32_t *remoteaddresslength, SOCKADDR *remoteaddress, wstimeval *timeout, WSAOVERLAPPED *reserved);
1583BOOL STDCALL WSAConnectByNameW(SOCKET s, WCHAR *nodename, WCHAR *servicename, uint32_t *localaddresslength, SOCKADDR *localaddress, uint32_t *remoteaddresslength, SOCKADDR *remoteaddress, wstimeval *timeout, WSAOVERLAPPED *reserved);
1584
1590int32_t STDCALL WSADuplicateSocketA(SOCKET s, uint32_t dwprocessid, WSAPROTOCOL_INFOA *lpprotocolinfo);
1591int32_t STDCALL WSADuplicateSocketW(SOCKET s, uint32_t dwprocessid, WSAPROTOCOL_INFOW *lpprotocolinfo);
1592
1597int32_t STDCALL WSAEnumNetworkEvents(SOCKET s, WSAEVENT heventobject, WSANETWORKEVENTS *lpnetworkevents);
1598int32_t STDCALL WSAEnumProtocolsA(int32_t *lpiprotocols, WSAPROTOCOL_INFOA *lpprotocolbuffer, uint32_t *lpdwbufferlength);
1599int32_t STDCALL WSAEnumProtocolsW(int32_t *lpiprotocols, WSAPROTOCOL_INFOW *lpprotocolbuffer, uint32_t *lpdwbufferlength);
1600
1605int32_t STDCALL WSAEventSelect(SOCKET s, WSAEVENT heventobject, int32_t lnetworkevents);
1606
1611BOOL STDCALL WSAGetOverlappedResult(SOCKET s, WSAOVERLAPPED *lpoverlapped, DWORD *lpcbtransfer, BOOL fwait, uint32_t *lpdwflags);
1613
1618int32_t STDCALL WSAHtonl(SOCKET s, u_long hostlong, uint32_t *lpnetlong);
1619
1624int32_t STDCALL WSAHtons(SOCKET s, u_short hostshort, uint16_t *lpnetshort);
1625
1630int32_t STDCALL WSAIoctl(SOCKET s, uint32_t dwiocontrolcode, void *lpvinbuffer, uint32_t cbinbuffer, void *lpvoutbuffer, uint32_t cboutbuffer, DWORD *lpcbbytesreturned, WSAOVERLAPPED *lpoverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpcompletionroutine);
1631SOCKET STDCALL WSAJoinLeaf(SOCKET s, SOCKADDR *name, int32_t namelen, WSABUF *lpcallerdata, WSABUF *lpcalleedata, QOS *lpsqos, QOS *lpgqos, uint32_t dwflags);
1632
1637int32_t STDCALL WSANtohl(SOCKET s, u_long netlong, uint32_t *lphostlong);
1638
1643int32_t STDCALL WSANtohs(SOCKET s, u_short netshort, uint16_t *lphostshort);
1644
1649int32_t STDCALL WSAPoll(WSAPOLLFD *fdarray, ULONG fds, int32_t timeout);
1650int32_t STDCALL WSAProviderConfigChange(HANDLE *lpnotificationhandle, WSAOVERLAPPED *lpoverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpcompletionroutine);
1651
1656int32_t STDCALL WSARecv(SOCKET s, WSABUF *lpbuffers, uint32_t dwbuffercount, uint32_t *lpnumberofbytesrecvd, uint32_t *lpflags, WSAOVERLAPPED *lpoverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpcompletionroutine);
1657int32_t STDCALL WSARecvDisconnect(SOCKET s, WSABUF *lpinbounddisconnectdata);
1658
1663int32_t STDCALL WSARecvFrom(SOCKET s, WSABUF *lpbuffers, uint32_t dwbuffercount, uint32_t *lpnumberofbytesrecvd, uint32_t *lpflags, SOCKADDR *lpfrom, int32_t *lpfromlen, WSAOVERLAPPED *lpoverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpcompletionroutine);
1664
1670int32_t STDCALL WSARecvMsg(SOCKET s, WSAMSG *lpmsg, uint32_t *lpdwnumberofbytesrecvd, WSAOVERLAPPED *lpoverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpcompletionroutine);
1671
1677
1682int32_t STDCALL WSASend(SOCKET s, WSABUF *lpbuffers, uint32_t dwbuffercount, uint32_t *lpnumberofbytessent, uint32_t dwflags, WSAOVERLAPPED *lpoverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpcompletionroutine);
1683int32_t STDCALL WSASendDisconnect(SOCKET s, WSABUF *lpoutbounddisconnectdata);
1684
1689int32_t STDCALL WSASendTo(SOCKET s, WSABUF *lpbuffers, uint32_t dwbuffercount, uint32_t *lpnumberofbytessent, uint32_t dwflags, SOCKADDR *lpto, int32_t itolen, WSAOVERLAPPED *lpoverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpcompletionroutine);
1690
1696int32_t STDCALL WSASendMsg(SOCKET s, WSAMSG *lpmsg, uint32_t dwflags, uint32_t *lpnumberofbytessent, WSAOVERLAPPED *lpoverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpcompletionroutine);
1697
1703
1710SOCKET STDCALL WSASocketA(int32_t af, int32_t itype, int32_t protocol, WSAPROTOCOL_INFOA *lpprotocolinfo, GROUP g, uint32_t dwflags);
1711
1718SOCKET STDCALL WSASocketW(int32_t af, int32_t itype, int32_t protocol, WSAPROTOCOL_INFOW *lpprotocolinfo, GROUP g, uint32_t dwflags);
1719
1724uint32_t STDCALL WSAWaitForMultipleEvents(uint32_t cevents, WSAEVENT *lphevents, BOOL fwaitall, uint32_t dwtimeout, BOOL falertable);
1725
1732int32_t STDCALL WSAAddressToStringA(SOCKADDR *lpsaaddress, uint32_t dwaddresslength, WSAPROTOCOL_INFOA *lpprotocolinfo, char *lpszaddressstring, uint32_t *lpdwaddressstringlength);
1733
1740int32_t STDCALL WSAAddressToStringW(SOCKADDR *lpsaaddress, uint32_t dwaddresslength, WSAPROTOCOL_INFOW *lpprotocolinfo, WCHAR *lpszaddressstring, uint32_t *lpdwaddressstringlength);
1741
1748int32_t STDCALL WSAStringToAddressA(const char *addressstring, int32_t addressfamily, WSAPROTOCOL_INFOA *lpprotocolinfo, SOCKADDR *lpaddress, int32_t *lpaddresslength);
1749
1756int32_t STDCALL WSAStringToAddressW(const WCHAR *addressstring, int32_t addressfamily, WSAPROTOCOL_INFOA *lpprotocolinfo, SOCKADDR *lpaddress, int32_t *lpaddresslength);
1757
1759int32_t STDCALL WSALookupServiceBeginA(WSAQUERYSETA *lpqsrestrictions, uint32_t dwcontrolflags, HANDLE *lphlookup);
1760int32_t STDCALL WSALookupServiceBeginW(WSAQUERYSETW *lpqsrestrictions, uint32_t dwcontrolflags, HANDLE *lphlookup);
1761
1762int32_t STDCALL WSALookupServiceNextA(HANDLE hlookup, uint32_t dwcontrolflags, uint32_t *lpdwbufferlength, WSAQUERYSETA *lpqsresults);
1763int32_t STDCALL WSALookupServiceNextW(HANDLE hlookup, uint32_t dwcontrolflags, uint32_t *lpdwbufferlength, WSAQUERYSETW *lpqsresults);
1767int32_t STDCALL WSARemoveServiceClass(GUID *lpserviceclassid);
1768int32_t STDCALL WSAGetServiceClassInfoA(GUID *lpproviderid, GUID *lpserviceclassid, uint32_t *lpdwbufsize, WSASERVICECLASSINFOA *lpserviceclassinfo);
1769int32_t STDCALL WSAGetServiceClassInfoW(GUID *lpproviderid, GUID *lpserviceclassid, uint32_t *lpdwbufsize, WSASERVICECLASSINFOW *lpserviceclassinfo);
1770
1771int32_t STDCALL WSAEnumNameSpaceProvidersA(uint32_t *lpdwbufferlength, WSANAMESPACE_INFOA *lpnspbuffer);
1772int32_t STDCALL WSAEnumNameSpaceProvidersW(uint32_t *lpdwbufferlength, WSANAMESPACE_INFOW *lpnspbuffer);
1773
1774int32_t STDCALL WSAGetServiceClassNameByClassIdA(GUID *lpserviceclassid, char *lpszserviceclassname, uint32_t *lpdwbufferlength);
1775int32_t STDCALL WSAGetServiceClassNameByClassIdW(GUID *lpserviceclassid, WCHAR *lpszserviceclassname, uint32_t *lpdwbufferlength);
1776int32_t STDCALL WSASetServiceA(WSAQUERYSETA *lpqsreginfo, WSAESETSERVICEOP essoperation, uint32_t dwcontrolflags);
1777int32_t STDCALL WSASetServiceW(WSAQUERYSETW *lpqsreginfo, WSAESETSERVICEOP essoperation, uint32_t dwcontrolflags);
1778
1779int32_t STDCALL WSAMakeSyncReply(uint16_t buflen, uint16_t error);
1780int32_t STDCALL WSAMakeSelectReply(uint16_t event, uint16_t error);
1781uint16_t STDCALL WSAGetAsyncBuflen(int32_t param);
1782uint16_t STDCALL WSAGetAsyncError(int32_t param);
1783uint16_t STDCALL WSAGetSelectEvent(int32_t param);
1784uint16_t STDCALL WSAGetSelectError(int32_t param);
1785
1791
1797
1803
1809
1811int STDCALL WsControl(uint32_t proto, uint32_t action, void *prequestinfo, uint32_t *pcbrequestinfolen, void *presponseinfo, uint32_t *pcbresponseinfolen);
1812
1817netent * STDCALL getnetbyaddr(void *addr, int len, int type);
1818
1822netent * STDCALL getnetbyname(const char *name);
1823
1825int STDCALL WsControlEx(uint32_t proto, uint32_t action, void *prequestinfo, uint32_t *pcbrequestinfolen, void *presponseinfo, uint32_t *pcbresponseinfolen);
1826
1828
1837
1846
1847uint32_t STDCALL Winsock2ErrorToString(int32_t error, char *string, uint32_t len);
1848
1849#ifdef __cplusplus
1850}
1851#endif
1852
1853#endif // _ULTIBO_WINSOCK2_H
void * FARPROC
Definition globaltypes.h:64
size_t HANDLE
Definition globaltypes.h:51
#define STDCALL
Definition globaltypes.h:45
HANDLE WSAEVENT
Definition globaltypes.h:62
_Bool BOOL
Built in Boolean type (1 byte) (Redeclared here for flexibility).
Definition globaltypes.h:55
struct _OVERLAPPED OVERLAPPED
Definition globaltypes.h:70
wchar_t WCHAR
Standard WideChar type (2 bytes) (Redeclared here for flexibility).
Definition globaltypes.h:58
uint32_t DWORD
Definition globaltypes.h:53
size_t SOCKET
Definition globaltypes.h:60
Definition winsock2.h:1216
SOCKADDR * ai_addr
Binary address.
Definition winsock2.h:1223
int32_t ai_socktype
SOCK_xxx.
Definition winsock2.h:1219
int32_t ai_protocol
0 or IPPROTO_xxx for IPv4 and IPv6
Definition winsock2.h:1220
int32_t ai_flags
AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST.
Definition winsock2.h:1217
ADDRINFO * ai_next
Next structure in linked list.
Definition winsock2.h:1224
size_t ai_addrlen
Length of ai_addr.
Definition winsock2.h:1221
char * ai_canonname
Canonical name for nodename.
Definition winsock2.h:1222
int32_t ai_family
PF_xxx.
Definition winsock2.h:1218
Definition winsock2.h:1064
int32_t iprotocol
Definition winsock2.h:1066
int32_t iaddressfamily
Definition winsock2.h:1065
Definition winsock2.h:940
uint8_t * pblobdata
Definition winsock2.h:942
uint32_t cbsize
Definition winsock2.h:941
Definition winsock2.h:1048
int32_t iprotocol
Definition winsock2.h:1052
int32_t isockettype
Definition winsock2.h:1051
SOCKET_ADDRESS remoteaddr
Definition winsock2.h:1050
SOCKET_ADDRESS localaddr
Definition winsock2.h:1049
Definition winsock2.h:955
int32_t tokenrate
In Bytes/sec.
Definition winsock2.h:956
int32_t tokenbucketsize
In Bytes.
Definition winsock2.h:957
int32_t delayvariation
In microseconds.
Definition winsock2.h:960
int32_t minimumpolicedsize
In Bytes.
Definition winsock2.h:963
int32_t maxsdusize
Definition winsock2.h:962
int32_t latency
In microseconds.
Definition winsock2.h:959
SERVICETYPE servicetype
Definition winsock2.h:961
int32_t peakbandwidth
In Bytes/sec.
Definition winsock2.h:958
Definition winsock2.h:967
WSABUF providerspecific
additional provider specific stuff
Definition winsock2.h:970
FLOWSPEC receivingflowspec
the flow spec for data receiving
Definition winsock2.h:969
FLOWSPEC sendingflowspec
the flow spec for data sending
Definition winsock2.h:968
Definition winsock2.h:1057
int32_t iaddresscount
Definition winsock2.h:1058
array[0..0] of SOCKET_ADDRESS address
Definition winsock2.h:1059
Definition winsock2.h:1041
SOCKADDR * lpsockaddr
Definition winsock2.h:1042
int32_t isockaddrlength
Definition winsock2.h:1043
Definition winsock2.h:947
char * buf
the pointer to the buffer
Definition winsock2.h:949
uint32_t len
the length of the buffer
Definition winsock2.h:948
Definition winsock.h:589
uint16_t wversion
Definition winsock.h:590
char szdescription[WSADESCRIPTION_LEN+1]
Definition winsock.h:592
uint16_t whighversion
Definition winsock.h:591
uint16_t imaxsockets
Definition winsock.h:594
char szsystemstatus[WSASYS_STATUS_LEN+1]
Definition winsock.h:593
uint16_t imaxudpdg
Definition winsock.h:595
char * lpvendorinfo
Definition winsock.h:596
Definition winsock2.h:1125
WSABUF * lpbuffers
Definition winsock2.h:1128
int32_t namelen
Definition winsock2.h:1127
WSABUF control
Definition winsock2.h:1130
uint32_t dwflags
Definition winsock2.h:1131
uint32_t dwbuffercount
Definition winsock2.h:1129
SOCKET_ADDRESS * name
Definition winsock2.h:1126
Definition winsock2.h:1189
GUID nsproviderid
Definition winsock2.h:1190
BOOL factive
Definition winsock2.h:1192
int32_t dwnamespace
Definition winsock2.h:1191
int32_t dwversion
Definition winsock2.h:1193
char * lpszidentifier
Definition winsock2.h:1194
Definition winsock2.h:1198
GUID nsproviderid
Definition winsock2.h:1199
BOOL factive
Definition winsock2.h:1201
int32_t dwnamespace
Definition winsock2.h:1200
WCHAR * lpszidentifier
Definition winsock2.h:1203
int32_t dwversion
Definition winsock2.h:1202
Definition winsock2.h:977
int ierrorcode[FD_MAX_EVENTS]
Definition winsock2.h:979
long lnetworkevents
Definition winsock2.h:978
Definition winsock2.h:1151
int32_t dwnamespace
Definition winsock2.h:1153
int32_t dwvaluetype
Definition winsock2.h:1154
char * lpszname
Definition winsock2.h:1152
int32_t dwvaluesize
Definition winsock2.h:1155
void * lpvalue
Definition winsock2.h:1156
Definition winsock2.h:1160
int32_t dwnamespace
Definition winsock2.h:1162
WCHAR * lpszname
Definition winsock2.h:1161
int32_t dwvaluetype
Definition winsock2.h:1163
int32_t dwvaluesize
Definition winsock2.h:1164
void * lpvalue
Definition winsock2.h:1165
Definition winsock2.h:1135
short events
Definition winsock2.h:1137
SOCKET fd
Definition winsock2.h:1136
short revents
Definition winsock2.h:1138
Definition winsock2.h:983
int ChainLen
the length of the chain,
Definition winsock2.h:984
DWORD ChainEntries[MAX_PROTOCOL_CHAIN]
a list of dwCatalogEntryIds
Definition winsock2.h:988
Definition winsock2.h:992
int32_t dwserviceflags1
Definition winsock2.h:993
int32_t imaxsockaddr
Definition winsock2.h:1003
int32_t dwserviceflags2
Definition winsock2.h:994
int32_t iprotocol
Definition winsock2.h:1006
int32_t iaddressfamily
Definition winsock2.h:1002
int32_t isecurityscheme
Definition winsock2.h:1009
int32_t isockettype
Definition winsock2.h:1005
int32_t dwmessagesize
Definition winsock2.h:1010
int32_t dwserviceflags3
Definition winsock2.h:995
int32_t inetworkbyteorder
Definition winsock2.h:1008
int32_t dwproviderflags
Definition winsock2.h:997
WSAPROTOCOLCHAIN protocolchain
Definition winsock2.h:1000
int32_t iversion
Definition winsock2.h:1001
int32_t iprotocolmaxoffset
Definition winsock2.h:1007
int32_t dwcatalogentryid
Definition winsock2.h:999
int32_t dwserviceflags4
Definition winsock2.h:996
int32_t iminsockaddr
Definition winsock2.h:1004
int32_t dwproviderreserved
Definition winsock2.h:1011
GUID providerid
Definition winsock2.h:998
char szprotocol[WSAPROTOCOL_LEN+1]
Definition winsock2.h:1012
Definition winsock2.h:1016
WCHAR szprotocol[WSAPROTOCOL_LEN+1]
Definition winsock2.h:1036
int32_t dwserviceflags1
Definition winsock2.h:1017
int32_t imaxsockaddr
Definition winsock2.h:1027
int32_t dwserviceflags2
Definition winsock2.h:1018
int32_t iprotocol
Definition winsock2.h:1030
int32_t iaddressfamily
Definition winsock2.h:1026
int32_t isecurityscheme
Definition winsock2.h:1033
int32_t isockettype
Definition winsock2.h:1029
int32_t dwmessagesize
Definition winsock2.h:1034
int32_t dwserviceflags3
Definition winsock2.h:1019
int32_t inetworkbyteorder
Definition winsock2.h:1032
int32_t dwproviderflags
Definition winsock2.h:1021
WSAPROTOCOLCHAIN protocolchain
Definition winsock2.h:1024
int32_t iversion
Definition winsock2.h:1025
int32_t iprotocolmaxoffset
Definition winsock2.h:1031
int32_t dwcatalogentryid
Definition winsock2.h:1023
int32_t dwserviceflags4
Definition winsock2.h:1020
int32_t iminsockaddr
Definition winsock2.h:1028
int32_t dwproviderreserved
Definition winsock2.h:1035
GUID providerid
Definition winsock2.h:1022
Definition winsock2.h:1085
int32_t dwnumberofprotocols
Definition winsock2.h:1094
int32_t dwsize
Definition winsock2.h:1086
int32_t dwoutputflags
Definition winsock2.h:1099
int32_t dwnamespace
Definition winsock2.h:1091
BLOB * lpblob
Definition winsock2.h:1100
char * lpszserviceinstancename
Definition winsock2.h:1087
GUID * lpnsproviderid
Definition winsock2.h:1092
WSAVERSION * lpversion
Definition winsock2.h:1089
CSADDR_INFO * lpcsabuffer
Definition winsock2.h:1098
char * lpszcomment
Definition winsock2.h:1090
AFPROTOCOLS * lpafpprotocols
Definition winsock2.h:1095
char * lpszcontext
Definition winsock2.h:1093
char * lpszquerystring
Definition winsock2.h:1096
GUID * lpserviceclassid
Definition winsock2.h:1088
int32_t dwnumberofcsaddrs
Definition winsock2.h:1097
Definition winsock2.h:1104
int32_t dwnumberofprotocols
Definition winsock2.h:1113
int32_t dwsize
Definition winsock2.h:1105
int32_t dwoutputflags
Definition winsock2.h:1118
int32_t dwnamespace
Definition winsock2.h:1110
BLOB * lpblob
Definition winsock2.h:1119
WCHAR * lpszcontext
Definition winsock2.h:1112
GUID * lpnsproviderid
Definition winsock2.h:1111
WCHAR * lpszquerystring
Definition winsock2.h:1115
WSAVERSION * lpversion
Definition winsock2.h:1108
CSADDR_INFO * lpcsabuffer
Definition winsock2.h:1117
AFPROTOCOLS * lpafpprotocols
Definition winsock2.h:1114
WCHAR * lpszserviceinstancename
Definition winsock2.h:1106
WCHAR * lpszcomment
Definition winsock2.h:1109
GUID * lpserviceclassid
Definition winsock2.h:1107
int32_t dwnumberofcsaddrs
Definition winsock2.h:1116
Definition winsock2.h:1171
char * lpszserviceclassname
Definition winsock2.h:1173
WSANSCLASSINFOA * lpclassinfos
Definition winsock2.h:1175
int32_t dwcount
Definition winsock2.h:1174
GUID * lpserviceclassid
Definition winsock2.h:1172
Definition winsock2.h:1179
WSANSCLASSINFOW * lpclassinfos
Definition winsock2.h:1183
WCHAR * lpszserviceclassname
Definition winsock2.h:1181
int32_t dwcount
Definition winsock2.h:1182
GUID * lpserviceclassid
Definition winsock2.h:1180
Definition winsock2.h:1079
WSAECOMPARATOR echow
Definition winsock2.h:1081
int32_t dwversion
Definition winsock2.h:1080
Definition winsock.h:525
u_int fd_count
Definition winsock.h:526
SOCKET fd_array[FD_SETSIZE]
Definition winsock.h:527
Definition winsock.h:537
char ** h_aliases
Definition winsock.h:539
char ** h_addr_list
Definition winsock.h:542
int16_t h_addrtype
Definition winsock.h:540
char * h_name
Definition winsock.h:538
int16_t h_length
Definition winsock.h:541
Definition winsock2.h:841
int32_t s6_addr32[4]
Definition winsock2.h:850
uint32_t u6_addr32[4]
Definition winsock2.h:846
int8_t s6_addr[16]
Definition winsock2.h:848
uint8_t u6_addr8[16]
Definition winsock2.h:844
int8_t s6_addr8[16]
Definition winsock2.h:847
int16_t s6_addr16[8]
Definition winsock2.h:849
uint16_t u6_addr16[8]
Definition winsock2.h:845
Definition winsock.h:569
u_short s_w1
Definition winsock.h:573
u_char S_bytes[4]
Definition winsock.h:575
u_char s_b3
Definition winsock.h:572
u_long S_addr
Definition winsock.h:574
u_char s_b1
Definition winsock.h:572
u_short s_w2
Definition winsock.h:573
struct _in_addr::@075342254321346101047366012334126230275075004224::@277110075311252260327012205042033311124245066371 S_un_w
struct _in_addr::@075342254321346101047366012334126230275075004224::@354042140363320263321207227377267012345362375137 S_un_b
u_char s_b4
Definition winsock.h:572
u_char s_b2
Definition winsock.h:572
union _in_addr::@075342254321346101047366012334126230275075004224 S_un
Definition winsock2.h:856
uint8_t s_node[6]
Definition winsock2.h:858
uint16_t s_socket
Definition winsock2.h:859
uint8_t s_net[4]
Definition winsock2.h:857
Definition winsock.h:625
u_short l_onoff
Definition winsock.h:626
u_short l_linger
Definition winsock.h:627
Definition winsock.h:546
char ** n_aliases
Definition winsock.h:548
char * n_name
Definition winsock.h:547
int16_t n_addrtype
Definition winsock.h:549
u_long n_net
Definition winsock.h:550
Definition winsock.h:562
char * p_name
Definition winsock.h:563
char ** p_aliases
Definition winsock.h:564
int16_t p_proto
Definition winsock.h:565
Definition winsock.h:554
int16_t s_port
Definition winsock.h:557
char * s_proto
Definition winsock.h:558
char ** s_aliases
Definition winsock.h:556
char * s_name
Definition winsock.h:555
Definition winsock2.h:872
u_int sin6_scope_id
set of interfaces for a scope
Definition winsock2.h:877
in6_addr sin6_addr
IPv6 address.
Definition winsock2.h:876
u_short sin6_family
AF_INET6.
Definition winsock2.h:873
u_short sin6_port
transport layer port #
Definition winsock2.h:874
u_int sin6_flowinfo
IPv6 flow information.
Definition winsock2.h:875
Definition winsock.h:581
u_short sin_port
Definition winsock.h:583
in_addr sin_addr
Definition winsock.h:584
char sin_zero[8]
Definition winsock.h:585
u_short sin_family
Definition winsock.h:582
Definition winsock2.h:882
ipx_addr sipx_addr
IPX address.
Definition winsock2.h:884
u_short sipx_family
AF_IPX.
Definition winsock2.h:883
Definition winsock2.h:905
char __ss_pad1[_SS_PAD1SIZE]
6 byte pad, this is to make
Definition winsock2.h:908
u_short ss_family
address family
Definition winsock2.h:906
char __ss_pad2[_SS_PAD2SIZE]
112 byte pad to achieve desired size;
Definition winsock2.h:913
__int64_t __ss_align
Field to force desired structure.
Definition winsock2.h:912
Definition winsock.h:609
char sa_data[14]
up to 14 bytes of direct address
Definition winsock.h:611
u_short sa_family
address family
Definition winsock.h:610
Definition winsock.h:618
u_short sp_family
Definition winsock.h:619
u_short sp_protocol
Definition winsock.h:620
Definition winsock.h:531
int32_t tv_sec
Definition winsock.h:532
int32_t tv_usec
Definition winsock.h:533
HANDLE HWND
Definition ultibo.h:212
uint32_t ULONG
unsigned long // In Windows ULONG remains as 4 bytes (32-bit) regardless of 32-bit or 64-bit compiler
Definition ultibo.h:191
struct _GUID GUID
BOOL STDCALL WSAConnectByList(SOCKET s, SOCKET_ADDRESS_LIST *socketaddresslist, uint32_t *localaddresslength, SOCKADDR *localaddress, uint32_t *remoteaddresslength, SOCKADDR *remoteaddress, wstimeval *timeout, WSAOVERLAPPED *reserved)
HANDLE STDCALL WSAAsyncGetProtoByNumber(HWND hwindow, u_int wmsg, int32_t number, char *buf, int32_t buflen)
int32_t STDCALL WSAGetServiceClassNameByClassIdA(GUID *lpserviceclassid, char *lpszserviceclassname, uint32_t *lpdwbufferlength)
int32_t STDCALL WSAHtons(SOCKET s, u_short hostshort, uint16_t *lpnetshort)
Convert a u_short from host byte order to network byte order See the Windows Sockets 2 documentation ...
SOCKET STDCALL WSASocketA(int32_t af, int32_t itype, int32_t protocol, WSAPROTOCOL_INFOA *lpprotocolinfo, GROUP g, uint32_t dwflags)
Create a socket that is bound to a specific transport-service provider.
int32_t STDCALL gethostname(char *name, int32_t len)
Retrieve the standard host name for the local computer See the Windows Sockets 2 documentation for ad...
int32_t STDCALL WSANtohs(SOCKET s, u_short netshort, uint16_t *lphostshort)
Convert a u_short from network byte order to host byte order See the Windows Sockets 2 documentation ...
BOOL STDCALL WSASetEvent(WSAEVENT hevent)
Set the state of the specified event object to signaled See the Windows Sockets 2 documentation for a...
enum _WSAECOMPARATOR WSAECOMPARATOR
SOCKET STDCALL WSASocketW(int32_t af, int32_t itype, int32_t protocol, WSAPROTOCOL_INFOW *lpprotocolinfo, GROUP g, uint32_t dwflags)
Create a socket that is bound to a specific transport-service provider.
hostent *STDCALL gethostbyaddr(void *addr, int32_t len, int32_t family)
Retrieve the host information corresponding to a network address.
HANDLE STDCALL WSAAsyncGetServByPort(HWND hwindow, u_int wmsg, u_int port, const char *proto, char *buf, int32_t buflen)
SOCKET STDCALL accept(SOCKET s, SOCKADDR *addr, int32_t *addrlen)
Accept an incoming connection attempt on a socket See the Windows Sockets 2 documentation for additio...
void STDCALL WSASetLastError(int32_t ierror)
Set the error code that can be retrieved through the WSAGetLastError function See the Windows Sockets...
uint16_t STDCALL WSAGetSelectError(int32_t param)
int32_t STDCALL WSAGetServiceClassNameByClassIdW(GUID *lpserviceclassid, WCHAR *lpszserviceclassname, uint32_t *lpdwbufferlength)
int32_t STDCALL WSARemoveServiceClass(GUID *lpserviceclassid)
#define _SS_PAD2SIZE
Definition winsock2.h:291
int32_t STDCALL shutdown(SOCKET s, int32_t how)
Disable sends or receives on a socket See the Windows Sockets 2 documentation for additional informat...
int32_t STDCALL setsockopt(SOCKET s, int32_t level, int32_t optname, const char *optval, int32_t optlen)
Set a socket option See the Windows Sockets 2 documentation for additional information.
HANDLE STDCALL WSAAsyncGetProtoByName(HWND hwindow, u_int wmsg, const char *name, char *buf, int32_t buflen)
FARPROC STDCALL WSASetBlockingHook(FARPROC lpblockfunc)
int32_t STDCALL WSAStringToAddressA(const char *addressstring, int32_t addressfamily, WSAPROTOCOL_INFOA *lpprotocolinfo, SOCKADDR *lpaddress, int32_t *lpaddresslength)
Convert a network address in its standard text presentation form into its numeric binary form in a so...
protoent *STDCALL getprotobynumber(int32_t proto)
Retrieve protocol information corresponding to a protocol number See the Windows Sockets 2 documentat...
#define MAX_PROTOCOL_CHAIN
Definition winsock2.h:534
struct _WSASERVICECLASSINFOW WSASERVICECLASSINFOW
struct _WSANAMESPACE_INFOA WSANAMESPACE_INFOA
struct _WSAVERSION WSAVERSION
struct _WSANSCLASSINFOA WSANSCLASSINFOA
void STDCALL freeaddrinfo(ADDRINFO *ai)
Free address information that GetAddrInfo dynamically allocates in TAddrInfo structures See the Windo...
void STDCALL WS2AsyncStart(void *data)
int32_t STDCALL WSACancelBlockingCall(void)
_WSAECOMPARATOR
Definition winsock2.h:1073
@ COMP_EQUAL
Definition winsock2.h:1074
@ COMP_NOTLESS
Definition winsock2.h:1075
int32_t STDCALL WSARecvDisconnect(SOCKET s, WSABUF *lpinbounddisconnectdata)
int32_t STDCALL bind(SOCKET s, SOCKADDR *addr, int32_t namelen)
Associate a local address with a socket See the Windows Sockets 2 documentation for additional inform...
uint64_t STDCALL htond(double_t hostdouble)
Convert a double from host byte order to TCP/IP network byte order (which is big-endian) See the Wind...
struct _WSANAMESPACE_INFOW WSANAMESPACE_INFOW
struct _SOCKET_ADDRESS SOCKET_ADDRESS
BOOL STDCALL WSAGetOverlappedResult(SOCKET s, WSAOVERLAPPED *lpoverlapped, DWORD *lpcbtransfer, BOOL fwait, uint32_t *lpdwflags)
Retrieve the results of an overlapped operation on the specified socket See the Windows Sockets 2 doc...
#define FD_MAX_EVENTS
Definition winsock2.h:362
int32_t STDCALL recv(SOCKET s, char *buf, int32_t len, int32_t flags)
Receive data from a connected socket or a bound connectionless socket See the Windows Sockets 2 docum...
servent *STDCALL getservbyname(const char *name, const char *proto)
Retrieve service information corresponding to a service name and protocol See the Windows Sockets 2 d...
int32_t STDCALL WSARecvMsg(SOCKET s, WSAMSG *lpmsg, uint32_t *lpdwnumberofbytesrecvd, WSAOVERLAPPED *lpoverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpcompletionroutine)
Receive data and optional control information from connected and unconnected sockets.
struct _in6_addr in6_addr
int32_t STDCALL WSAMakeSyncReply(uint16_t buflen, uint16_t error)
int32_t STDCALL WSACleanup(void)
Terminate use of Winsock 2 by an application See the Windows Sockets 2 documentation for additional i...
uint64_t STDCALL ntohll(uint64_t netlonglong)
Convert an unsigned nt64 from TCP/IP network byte order to host byte order See the Windows Sockets 2 ...
u_long STDCALL inet_addr(const char *cp)
Convert a string containing an IPv4 dotted-decimal address into a proper address for the IN_ADDR stru...
int32_t STDCALL WSAInstallServiceClassA(WSASERVICECLASSINFOA *lpserviceclassinfo)
int32_t STDCALL WSASetServiceW(WSAQUERYSETW *lpqsreginfo, WSAESETSERVICEOP essoperation, uint32_t dwcontrolflags)
int32_t STDCALL listen(SOCKET s, int32_t backlog)
Place a socket in a state in which it is listening for incoming connections See the Windows Sockets 2...
int32_t STDCALL ioctlsocket(SOCKET s, int32_t cmd, u_long *arg)
Control the I/O mode of a socket See the Windows Sockets 2 documentation for additional information.
enum _WSAESETSERVICEOP WSAESETSERVICEOP
char *STDCALL InetNtopA(int32_t family, void *paddr, char *pstringbuf, int32_t stringbufsize)
Convert an IPv4 or IPv6 Internet network address into a string in Internet standard format.
int32_t STDCALL WSASendTo(SOCKET s, WSABUF *lpbuffers, uint32_t dwbuffercount, uint32_t *lpnumberofbytessent, uint32_t dwflags, SOCKADDR *lpto, int32_t itolen, WSAOVERLAPPED *lpoverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpcompletionroutine)
Send data to a specific destination, using overlapped I/O where applicable See the Windows Sockets 2 ...
WSANSCLASSINFOA WSANSCLASSINFO
Definition winsock2.h:1168
uint16_t STDCALL WSAGetAsyncError(int32_t param)
struct _WSANETWORKEVENTS WSANETWORKEVENTS
int32_t STDCALL WSADuplicateSocketW(SOCKET s, uint32_t dwprocessid, WSAPROTOCOL_INFOW *lpprotocolinfo)
struct _QOS QOS
#define WSAPROTOCOL_LEN
Definition winsock2.h:537
struct _BLOB BLOB
void STDCALL(* LPWSAOVERLAPPED_COMPLETION_ROUTINE)(uint32_t dwerror, uint32_t cbtransferred, WSAOVERLAPPED *lpoverlapped, uint32_t dwflags)
Definition winsock2.h:1211
double_t STDCALL ntohd(uint64_t netdouble)
Convert an unsigned int64 from TCP/IP network byte order to host byte order and return a double See t...
WSASERVICECLASSINFOA WSASERVICECLASSINFO
Definition winsock2.h:1186
int32_t STDCALL WSALookupServiceBeginA(WSAQUERYSETA *lpqsrestrictions, uint32_t dwcontrolflags, HANDLE *lphlookup)
int32_t STDCALL InetPtonW(int32_t family, const WCHAR *pszaddrstring, void *paddrbuf)
Convert an IPv4 or IPv6 Internet network address in its standard text presentation form into its nume...
int32_t STDCALL getsockopt(SOCKET s, int32_t level, int32_t optname, char *optval, int32_t *optlen)
Retrieve a socket option See the Windows Sockets 2 documentation for additional information.
u_long STDCALL htonl(u_long hostlong)
Convert a u_long from host byte order to TCP/IP network byte order (which is big-endian) See the Wind...
uint32_t STDCALL WSAWaitForMultipleEvents(uint32_t cevents, WSAEVENT *lphevents, BOOL fwaitall, uint32_t dwtimeout, BOOL falertable)
Wait for one or all of the specified event objects to be in the signaled state or the time-out interv...
int32_t STDCALL WSAEventSelect(SOCKET s, WSAEVENT heventobject, int32_t lnetworkevents)
Specify an event object to be associated with the requested set of FD_XXX network events See the Wind...
int32_t STDCALL WSAUnhookBlockingHook(void)
int32_t STDCALL WSAGetServiceClassInfoA(GUID *lpproviderid, GUID *lpserviceclassid, uint32_t *lpdwbufsize, WSASERVICECLASSINFOA *lpserviceclassinfo)
int32_t STDCALL WSAConnect(SOCKET s, SOCKADDR *name, int32_t namelen, WSABUF *lpcallerdata, WSABUF *lpcalleedata, QOS *lpsqos, QOS *lpgqos)
Establish a connection to another socket application and exchange connect data.
int32_t STDCALL inet_pton(int32_t family, const char *pszaddrstring, void *paddrbuf)
Convert an IPv4 or IPv6 Internet network address in its standard text presentation form into its nume...
uint64_t STDCALL htonll(uint64_t hostlonglong)
Convert an unsigned int64 from host byte order to TCP/IP network byte order (which is big-endian) See...
struct _WSASERVICECLASSINFOA WSASERVICECLASSINFOA
struct _WSAPROTOCOLCHAIN WSAPROTOCOLCHAIN
int32_t STDCALL sendto(SOCKET s, const char *buf, int32_t len, int32_t flags, SOCKADDR *addrto, int32_t tolen)
Send data to a specific destination See the Windows Sockets 2 documentation for additional informatio...
int32_t STDCALL WSADuplicateSocketA(SOCKET s, uint32_t dwprocessid, WSAPROTOCOL_INFOA *lpprotocolinfo)
int32_t STDCALL WSAHtonl(SOCKET s, u_long hostlong, uint32_t *lpnetlong)
Convert a u_long from host byte order to network byte order See the Windows Sockets 2 documentation f...
WSAQUERYSETA WSAQUERYSET
Definition winsock2.h:1122
int32_t STDCALL WSACancelAsyncRequest(HANDLE hasynctaskhandle)
int32_t STDCALL(* LPCONDITIONPROC)(WSABUF *lpcallerid, WSABUF *lpcallerdata, QOS *lpsqos, QOS *lpgqos, WSABUF *lpcalleeid, WSABUF *lpcalleedata, GROUP *g, uintptr_t dwcallbackdata)
Definition winsock2.h:1210
int32_t STDCALL getaddrinfo(const char *pnodename, const char *pservicename, ADDRINFO *phints, ADDRINFO **ppresult)
RFC 3493 protocol-independent translation from a host name to an address See the Windows Sockets 2 do...
char *STDCALL inet_ntop(int32_t family, void *paddr, char *pstringbuf, int32_t stringbufsize)
Convert an IPv4 or IPv6 Internet network address into a string in Internet standard format.
int32_t STDCALL recvfrom(SOCKET s, char *buf, int32_t len, int32_t flags, SOCKADDR *from, int32_t *fromlen)
Receive a datagram and store the source address See the Windows Sockets 2 documentation for additiona...
BOOL STDCALL FD_ISSET(SOCKET socket, fd_set *fdset)
Check if a socket is a member of an fd_set See the Windows Sockets 2 documentation for additional inf...
int32_t STDCALL WSAEnumProtocolsA(int32_t *lpiprotocols, WSAPROTOCOL_INFOA *lpprotocolbuffer, uint32_t *lpdwbufferlength)
int32_t STDCALL WSAAsyncSelect(SOCKET s, HWND hwindow, u_int wmsg, int32_t levent)
struct _WSAMSG WSAMSG
struct _WSAPROTOCOL_INFOW WSAPROTOCOL_INFOW
char *STDCALL inet_ntoa(in_addr inaddr)
Convert an (IPv4) Internet network address into an ASCII string in Internet standard dotted-decimal f...
uint32_t STDCALL Winsock2ErrorToString(int32_t error, char *string, uint32_t len)
protoent *STDCALL getprotobyname(const char *name)
Retrieve the protocol information corresponding to a protocol name See the Windows Sockets 2 document...
int32_t SERVICETYPE
Definition winsock2.h:952
int32_t STDCALL WSAEnumNameSpaceProvidersA(uint32_t *lpdwbufferlength, WSANAMESPACE_INFOA *lpnspbuffer)
int32_t STDCALL WSASend(SOCKET s, WSABUF *lpbuffers, uint32_t dwbuffercount, uint32_t *lpnumberofbytessent, uint32_t dwflags, WSAOVERLAPPED *lpoverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpcompletionroutine)
Send data on a connected socket See the Windows Sockets 2 documentation for additional information.
struct _ipx_addr ipx_addr
int32_t STDCALL WSAEnumNameSpaceProvidersW(uint32_t *lpdwbufferlength, WSANAMESPACE_INFOW *lpnspbuffer)
void STDCALL FD_ZERO(fd_set *fdset)
Initialize an fd_set to null See the Windows Sockets 2 documentation for additional information.
BOOL STDCALL WSAResetEvent(WSAEVENT hevent)
Reset the state of the specified event object to unsignaled See the Windows Sockets 2 documentation f...
int32_t STDCALL closesocket(SOCKET s)
Close an existing socket See the Windows Sockets 2 documentation for additional information.
int STDCALL WsControl(uint32_t proto, uint32_t action, void *prequestinfo, uint32_t *pcbrequestinfolen, void *presponseinfo, uint32_t *pcbresponseinfolen)
WCHAR *STDCALL InetNtopW(int32_t family, void *paddr, WCHAR *pstringbuf, int32_t stringbufsize)
Convert an IPv4 or IPv6 Internet network address into a string in Internet standard format.
u_long STDCALL ntohl(u_long netlong)
Convert a u_long from TCP/IP network byte order to host byte order See the Windows Sockets 2 document...
struct _sockaddr_ipx sockaddr_ipx
BOOL STDCALL WS2Stop(void)
int32_t STDCALL WSAEnumNetworkEvents(SOCKET s, WSAEVENT heventobject, WSANETWORKEVENTS *lpnetworkevents)
Discover occurrences of network events for the indicated socket, clear internal network event records...
int32_t STDCALL getpeername(SOCKET s, SOCKADDR *name, int32_t *namelen)
Retrieve the address of the peer to which a socket is connected See the Windows Sockets 2 documentati...
void STDCALL FD_CLR(SOCKET socket, fd_set *fdset)
Remove a socket from an fd_set See the Windows Sockets 2 documentation for additional information.
int STDCALL getnameinfo(SOCKADDR *sa, int salen, char *host, uint32_t hostlen, char *serv, uint32_t servlen, int flags)
RFC 3493 protocol-independent name resolution from an address to a host name and a port number to a s...
SOCKET STDCALL socket(int32_t af, int32_t type, int32_t protocol)
Create a socket that is bound to a specific transport service provider See the Windows Sockets 2 docu...
struct _AFPROTOCOLS AFPROTOCOLS
int32_t STDCALL WSALookupServiceBeginW(WSAQUERYSETW *lpqsrestrictions, uint32_t dwcontrolflags, HANDLE *lphlookup)
BOOL STDCALL WS2Start(void)
int32_t STDCALL WSASetServiceA(WSAQUERYSETA *lpqsreginfo, WSAESETSERVICEOP essoperation, uint32_t dwcontrolflags)
struct _SOCKET_ADDRESS_LIST SOCKET_ADDRESS_LIST
int32_t STDCALL WSASendDisconnect(SOCKET s, WSABUF *lpoutbounddisconnectdata)
int32_t STDCALL WSARecvFrom(SOCKET s, WSABUF *lpbuffers, uint32_t dwbuffercount, uint32_t *lpnumberofbytesrecvd, uint32_t *lpflags, SOCKADDR *lpfrom, int32_t *lpfromlen, WSAOVERLAPPED *lpoverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpcompletionroutine)
Receive a datagram and store the source address See the Windows Sockets 2 documentation for additiona...
servent *STDCALL getservbyport(int32_t port, const char *proto)
Retrieve service information corresponding to a port and protocol.
HANDLE STDCALL WSAAsyncGetHostByName(HWND hwindow, u_int wmsg, const char *name, char *buf, int32_t buflen)
BOOL STDCALL WSACloseEvent(WSAEVENT hevent)
Close the handle to an event object and free resources associated with the event object See the Windo...
int32_t STDCALL WSAStringToAddressW(const WCHAR *addressstring, int32_t addressfamily, WSAPROTOCOL_INFOA *lpprotocolinfo, SOCKADDR *lpaddress, int32_t *lpaddresslength)
Convert a network address in its standard text presentation form into its numeric binary form in a so...
struct _CSADDR_INFO CSADDR_INFO
int32_t STDCALL send(SOCKET s, const char *buf, int32_t len, int32_t flags)
Send data on a connected socket See the Windows Sockets 2 documentation for additional information.
int32_t STDCALL connect(SOCKET s, SOCKADDR *name, int32_t namelen)
Establish a connection to a specified socket See the Windows Sockets 2 documentation for additional i...
hostent *STDCALL gethostbyname(const char *name)
Retrieve network address corresponding to a host name See the Windows Sockets 2 documentation for add...
BOOL STDCALL WSAConnectByNameA(SOCKET s, char *nodename, char *servicename, uint32_t *localaddresslength, SOCKADDR *localaddress, uint32_t *remoteaddresslength, SOCKADDR *remoteaddress, wstimeval *timeout, WSAOVERLAPPED *reserved)
int32_t STDCALL WSANtohl(SOCKET s, u_long netlong, uint32_t *lphostlong)
Convert a u_long from network byte order to host byte order See the Windows Sockets 2 documentation f...
int32_t STDCALL WSAProviderConfigChange(HANDLE *lpnotificationhandle, WSAOVERLAPPED *lpoverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpcompletionroutine)
int32_t STDCALL WSALookupServiceNextW(HANDLE hlookup, uint32_t dwcontrolflags, uint32_t *lpdwbufferlength, WSAQUERYSETW *lpqsresults)
BOOL STDCALL __WSAFDIsSet(SOCKET s, fd_set *fdset)
Return a value indicating whether a socket is included in a set of socket descriptors See the Windows...
int32_t STDCALL WSARecv(SOCKET s, WSABUF *lpbuffers, uint32_t dwbuffercount, uint32_t *lpnumberofbytesrecvd, uint32_t *lpflags, WSAOVERLAPPED *lpoverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpcompletionroutine)
Receive data from a connected socket or a bound connectionless socket See the Windows Sockets 2 docum...
struct _WSAPROTOCOL_INFOA WSAPROTOCOL_INFOA
uint16_t STDCALL WSAGetAsyncBuflen(int32_t param)
BOOL STDCALL Winsock2RedirectOutput(SOCKET s)
Redirect standard output to the socket specified by s.
netent *STDCALL getnetbyaddr(void *addr, int len, int type)
Retrieve the network information corresponding to a network address.
struct _WSANSCLASSINFOW WSANSCLASSINFOW
int32_t STDCALL WSALookupServiceEnd(HANDLE hlookup)
int32_t STDCALL WSAStartup(uint16_t wversionrequired, WSADATA *wsdata)
Initiate use of Winsock 2 by an application See the Windows Sockets 2 documentation for additional in...
struct _in_addr in_addr
int32_t STDCALL getsockname(SOCKET s, SOCKADDR *name, int32_t *namelen)
Retrieve the local name for a socket See the Windows Sockets 2 documentation for additional informati...
int32_t STDCALL WSALookupServiceNextA(HANDLE hlookup, uint32_t dwcontrolflags, uint32_t *lpdwbufferlength, WSAQUERYSETA *lpqsresults)
BOOL STDCALL WSAIsBlocking(void)
struct _sockaddr_in6 sockaddr_in6
int32_t STDCALL WSAIoctl(SOCKET s, uint32_t dwiocontrolcode, void *lpvinbuffer, uint32_t cbinbuffer, void *lpvoutbuffer, uint32_t cboutbuffer, DWORD *lpcbbytesreturned, WSAOVERLAPPED *lpoverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpcompletionroutine)
Control the mode of a socket See the Windows Sockets 2 documentation for additional information.
#define WSASYS_STATUS_LEN
Definition winsock2.h:533
#define _SS_PAD1SIZE
Definition winsock2.h:290
HANDLE STDCALL WSAAsyncGetHostByAddr(HWND hwindow, u_int wmsg, const char *addr, int32_t len, int32_t family, char *buf, int32_t buflen)
int32_t STDCALL WSAInstallServiceClassW(WSASERVICECLASSINFOW *lpserviceclassinfo)
WSAEVENT STDCALL WSACreateEvent(void)
Create a manual reset event object with an initial state of unsignaled See the Windows Sockets 2 docu...
int32_t STDCALL WSAPoll(WSAPOLLFD *fdarray, ULONG fds, int32_t timeout)
Determine status of one or more sockets See the Windows Sockets 2 documentation for additional inform...
#define WSADESCRIPTION_LEN
Definition winsock2.h:532
HANDLE STDCALL WSAAsyncGetServByName(HWND hwindow, u_int wmsg, const char *name, const char *proto, char *buf, int32_t buflen)
struct _WSABUF WSABUF
struct _ADDRINFO ADDRINFO
Definition winsock2.h:1214
u_short STDCALL ntohs(u_short netshort)
Convert a u_short from TCP/IP network byte order to host byte order See the Windows Sockets 2 documen...
_WSAESETSERVICEOP
Definition winsock2.h:1143
@ RNRSERVICE_DEREGISTER
Definition winsock2.h:1145
@ RNRSERVICE_REGISTER
Definition winsock2.h:1144
@ RNRSERVICE_DELETE
Definition winsock2.h:1146
int32_t STDCALL WSAGetLastError(void)
Return the error status for the last Windows Sockets operation that failed See the Windows Sockets 2 ...
struct _WSAQUERYSETA WSAQUERYSETA
SOCKET STDCALL WSAJoinLeaf(SOCKET s, SOCKADDR *name, int32_t namelen, WSABUF *lpcallerdata, WSABUF *lpcalleedata, QOS *lpsqos, QOS *lpgqos, uint32_t dwflags)
u_short STDCALL htons(u_short hostshort)
Convert a u_short from host byte order to TCP/IP network byte order (which is big-endian) See the Win...
int32_t STDCALL WSAEnumProtocolsW(int32_t *lpiprotocols, WSAPROTOCOL_INFOW *lpprotocolbuffer, uint32_t *lpdwbufferlength)
netent *STDCALL getnetbyname(const char *name)
Retrieve network address corresponding to a network name.
SOCKET STDCALL WSAAccept(SOCKET s, SOCKADDR *addr, int32_t *addrlen, LPCONDITIONPROC lpfncondition, uintptr_t dwcallbackdata)
Conditionally accept a connection based on the return value of a condition function and allows the tr...
int32_t STDCALL WSAAddressToStringW(SOCKADDR *lpsaaddress, uint32_t dwaddresslength, WSAPROTOCOL_INFOW *lpprotocolinfo, WCHAR *lpszaddressstring, uint32_t *lpdwaddressstringlength)
Convert all components of a sockaddr structure into a human-readable string representation of the add...
u_long GROUP
Definition winsock2.h:973
uint32_t STDCALL htonf(float_t hostfloat)
Convert a float from host byte order to TCP/IP network byte order (which is big-endian) See the Windo...
float_t STDCALL ntohf(uint32_t netfloat)
Convert an unsigned int32 from TCP/IP network byte order to host byte order and return a float See th...
BOOL STDCALL Winsock2RedirectInput(SOCKET s)
Redirect standard input to the socket specified by s.
int32_t STDCALL select(int32_t nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, wstimeval *timeout)
Determine the status of one or more sockets, waiting if necessary, to perform synchronous I/O.
void STDCALL FD_SET(SOCKET socket, fd_set *fdset)
Add a socket to an fd_set See the Windows Sockets 2 documentation for additional information.
struct _WSAPOLLFD WSAPOLLFD
struct _sockaddr_storage sockaddr_storage
WSANAMESPACE_INFOA WSANAMESPACE_INFO
Definition winsock2.h:1206
struct _FLOWSPEC FLOWSPEC
int32_t STDCALL WSAAddressToStringA(SOCKADDR *lpsaaddress, uint32_t dwaddresslength, WSAPROTOCOL_INFOA *lpprotocolinfo, char *lpszaddressstring, uint32_t *lpdwaddressstringlength)
Convert all components of a sockaddr structure into a human-readable string representation of the add...
int32_t STDCALL WSAGetServiceClassInfoW(GUID *lpproviderid, GUID *lpserviceclassid, uint32_t *lpdwbufsize, WSASERVICECLASSINFOW *lpserviceclassinfo)
int STDCALL WsControlEx(uint32_t proto, uint32_t action, void *prequestinfo, uint32_t *pcbrequestinfolen, void *presponseinfo, uint32_t *pcbresponseinfolen)
OVERLAPPED WSAOVERLAPPED
Definition winsock2.h:937
BOOL STDCALL WSAConnectByNameW(SOCKET s, WCHAR *nodename, WCHAR *servicename, uint32_t *localaddresslength, SOCKADDR *localaddress, uint32_t *remoteaddresslength, SOCKADDR *remoteaddress, wstimeval *timeout, WSAOVERLAPPED *reserved)
int32_t STDCALL WSASendMsg(SOCKET s, WSAMSG *lpmsg, uint32_t dwflags, uint32_t *lpnumberofbytessent, WSAOVERLAPPED *lpoverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpcompletionroutine)
Send data and optional control information from connected and unconnected sockets.
BOOL STDCALL WSAGetQosByName(SOCKET s, WSABUF *lpqosname, QOS *lpqos)
uint16_t STDCALL WSAGetSelectEvent(int32_t param)
int32_t STDCALL InetPtonA(int32_t family, const char *pszaddrstring, void *paddrbuf)
Convert an IPv4 or IPv6 Internet network address in its standard text presentation form into its nume...
struct _WSAQUERYSETW WSAQUERYSETW
int32_t STDCALL WSAMakeSelectReply(uint16_t event, uint16_t error)
struct _fd_set fd_set
SOCKET STDCALL socket(int af, int type, int protocol)
Create a socket that is bound to a specific transport service provider See the Windows Sockets docume...
struct _netent netent
char MBChar
Definition winsock.h:522
struct _sockaddr_in sockaddr_in
struct _hostent hostent
struct _WSADATA WSADATA
#define FD_SETSIZE
Definition winsock.h:59
struct _sockproto sockproto
unsigned long u_long
Definition winsock.h:520
unsigned short u_short
Definition winsock.h:518
struct _servent servent
struct _linger linger
unsigned int u_int
Definition winsock.h:519
struct _in_addr in_addr
struct _wstimeval wstimeval
unsigned char u_char
Definition winsock.h:517
struct _sockaddr sockaddr
struct _protoent protoent
sockaddr SOCKADDR
Definition winsock.h:614