source: branch/egtra-gdiplus/api_winsock2.sbp@ 552

Last change on this file since 552 was 237, checked in by イグトランス (egtra), 18 years ago

#_fullcompileで検出されたエラーの修正(明らかに判るもののみ)

File size: 71.0 KB
Line 
1#ifndef _WINSOCK2API_
2#define _WINSOCK2API_
3#define _WINSOCKAPI_
4/*
5#ifndef INCL_WINSOCK_API_PROTOTYPES
6#define INCL_WINSOCK_API_PROTOTYPES 1
7#endif
8
9#ifndef INCL_WINSOCK_API_TYPEDEFS
10#define INCL_WINSOCK_API_TYPEDEFS 0
11#endif
12*/
13
14Const WINSOCK_VERSION = MAKEWORD(2, 2)
15
16TypeDef SOCKET = ULONG_PTR
17
18Const FD_SETSIZE = 64
19
20Type fd_set
21 fd_count As DWord
22 fd_array[ELM(FD_SETSIZE)] As SOCKET
23End Type
24
25Declare Function __WSAFDIsSet Lib "ws2_32" (fd As SOCKET, ByRef set As fd_set) As Long
26
27Sub FD_CLR(fd As SOCKET, ByRef set As fd_set)
28 Dim i As DWord
29 With set
30 For i = 0 To .fd_count
31 If .fd_array[i] = fd Then
32 While i < .fd_count - 1
33 .fd_array[i] = .fd_array[i + 1]
34 WEnd
35 .fd_count--
36 Exit For
37 End If
38 Next
39 End With
40End Sub
41
42Sub FD_SET(fd As SOCKET, ByRef set As fd_set)
43 Dim i As DWord
44 With set
45 For i = 0 To ELM(.fd_count)
46 If .fd_array[i] = fd Then
47 Exit Sub
48 End If
49 Next
50 If i = .fd_count Then
51 If .fd_count < FD_SETSIZE Then
52 .fd_array[i] = fd
53 .fd_count++
54 End If
55 End If
56 End With
57End Sub
58
59Sub FD_ZERO(ByRef set As fd_set)
60 set.fd_count = 0
61End Sub
62
63Const FD_ISSET(fd, set) = __WSAFDIsSet(fd, set)
64
65Type timeval
66 tv_sec As Long
67 tv_usec As Long
68End Type
69
70' Operations on timevals.
71Function timerisset(ByRef tvp As timeval) As BOOL
72 Return tvp.tv_sec Or tvp.tv_usec
73End Function
74
75/*
76#define timercmp(tvp, uvp, cmp) \
77 ((tvp)->tv_sec cmp (uvp)->tv_sec || \
78 (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
79*/
80
81Sub timerclear(ByRef tvp As timeval)
82 tvp.tv_sec = 0
83 tvp.tv_usec = 0
84End Sub
85
86' Commands for ioctlsocket(), taken from the BSD file fcntl.h.
87Const IOCPARM_MASK = &h7f
88Const IOC_VOID = &h20000000
89Const IOC_OUT = &h40000000
90Const IOC_IN = &h80000000
91Const IOC_INOUT= (IOC_IN Or IOC_OUT)
92
93Const _IO(x ,y) = (IOC_VOID Or (x << 8) Or y)
94
95Const _IOR(x, y, size) = (IOC_OUT Or ((size And IOCPARM_MASK) << 16) Or ((x) << 8) Or (y))
96
97Const _IOW(x, y, size) = (IOC_IN Or ((size And IOCPARM_MASK) << 16) Or ((x) << 8) Or (y))
98
99Const FIONREAD = _IOR(&h66,127, SizeOf (DWord)) '&h66は'f'
100Const FIONBIO = _IOW(&h66,126, SizeOf (DWord))
101Const FIOASYNC = _IOW(&h66,125, SizeOf (DWord))
102
103' Socket I/O Controls
104Const SIOCSHIWAT = _IOW(&h73, 0, SizeOf (DWord)) '&h73は's'
105Const SIOCGHIWAT = _IOR(&h73, 1, SizeOf (DWord))
106Const SIOCSLOWAT = _IOW(&h73, 2, SizeOf (DWord))
107Const SIOCGLOWAT = _IOR(&h73, 3, SizeOf (DWord))
108Const SIOCATMARK = _IOR(&h73, 7, SizeOf (DWord))
109
110
111Type /*Class*/ hostent
112'Public
113 h_name As *Byte
114 h_aliases As **Byte
115 h_addrtype As Integer
116 h_lengt As Integer
117 h_addr_list As **Byte
118/*
119 Function h_addr() As *Byte
120 Return h_addr_list[0]
121 End Function
122
123 Sub h_addr(l As *Byte)
124 h_addr_list[0] = i
125 End Sub
126*/
127End Type 'Class
128
129Type netent
130 FAR * n_name As *Byte
131 FAR * FAR * n_aliases As **Byte
132 n_addrtyp As Integer
133 n_net As DWord
134End Type
135
136Type servent
137 s_name As *Byte
138 s_aliases As **Byte
139#ifdef _WIN64
140 s_proto As *Byte
141 s_port As Integer
142#else
143 s_port As Integer
144 s_proto As *Byte
145#endif
146End Type
147
148Type protoent
149 p_name As *Byte
150 p_aliases As **Byte
151 p_proto As Integer
152End Type
153
154' Protocols
155Const IPPROTO_IP = 0
156Const IPPROTO_HOPOPTS = 0
157Const IPPROTO_ICMP = 1
158Const IPPROTO_IGMP = 2
159Const IPPROTO_GGP = 3
160Const IPPROTO_IPV4 = 4
161Const IPPROTO_TCP = 6
162Const IPPROTO_PUP = 12
163Const IPPROTO_UDP = 17
164Const IPPROTO_IDP = 22
165Const IPPROTO_IPV6 = 41
166Const IPPROTO_ROUTING = 43
167Const IPPROTO_FRAGMENT = 44
168Const IPPROTO_ESP = 50
169Const IPPROTO_AH = 51
170Const IPPROTO_ICMPV6 = 58
171Const IPPROTO_NONE = 59
172Const IPPROTO_DSTOPTS = 60
173Const IPPROTO_ND = 77
174Const IPPROTO_ICLFXBM = 78
175
176Const IPPROTO_RAW = 255
177Const IPPROTO_MAX = 256
178
179' Port/socket numbers: network standard functions
180Const IPPORT_ECHO = 7
181Const IPPORT_DISCARD = 9
182Const IPPORT_SYSTAT = 11
183Const IPPORT_DAYTIME = 13
184Const IPPORT_NETSTAT = 15
185Const IPPORT_FTP = 21
186Const IPPORT_TELNET = 23
187Const IPPORT_SMTP = 25
188Const IPPORT_TIMESERVER = 37
189Const IPPORT_NAMESERVER = 42
190Const IPPORT_WHOIS = 43
191Const IPPORT_MTP = 57
192
193' Port/socket numbers: host specific functions
194Const IPPORT_TFTP = 69
195Const IPPORT_RJE = 77
196Const IPPORT_FINGER = 79
197Const IPPORT_TTYLINK = 87
198Const IPPORT_SUPDUP = 95
199
200' UNIX TCP sockets
201Const IPPORT_EXECSERVER = 512
202Const IPPORT_LOGINSERVER = 513
203Const IPPORT_CMDSERVER = 514
204Const IPPORT_EFSSERVER = 520
205
206' UNIX UDP sockets
207Const IPPORT_BIFFUDP = 512
208Const IPPORT_WHOSERVER = 513
209Const IPPORT_ROUTESERVER = 520
210' 520+1 also used
211
212' Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root).
213Const IPPORT_RESERVED = 1024
214
215' Link numbers
216Const IMPLINK_IP = 155
217Const IMPLINK_LOWEXPER = 156
218Const IMPLINK_HIGHEXPER = 158
219
220#ifndef s_addr
221#define s_addr
222' Internet address (old style... should be updated)
223Type /*Class*/ in_addr
224'Public
225/*
226 Union S_un
227 S_un_b As Type
228 s_b1 As Byte
229 s_b2 As Byte
230 s_b3 As Byte
231 s_b4 As Byte
232 End Type
233 S_un_w As Type
234 s_w1 As Word
235 s_w2 As Word
236 End Type
237 S_addr As DWord
238 End Union
239*/
240 s_addr As DWord
241/*
242 Function s_host() As Byte
243 Return GetByte(VarPtr(s_addr) + 1)
244 End Function
245
246 Sub s_host(h As Byte)
247 Return SetByte(VarPtr(s_addr) + 2, h)
248 End Sub
249
250 Function s_net() As Byte
251 Return GetByte(VarPtr(s_addr) + 0)
252 End Function
253
254 Sub s_net(n As Byte)
255 Return SetByte(VarPtr(s_addr) + 0, n)
256 End Sub
257
258 Function s_imp() As Word
259 Return GetWord(VarPtr(s_addr) + 1)
260 End Function
261
262 Sub s_imp(i As Word)
263 Return SetWord(VarPtr(s_addr) + 1, i)
264 End Sub
265
266 Function s_impno() As Byte
267 Return GetByte(VarPtr(s_addr) + 3)
268 End Function
269
270 Sub s_impno(i As Byte)
271 Return SetByte(VarPtr(s_addr) + 3, i)
272 End Sub
273
274 Function s_lh() As Byte
275 Return GetByte(VarPtr(s_addr) + 2)
276 End Function
277
278 Sub s_lh(l As Byte)
279 Return SetByte(VarPtr(s_addr) + 2, l)
280 End Sub
281*/
282End Type 'Class
283#endif
284
285Const IN_CLASSA(i) = (((i) As DWord And &h80000000) = 0)
286Const IN_CLASSA_NET = &hff000000
287Const IN_CLASSA_NSHIFT = 24
288Const IN_CLASSA_HOST = &h00ffffff
289Const IN_CLASSA_MAX = 128
290
291Const IN_CLASSB(i) = (((i) As DWord & &hc0000000) = &h80000000)
292Const IN_CLASSB_NET= &hffff0000
293Const IN_CLASSB_NSHIFT = 16
294Const IN_CLASSB_HOST = &h0000ffff
295Const IN_CLASSB_MAX = 65536
296
297Const IN_CLASSC(i) = (((i) As DWord And &he0000000) = &hc0000000)
298Const IN_CLASSC_NET = &hffffff00
299Const IN_CLASSC_NSHIFT = 8
300Const IN_CLASSC_HOST = &h000000ff
301
302Const IN_CLASSD(i) = (((i) As DWord And &hf0000000) = &he0000000)
303Const IN_CLASSD_NET = &hf0000000
304Const IN_CLASSD_NSHIFT = 28
305Const IN_CLASSD_HOST = &h0fffffff
306Const IN_MULTICAST(i) = IN_CLASSD(i)
307
308Const INADDR_ANY = &h00000000 As DWord
309Const INADDR_LOOPBACK = &h7f000001
310Const INADDR_BROADCAST = &hffffffff As DWord
311Const INADDR_NONE = &hffffffff
312
313Const ADDR_ANY = INADDR_ANY
314
315' Socket address, internet style.
316Type sockaddr_in
317 sin_family As Integer
318 sin_port As Word
319 sin_addr As in_addr
320 sin_zero[ELM(8)] As Byte
321End Type
322
323Const WSADESCRIPTION_LEN = 256
324Const WSASYS_STATUS_LEN = 128
325
326Type WSADATA
327 wVersion As Word
328 wHighVersion As Word
329#ifdef _WIN64
330 iMaxSockets As Word
331 iMaxUdpDg As Word
332 lpVendorInfo As *Byte
333 szDescription[WSADESCRIPTION_LEN] As Byte
334 szSystemStatus[WSASYS_STATUS_LEN] As Byte
335#else
336 szDescription[WSADESCRIPTION_LEN] As Byte
337 szSystemStatus[WSASYS_STATUS_LEN] As Byte
338 iMaxSockets As Word
339 iMaxUdpDg As Word
340 lpVendorInfo As *Byte
341#endif
342End Type
343
344TypeDef LPWSADATA = *WSADATA
345
346' Definitions related to sockets: types, address families, options, taken from the BSD file sys/socket.h.
347
348Const INVALID_SOCKET = (Not 0) As ULONG_PTR
349Const SOCKET_ERROR = (-1)
350
351Const FROM_PROTOCOL_INFO = (-1)
352
353' Types
354Const SOCK_STREAM = 1
355Const SOCK_DGRAM = 2
356Const SOCK_RAW = 3
357Const SOCK_RDM = 4
358Const SOCK_SEQPACKET = 5
359
360' Option flags per-socket.
361Const SO_DEBUG = &h0001
362Const SO_ACCEPTCONN = &h0002
363Const SO_REUSEADDR = &h0004
364Const SO_KEEPALIVE = &h0008
365Const SO_DONTROUTE = &h0010
366Const SO_BROADCAST = &h0020
367Const SO_USELOOPBACK = &h0040
368Const SO_LINGER = &h0080
369Const SO_OOBINLINE = &h0100
370
371Const SO_DONTLINGER = ((Not SO_LINGER) As Long)
372Const SO_EXCLUSIVEADDRUSE = ((Not SO_REUSEADDR) As Long)
373
374' Additional options.
375Const SO_SNDBUF = &h1001
376Const SO_RCVBUF = &h1002
377Const SO_SNDLOWAT = &h1003
378Const SO_RCVLOWAT = &h1004
379Const SO_SNDTIMEO = &h1005
380Const SO_RCVTIMEO = &h1006
381Const SO_ERROR = &h1007
382Const SO_TYPE = &h1008
383
384' WinSock 2 extension -- new options
385Const SO_GROUP_ID = &h2001
386Const SO_GROUP_PRIORITY = &h2002
387Const SO_MAX_MSG_SIZE = &h2003
388Const SO_PROTOCOL_INFOA = &h2004
389Const SO_PROTOCOL_INFOW = &h2005
390#ifdef UNICODE
391Const SO_PROTOCOL_INFO = SO_PROTOCOL_INFOW
392#else
393Const SO_PROTOCOL_INFO = SO_PROTOCOL_INFOA
394#endif /* UNICODE */
395Const PVD_CONFIG = &h3001
396Const SO_CONDITIONAL_ACCEPT = &h3002
397
398' TCP options.
399Const TCP_NODELAY = &h0001
400
401' Address families.
402Const AF_UNSPEC = 0
403Const AF_UNIX = 1
404Const AF_INET = 2
405Const AF_IMPLINK = 3
406Const AF_PUP = 4
407Const AF_CHAOS = 5
408Const AF_NS = 6
409Const AF_IPX = AF_NS
410Const AF_ISO = 7
411Const AF_OSI = AF_ISO
412Const AF_ECMA = 8
413Const AF_DATAKIT = 9
414Const AF_CCITT = 10
415Const AF_SNA = 11
416Const AF_DECnet = 12
417Const AF_DLI = 13
418Const AF_LAT = 14
419Const AF_HYLINK = 15
420Const AF_APPLETALK = 16
421Const AF_NETBIOS = 17
422Const AF_VOICEVIEW = 18
423Const AF_FIREFOX = 19
424Const AF_UNKNOWN1 = 20
425Const AF_BAN = 21
426Const AF_ATM = 22
427Const AF_INET6 = 23
428Const AF_CLUSTER = 24
429Const AF_12844 = 25
430Const AF_IRDA = 26
431Const AF_NETDES = 28
432
433Const AF_TCNPROCESS = 29
434Const AF_TCNMESSAGE = 30
435Const AF_ICLFXBM = 31
436
437Const AF_MAX = 32
438
439' Structure used by kernel to store most addresses.
440Type sockaddr
441 sa_family As Word
442 sa_data[ELM(14)] As Byte
443End Type
444
445' Portable socket structure (RFC 2553).
446
447' Desired design of maximum size and alignment.
448' These are implementation specific.
449Const _SS_MAXSIZE = 128 ' Maximum size.
450Const _SS_ALIGNSIZE = (SizeOf (Int64)) 'Desired alignment.
451
452' Definitions used for sockaddr_storage structure paddings design.
453Const _SS_PAD1SIZE = (_SS_ALIGNSIZE - SizeOf (Integer))
454Const _SS_PAD2SIZE = (_SS_MAXSIZE - (SizeOf (Integer) + _SS_PAD1SIZE + _SS_ALIGNSIZE))
455
456Type sockaddr_storage
457 ss_family As Integer
458 __ss_pad1[ELM(_SS_PAD1SIZE)] As Byte
459 __ss_align As Int64
460 __ss_pad2[ELM(_SS_PAD2SIZE)] As Byte
461End Type
462
463Type sockproto
464 sp_family As Word
465 sp_protocol As Word
466End Type
467
468' Protocol families, same as address families for now.
469Const PF_UNSPEC = AF_UNSPEC
470Const PF_UNIX = AF_UNIX
471Const PF_INET = AF_INET
472Const PF_IMPLINK = AF_IMPLINK
473Const PF_PUP = AF_PUP
474Const PF_CHAOS = AF_CHAOS
475Const PF_NS = AF_NS
476Const PF_IPX = AF_IPX
477Const PF_ISO = AF_ISO
478Const PF_OSI = AF_OSI
479Const PF_ECMA = AF_ECMA
480Const PF_DATAKIT = AF_DATAKIT
481Const PF_CCITT = AF_CCITT
482Const PF_SNA = AF_SNA
483Const PF_DECnet = AF_DECnet
484Const PF_DLI = AF_DLI
485Const PF_LAT = AF_LAT
486Const PF_HYLINK = AF_HYLINK
487Const PF_APPLETALK = AF_APPLETALK
488Const PF_VOICEVIEW = AF_VOICEVIEW
489Const PF_FIREFOX = AF_FIREFOX
490Const PF_UNKNOWN1 = AF_UNKNOWN1
491Const PF_BAN = AF_BAN
492Const PF_ATM = AF_ATM
493Const PF_INET6 = AF_INET6
494
495Const PF_MAX = AF_MAX
496
497' Structure used for manipulating linger option.
498Type linger
499 l_onoff As Word
500 l_linger As Word
501End Type
502
503' Level number for (get/set)sockopt() to apply to socket itself.
504Const SOL_SOCKET = &hffff
505
506' Maximum queue length specifiable by listen.
507Const SOMAXCONN = &h7fffffff
508
509Const MSG_OOB = &h1
510Const MSG_PEEK = &h2
511Const MSG_DONTROUTE = &h4
512Const MSG_WAITALL = &h8
513
514Const MSG_PARTIAL = &h8000
515
516' WinSock 2 extension -- new flags for WSASend(), WSASendTo(), WSARecv() and
517' WSARecvFrom()
518Const MSG_INTERRUPT = &h10
519
520Const MSG_MAXIOVLEN = 16
521
522' Define constant based on rfc883, used by gethostbyxxxx() calls.
523Const MAXGETHOSTSTRUCT = 1024
524
525' WinSock 2 extension -- bit values and indices for FD_XXX network events
526Const FD_READ_BIT = 0
527Const FD_READ = (1 << FD_READ_BIT)
528
529Const FD_WRITE_BIT = 1
530Const FD_WRITE = (1 << FD_WRITE_BIT)
531
532Const FD_OOB_BIT = 2
533Const FD_OOB = (1 << FD_OOB_BIT)
534
535Const FD_ACCEPT_BIT = 3
536Const FD_ACCEPT = (1 << FD_ACCEPT_BIT)
537
538Const FD_CONNECT_BIT = 4
539Const FD_CONNECT = (1 << FD_CONNECT_BIT)
540
541Const FD_CLOSE_BIT = 5
542Const FD_CLOSE = (1 << FD_CLOSE_BIT)
543
544Const FD_QOS_BIT = 6
545Const FD_QOS = (1 << FD_QOS_BIT)
546
547Const FD_GROUP_QOS_BIT = 7
548Const FD_GROUP_QOS = (1 << FD_GROUP_QOS_BIT)
549
550Const FD_ROUTING_INTERFACE_CHANGE_BIT = 8
551Const FD_ROUTING_INTERFACE_CHANGE = (1 << FD_ROUTING_INTERFACE_CHANGE_BIT)
552
553Const FD_ADDRESS_LIST_CHANGE_BIT = 9
554Const FD_ADDRESS_LIST_CHANGE = (1 << FD_ADDRESS_LIST_CHANGE_BIT)
555
556Const FD_MAX_EVENTS = 10
557Const FD_ALL_EVENTS = ((1 << FD_MAX_EVENTS) - 1)
558
559#include <api_winerror.sbp>
560
561' Compatibility macros.
562
563'Const h_errno = WSAGetLastError()
564Const HOST_NOT_FOUND = WSAHOST_NOT_FOUND
565Const TRY_AGAIN = WSATRY_AGAIN
566Const NO_RECOVERY = WSANO_RECOVERY
567Const NO_DATA = WSANO_DATA
568Const WSANO_ADDRESS = WSANO_DATA
569Const NO_ADDRESS = WSANO_ADDRESS
570
571' WinSock 2 extension -- new error codes and type definition
572
573'#ifdef _WIN32
574
575TypeDef WSAEVENT = HANDLE
576TypeDef LPWSAEVENT = *HANDLE
577TypeDef WSAOVERLAPPED = OVERLAPPED
578TypeDef LPWSAOVERLAPPED = *OVERLAPPED
579
580Const WSA_IO_PENDING = (ERROR_IO_PENDING)
581Const WSA_IO_INCOMPLETE = (ERROR_IO_INCOMPLETE)
582Const WSA_INVALID_HANDLE = (ERROR_INVALID_HANDLE)
583Const WSA_INVALID_PARAMETER = (ERROR_INVALID_PARAMETER)
584Const WSA_NOT_ENOUGH_MEMORY = (ERROR_NOT_ENOUGH_MEMORY)
585Const WSA_OPERATION_ABORTED = (ERROR_OPERATION_ABORTED)
586
587Const WSA_INVALID_EVENT = (0 As WSAEVENT)
588Const WSA_MAXIMUM_WAIT_EVENTS = (MAXIMUM_WAIT_OBJECTS)
589Const WSA_WAIT_FAILED = (WAIT_FAILED)
590Const WSA_WAIT_EVENT_0 = (WAIT_OBJECT_0)
591Const WSA_WAIT_IO_COMPLETION = (WAIT_IO_COMPLETION)
592Const WSA_WAIT_TIMEOUT = (WAIT_TIMEOUT)
593Const WSA_INFINITE = (INFINITE)
594
595'#elif defined _WIN16
596'#endif
597
598Type WSABUF
599 len As DWord
600 buf As *Byte
601End Type
602TypeDef LPWSABUF = *WSABUF
603
604#include <qos.ab>
605
606Type QOS 'struct _QualityOfService
607 SendingFlowspec As FLOWSPEC
608 ReceivingFlowspec As FLOWSPEC
609 ProviderSpecific As WSABUF
610End Type
611TypeDef LPQOS = *QOS
612
613' WinSock 2 extension -- manifest constants for return values of the condition function
614Const CF_ACCEPT = &h0000
615Const CF_REJECT = &h0001
616Const CF_DEFER = &h0002
617
618' WinSock 2 extension -- manifest constants for shutdown()
619Const SD_RECEIVE = &h00
620Const SD_SEND = &h01
621Const SD_BOTH = &h02
622
623' WinSock 2 extension -- data type and manifest constants for socket groups
624TypeDef GROUP = DWord
625
626Const SG_UNCONSTRAINED_GROUP = &h01
627Const SG_CONSTRAINED_GROUP = &h02
628
629' WinSock 2 extension -- data type for WSAEnumNetworkEvents()
630Type WSANETWORKEVENTS
631 lNetworkEvents As Long
632 iErrorCode[ELM(FD_MAX_EVENTS)] As Long
633End Type
634TypeDef LPWSANETWORKEVENTS = *WSANETWORKEVENTS
635
636' WinSock 2 extension -- WSAPROTOCOL_INFO structure and associated
637' manifest constants
638
639Const MAX_PROTOCOL_CHAIN = 7
640
641Const BASE_PROTOCOL = 1
642Const LAYERED_PROTOCOL = 0
643
644Type WSAPROTOCOLCHAIN
645 ChainLen As Long
646 ChainEntries[ELM(MAX_PROTOCOL_CHAIN)] As DWord
647End Type
648TypeDef LPWSAPROTOCOLCHAIN = *WSAPROTOCOLCHAIN
649
650Const WSAPROTOCOL_LEN = 255
651
652Type WSAPROTOCOL_INFOA
653 dwServiceFlags1 As DWord
654 dwServiceFlags2 As DWord
655 dwServiceFlags3 As DWord
656 dwServiceFlags4 As DWord
657 dwProviderFlags As DWord
658 ProviderId As GUID
659 dwCatalogEntryId As DWord
660 ProtocolChain As WSAPROTOCOLCHAIN
661 iVersion As Long
662 iAddressFamily As Long
663 iMaxSockAddr As Long
664 iMinSockAddr As Long
665 iSocketType As Long
666 iProtocol As Long
667 iProtocolMaxOffset As Long
668 iNetworkByteOrder As Long
669 iSecurityScheme As Long
670 dwMessageSize As DWord
671 dwProviderReserved As DWord
672 szProtocol[WSAPROTOCOL_LEN] As Byte
673End Type
674TypeDef LPWSAPROTOCOL_INFOA = *WSAPROTOCOL_INFOA
675
676Type WSAPROTOCOL_INFOW
677 dwServiceFlags1 As DWord
678 dwServiceFlags2 As DWord
679 dwServiceFlags3 As DWord
680 dwServiceFlags4 As DWord
681 dwProviderFlags As DWord
682 ProviderId As GUID
683 dwCatalogEntryId As DWord
684 ProtocolChain As WSAPROTOCOLCHAIN
685 iVersion As Long
686 iAddressFamily As Long
687 iMaxSockAddr As Long
688 iMinSockAddr As Long
689 iSocketType As Long
690 iProtocol As Long
691 iProtocolMaxOffset As Long
692 iNetworkByteOrder As Long
693 iSecurityScheme As Long
694 dwMessageSize As DWord
695 dwProviderReserved As DWord
696 szProtocol[WSAPROTOCOL_LEN] As WCHAR
697End Type
698TypeDef LPWSAPROTOCOL_INFOW = *WSAPROTOCOL_INFOW
699
700#ifdef UNICODE
701TypeDef WSAPROTOCOL_INFO = WSAPROTOCOL_INFOW
702TypeDef LPWSAPROTOCOL_INFO = LPWSAPROTOCOL_INFOW
703#else
704TypeDef WSAPROTOCOL_INFO = WSAPROTOCOL_INFOA
705TypeDef LPWSAPROTOCOL_INFO = LPWSAPROTOCOL_INFOA
706#endif
707
708' Flag bit definitions for dwProviderFlags
709Const PFL_MULTIPLE_PROTO_ENTRIES = &h00000001
710Const PFL_RECOMMENDED_PROTO_ENTRY = &h00000002
711Const PFL_HIDDEN = &h00000004
712Const PFL_MATCHES_PROTOCOL_ZERO = &h00000008
713
714' Flag bit definitions for dwServiceFlags1
715Const XP1_CONNECTIONLESS = &h00000001
716Const XP1_GUARANTEED_DELIVERY = &h00000002
717Const XP1_GUARANTEED_ORDER = &h00000004
718Const XP1_MESSAGE_ORIENTED = &h00000008
719Const XP1_PSEUDO_STREAM = &h00000010
720Const XP1_GRACEFUL_CLOSE = &h00000020
721Const XP1_EXPEDITED_DATA = &h00000040
722Const XP1_CONNECT_DATA = &h00000080
723Const XP1_DISCONNECT_DATA = &h00000100
724Const XP1_SUPPORT_BROADCAST = &h00000200
725Const XP1_SUPPORT_MULTIPOINT = &h00000400
726Const XP1_MULTIPOINT_CONTROL_PLANE = &h00000800
727Const XP1_MULTIPOINT_DATA_PLANE = &h00001000
728Const XP1_QOS_SUPPORTED = &h00002000
729Const XP1_INTERRUPT = &h00004000
730Const XP1_UNI_SEND = &h00008000
731Const XP1_UNI_RECV = &h00010000
732Const XP1_IFS_HANDLES = &h00020000
733Const XP1_PARTIAL_MESSAGE = &h00040000
734
735Const BIGENDIAN = &h0000
736Const LITTLEENDIAN = &h0001
737
738Const SECURITY_PROTOCOL_NONE = &h0000
739
740' WinSock 2 extension -- manifest constants for WSAJoinLeaf()
741Const JL_SENDER_ONLY = &h01
742Const JL_RECEIVER_ONLY = &h02
743Const JL_BOTH = &h04
744
745' WinSock 2 extension -- manifest constants for WSASocket()
746Const WSA_FLAG_OVERLAPPED = &h01
747Const WSA_FLAG_MULTIPOINT_C_ROOT = &h02
748Const WSA_FLAG_MULTIPOINT_C_LEAF = &h04
749Const WSA_FLAG_MULTIPOINT_D_ROOT = &h08
750Const WSA_FLAG_MULTIPOINT_D_LEAF = &h10
751
752' WinSock 2 extension -- manifest constants for WSAIoctl()
753Const IOC_UNIX = &h00000000
754Const IOC_WS2 = &h08000000
755Const IOC_PROTOCOL = &h10000000
756Const IOC_VENDOR = &h18000000
757
758Const _WSAIO(x, y) = (IOC_VOID Or (x) Or (y))
759Const _WSAIOR(x, y) = (IOC_OUT Or (x) Or (y))
760Const _WSAIOW(x, y) = (IOC_IN Or (x) Or (y))
761Const _WSAIORW(x, y) = (IOC_INOUT Or (x) Or (y))
762
763Const SIO_ASSOCIATE_HANDLE = _WSAIOW(IOC_WS2, 1)
764Const SIO_ENABLE_CIRCULAR_QUEUEING = _WSAIO(IOC_WS2, 2)
765Const SIO_FIND_ROUTE = _WSAIOR(IOC_WS2, 3)
766Const SIO_FLUSH = _WSAIO(IOC_WS2, 4)
767Const SIO_GET_BROADCAST_ADDRESS = _WSAIOR(IOC_WS2, 5)
768Const SIO_GET_EXTENSION_FUNCTION_POINTER = _WSAIORW(IOC_WS2, 6)
769Const SIO_GET_QOS = _WSAIORW(IOC_WS2, 7)
770Const SIO_GET_GROUP_QOS = _WSAIORW(IOC_WS2, 8)
771Const SIO_MULTIPOINT_LOOPBACK = _WSAIOW(IOC_WS2, 9)
772Const SIO_MULTICAST_SCOPE = _WSAIOW(IOC_WS2, 10)
773Const SIO_SET_QOS = _WSAIOW(IOC_WS2, 11)
774Const SIO_SET_GROUP_QOS = _WSAIOW(IOC_WS2, 12)
775Const SIO_TRANSLATE_HANDLE = _WSAIORW(IOC_WS2, 13)
776Const SIO_ROUTING_INTERFACE_QUERY = _WSAIORW(IOC_WS2, 20)
777Const SIO_ROUTING_INTERFACE_CHANGE = _WSAIOW(IOC_WS2, 21)
778Const SIO_ADDRESS_LIST_QUERY = _WSAIOR(IOC_WS2, 22)
779Const SIO_ADDRESS_LIST_CHANGE = _WSAIO(IOC_WS2, 23)
780Const SIO_QUERY_TARGET_PNP_HANDLE = _WSAIOR(IOC_WS2, 24)
781Const SIO_ADDRESS_LIST_SORT = _WSAIORW(IOC_WS2, 25)
782
783' WinSock 2 extensions -- data types for the condition function in
784' WSAAccept() and overlapped I/O completion routine.
785
786TypeDef LPCONDITIONPROC = *Function(
787 ByRef CallerId As WSABUF,
788 ByRef CallerData As WSABUF,
789 ByRef lpSQOS As QOS,
790 ByRef lpGQOS As QOS,
791 ByRef lpCalleeId As WSABUF,
792 ByRef lpCalleeData As WSABUF,
793 ByRef g As GROUP,
794 dwCallbackData As ULONG_PTR
795) As Long
796
797TypeDef LPWSAOVERLAPPED_COMPLETION_ROUTINE = *Sub(
798 dwError As DWord,
799 cbTransferred As DWord,
800 ByRef Overlapped As WSAOVERLAPPED,
801 dwFlags As DWord)
802
803' WinSock 2 extension -- manifest constants and associated structures
804' for WSANSPIoctl()
805Const SIO_NSP_NOTIFY_CHANGE = _WSAIOW(IOC_WS2, 25)
806
807Const Enum WSACOMPLETIONTYPE
808 NSP_NOTIFY_IMMEDIATELY = 0
809 NSP_NOTIFY_HWND
810 NSP_NOTIFY_EVENT
811 NSP_NOTIFY_PORT
812 NSP_NOTIFY_APC
813End Enum
814
815TypeDef PWSACOMPLETIONTYPE = *WSACOMPLETIONTYPE
816TypeDef LPWSACOMPLETIONTYPE = *WSACOMPLETIONTYPE
817
818Type _System_WinSock_WSACOMPLETION_WINDOWMESSAGE
819 hWnd As HWND
820 uMsg As DWord
821 context As WPARAM
822End Type
823
824Type _System_WinSock_WSACOMPLETION_EVENT
825 lpOverlapped As LPWSAOVERLAPPED
826End Type
827
828Type _System_WinSock_WSACOMPLETION_APC
829 lpOverlapped As LPWSAOVERLAPPED
830 lpfnCompletionProc As LPWSAOVERLAPPED_COMPLETION_ROUTINE
831End Type
832
833Type _System_WinSock_WSACOMPLETION_PORT
834 lpOverlapped As LPWSAOVERLAPPED
835 hPort As HANDLE
836 Key As ULONG_PTR
837End Type
838
839Type /*Class*/ WSACOMPLETION
840'Public
841 Type_ As WSACOMPLETIONTYPE
842/*
843 Parameters As Union
844 WindowMessage As _System_WinSock_WSACOMPLETION_WINDOWMESSAGE
845 Event As _System_WinSock_WSACOMPLETION_EVENT
846 Apc As _System_WinSock_WSACOMPLETION_APC
847 Port As _System_WinSock_WSACOMPLETION_PORT
848 End Union
849*/
850 Port As _System_WinSock_WSACOMPLETION_PORT
851/*
852 Function WindowMessage() As _System_WinSock_WSACOMPLETION_WINDOWMESSAGE
853 Dim p As *_System_WinSock_WSACOMPLETION_WINDOWMESSAGE
854 p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_WINDOWMESSAGE
855 Return p[0]
856 End Function
857
858 Sub WindowMessage(w As _System_WinSock_WSACOMPLETION_WINDOWMESSAGE)
859 Dim p As *_System_WinSock_WSACOMPLETION_WINDOWMESSAGE
860 p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_WINDOWMESSAGE
861 p[0] = w
862 End Sub
863
864 Function Event() As _System_WinSock_WSACOMPLETION_EVENT
865 Dim p As *_System_WinSock_WSACOMPLETION_EVENT
866 p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_EVENT
867 Return p[0]
868 End Function
869
870 Sub Event(e As _System_WinSock_WSACOMPLETION_EVENT)
871 Dim p As *_System_WinSock_WSACOMPLETION_EVENT
872 p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_EVENT
873 p[0] = e
874 End Sub
875
876 Function Apc() As _System_WinSock_WSACOMPLETION_APC
877 Dim p As *_System_WinSock_WSACOMPLETION_APC
878 p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_APC
879 Return p[0]
880 End Function
881
882 Sub Apc(a As _System_WinSock_WSACOMPLETION_APC)
883 Dim p As *_System_WinSock_WSACOMPLETION_APC
884 p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_APC
885 p[0] = a
886 End Sub
887/*
888 Function Port() As _System_WinSock_WSACOMPLETION_PORT
889 Dim p As *_System_WinSock_WSACOMPLETION_PORT
890 p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_PORT
891 Return p[0]
892 End Function
893
894 Sub Port(p As _System_WinSock_WSACOMPLETION_PORT)
895 Dim p As *_System_WinSock_WSACOMPLETION_PORT
896 p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_PORT
897 p[0] = p
898 End Sub
899*/
900End Type 'Class
901
902TypeDef PWSACOMPLETION = *WSACOMPLETION
903TypeDef LPWSACOMPLETION = *WSACOMPLETION
904
905' WinSock 2 extension -- manifest constants for SIO_TRANSLATE_HANDLE ioctl
906Const TH_NETDEV = &h00000001
907Const TH_TAPI = &h00000002
908
909TypeDef SOCKADDR = sockaddr
910TypeDef PSOCKADDR = *sockaddr
911TypeDef LPSOCKADDR = *sockaddr
912
913TypeDef SOCKADDR_STORAGE = sockaddr_storage
914TypeDef PSOCKADDR_STORAGE = *sockaddr_storage
915TypeDef LPSOCKADDR_STORAGE = *sockaddr_storage
916
917' Manifest constants and type definitions related to name resolution and
918' registration (RNR) API
919
920#ifndef _tagBLOB_DEFINED
921#define _tagBLOB_DEFINED
922#define _BLOB_DEFINED
923#define _LPBLOB_DEFINED
924Type BLOB
925 cbSize As DWord
926#ifdef MIDL_PASS
927 [size_is(cbSize)] pBlobData As *Byte
928#else
929 pBlobData As *Byte
930#endif
931End Type
932TypeDef LPBLOB = *BLOB
933#endif
934
935' Service Install Flags
936Const SERVICE_MULTIPLE = (&h00000001)
937
938' Name Spaces
939
940Const NS_ALL = (0)
941
942Const NS_SAP = (1)
943Const NS_NDS = (2)
944Const NS_PEER_BROWSE = (3)
945Const NS_SLP = (5)
946Const NS_DHCP = (6)
947
948Const NS_TCPIP_LOCAL = (10)
949Const NS_TCPIP_HOSTS = (11)
950Const NS_DNS = (12)
951Const NS_NETBT = (13)
952Const NS_WINS = (14)
953Const NS_NLA = (15)
954
955Const NS_NBP = (20)
956
957Const NS_MS = (30)
958Const NS_STDA = (31)
959Const NS_NTDS = (32)
960
961Const NS_X500 = (40)
962Const NS_NIS = (41)
963Const NS_NISPLUS = (42)
964
965Const NS_WRQ = (50)
966
967Const NS_NETDES = (60)
968
969' Resolution flags for WSAGetAddressByName().
970Const RES_UNUSED_1 = (&h00000001)
971Const RES_FLUSH_CACHE = (&h00000002)
972#ifndef RES_SERVICE
973#define RES_SERVICE
974Const RES_SERVICE = (&h00000004)
975#endif /* RES_SERVICE */
976
977' Well known value names for Service Types
978
979Const SERVICE_TYPE_VALUE_IPXPORTA = "IpxSocket"
980'Const SERVICE_TYPE_VALUE_IPXPORTW = L"IpxSocket"
981Const SERVICE_TYPE_VALUE_SAPIDA = "SapId"
982'Const SERVICE_TYPE_VALUE_SAPIDW = L"SapId"
983
984Const SERVICE_TYPE_VALUE_TCPPORTA = "TcpPort"
985'Const SERVICE_TYPE_VALUE_TCPPORTW = L"TcpPort"
986
987Const SERVICE_TYPE_VALUE_UDPPORTA = "UdpPort"
988'Const SERVICE_TYPE_VALUE_UDPPORTW = L"UdpPort"
989
990Const SERVICE_TYPE_VALUE_OBJECTIDA = "ObjectId"
991'Const SERVICE_TYPE_VALUE_OBJECTIDW = L"ObjectId"
992
993#ifdef UNICODE
994/*
995Const SERVICE_TYPE_VALUE_SAPID = SERVICE_TYPE_VALUE_SAPIDW
996Const SERVICE_TYPE_VALUE_TCPPORT = SERVICE_TYPE_VALUE_TCPPORTW
997Const SERVICE_TYPE_VALUE_UDPPORT = SERVICE_TYPE_VALUE_UDPPORTW
998Const SERVICE_TYPE_VALUE_OBJECTID = SERVICE_TYPE_VALUE_OBJECTIDW
999*/
1000#else
1001
1002Const SERVICE_TYPE_VALUE_SAPID = SERVICE_TYPE_VALUE_SAPIDA
1003Const SERVICE_TYPE_VALUE_TCPPORT = SERVICE_TYPE_VALUE_TCPPORTA
1004Const SERVICE_TYPE_VALUE_UDPPORT = SERVICE_TYPE_VALUE_UDPPORTA
1005Const SERVICE_TYPE_VALUE_OBJECTID = SERVICE_TYPE_VALUE_OBJECTIDA
1006
1007#endif
1008
1009#ifndef __CSADDR_DEFINED__
1010#define __CSADDR_DEFINED__
1011
1012' SockAddr Information
1013Type SOCKET_ADDRESS
1014 lpSockaddr As LPSOCKADDR
1015 iSockaddrLength As Long
1016End Type
1017TypeDef PSOCKET_ADDRESS = *SOCKET_ADDRESS
1018TypeDef LPSOCKET_ADDRESS = *SOCKET_ADDRESS
1019
1020' CSAddr Information
1021Type CSADDR_INFO
1022 LocalAddr As SOCKET_ADDRESS
1023 RemoteAddr As SOCKET_ADDRESS
1024 iSocketType As Long
1025 iProtocol As Long
1026End Type
1027TypeDef PCSADDR_INFO = *CSADDR_INFO
1028TypeDef LPCSADDR_INFO = *CSADDR_INFO
1029#endif
1030
1031' Address list returned via SIO_ADDRESS_LIST_QUERY
1032Type SOCKET_ADDRESS_LIST
1033 iAddressCount As Long
1034 Address[ELM(1)] As SOCKET_ADDRESS
1035End Type
1036TypeDef LPSOCKET_ADDRESS_LIST = *SOCKET_ADDRESS_LIST
1037
1038' Address Family/Protocol Tuples
1039Type AFPROTOCOLS
1040 iAddressFamily As Long
1041 iProtocol As Long
1042End Type
1043TypeDef PAFPROTOCOLS = *AFPROTOCOLS
1044TypeDef LPAFPROTOCOLS = *AFPROTOCOLS
1045
1046' Client Query API Typedefs
1047
1048' The comparators
1049Const Enum WSAECOMPARATOR
1050 COMP_EQUAL = 0
1051 COMP_NOTLESS
1052End Enum
1053TypeDef PWSAECOMPARATOR = *WSAECOMPARATOR
1054TypeDef LPWSAECOMPARATOR = *WSAECOMPARATOR
1055
1056Type WSAVERSION
1057 dwVersion As DWord
1058 ecHow As WSAECOMPARATOR
1059End Type
1060TypeDef PWSAVERSION = *WSAVERSION
1061TypeDef LPWSAVERSION = *WSAVERSION
1062
1063Type WSAQUERYSETA
1064 dwSize As DWord
1065 lpszServiceInstanceName As LPSTR
1066 lpServiceClassId As *GUID
1067 lpVersion As LPWSAVERSION
1068 lpszComment As LPSTR
1069 dwNameSpace As DWord
1070 lpNSProviderId As *GUID
1071 lpszContext As LPSTR
1072 dwNumberOfProtocols As DWord
1073 lpafpProtocols As LPAFPROTOCOLS
1074 lpszQueryString As LPSTR
1075 dwNumberOfCsAddrs As DWord
1076 lpcsaBuffer As LPCSADDR_INFO
1077 dwOutputFlags As DWord
1078 lpBlob As LPBLOB
1079End Type
1080TypeDef PWSAQUERYSETA = *WSAQUERYSETA
1081TypeDef LPWSAQUERYSETA = *WSAQUERYSETA
1082
1083Type WSAQUERYSETW
1084 dwSize As DWord
1085 lpszServiceInstanceName As LPWSTR
1086 lpServiceClassId As *GUID
1087 lpVersion As LPWSAVERSION
1088 lpszComment As LPWSTR
1089 dwNameSpace As DWord
1090 lpNSProviderId As *GUID
1091 lpszContext As LPWSTR
1092 dwNumberOfProtocols As DWord
1093 lpafpProtocols As LPAFPROTOCOLS
1094 lpszQueryString As LPWSTR
1095 dwNumberOfCsAddrs As DWord
1096 lpcsaBuffer As LPCSADDR_INFO
1097 dwOutputFlags As DWord
1098 lpBlob As LPBLOB
1099End Type
1100TypeDef PWSAQUERYSETW = *WSAQUERYSETW
1101TypeDef LPWSAQUERYSETW = *WSAQUERYSETW
1102
1103#ifdef UNICODE
1104TypeDef WSAQUERYSET = WSAQUERYSETW
1105TypeDef PWSAQUERYSET = PWSAQUERYSETW
1106TypeDef LPWSAQUERYSET = LPWSAQUERYSETW
1107#else
1108TypeDef WSAQUERYSET = WSAQUERYSETA
1109TypeDef PWSAQUERYSET = PWSAQUERYSETA
1110TypeDef LPWSAQUERYSET = LPWSAQUERYSETA
1111#endif
1112
1113Const LUP_DEEP = &h0001
1114Const LUP_CONTAINERS = &h0002
1115Const LUP_NOCONTAINERS = &h0004
1116Const LUP_NEAREST = &h0008
1117Const LUP_RETURN_NAME = &h0010
1118Const LUP_RETURN_TYPE = &h0020
1119Const LUP_RETURN_VERSION = &h0040
1120Const LUP_RETURN_COMMENT = &h0080
1121Const LUP_RETURN_ADDR = &h0100
1122Const LUP_RETURN_BLOB = &h0200
1123Const LUP_RETURN_ALIASES = &h0400
1124Const LUP_RETURN_QUERY_STRING = &h0800
1125Const LUP_RETURN_ALL = &h0FF0
1126Const LUP_RES_SERVICE = &h8000
1127
1128Const LUP_FLUSHCACHE = &h1000
1129Const LUP_FLUSHPREVIOUS = &h2000
1130
1131' Return flags
1132Const RESULT_IS_ALIAS = &h0001
1133Const RESULT_IS_ADDED = &h0010
1134Const RESULT_IS_CHANGED = &h0020
1135Const RESULT_IS_DELETED = &h0040
1136
1137' Service Address Registration and Deregistration Data Types.
1138
1139Const Enum WSAESETSERVICEOP
1140 RNRSERVICE_REGISTER = 0
1141 RNRSERVICE_DEREGISTER
1142 RNRSERVICE_DELETE
1143End Enum
1144TypeDef PWSAESETSERVICEOP = *WSAESETSERVICEOP
1145TypeDef LPWSAESETSERVICEOP = *WSAESETSERVICEOP
1146
1147' Service Installation/Removal Data Types.
1148
1149Type WSANSCLASSINFOA
1150 lpszName As LPSTR
1151 dwNameSpace As DWord
1152 dwValueType As DWord
1153 dwValueSize As DWord
1154 lpValue As VoidPtr
1155End Type
1156TypeDef PWSANSCLASSINFOA = *WSANSCLASSINFOA
1157TypeDef LPWSANSCLASSINFOA = *WSANSCLASSINFOA
1158
1159Type WSANSCLASSINFOW
1160 lpszName As LPWSTR
1161 dwNameSpace As DWord
1162 dwValueType As DWord
1163 dwValueSize As DWord
1164 lpValue As VoidPtr
1165End Type
1166TypeDef PWSANSCLASSINFOW = *WSANSCLASSINFOW
1167TypeDef LPWSANSCLASSINFOW = *WSANSCLASSINFOW
1168
1169#ifdef UNICODE
1170TypeDef WSANSCLASSINFO = WSANSCLASSINFOW
1171TypeDef PWSANSCLASSINFO = PWSANSCLASSINFOW
1172TypeDef LPWSANSCLASSINFO = LPWSANSCLASSINFOW
1173#else
1174TypeDef WSANSCLASSINFO = WSANSCLASSINFOA
1175TypeDef PWSANSCLASSINFO = PWSANSCLASSINFOA
1176TypeDef LPWSANSCLASSINFO = LPWSANSCLASSINFOA
1177#endif
1178
1179Type WSASERVICECLASSINFOA
1180 lpServiceClassId As *GUID
1181 lpszServiceClassName As LPSTR
1182 dwCount As DWord
1183 lpClassInfos As LPWSANSCLASSINFOA
1184End Type
1185TypeDef PWSASERVICECLASSINFOA = *WSASERVICECLASSINFOA
1186TypeDef LPWSASERVICECLASSINFOA = *WSASERVICECLASSINFOA
1187
1188Type WSASERVICECLASSINFOW
1189 lpServiceClassId As *GUID
1190 lpszServiceClassName As LPWSTR
1191 dwCount As DWord
1192 lpClassInfos As LPWSANSCLASSINFOA
1193End Type
1194TypeDef PWSASERVICECLASSINFOW = *WSASERVICECLASSINFOW
1195TypeDef LPWSASERVICECLASSINFOW = *WSASERVICECLASSINFOW
1196
1197#ifdef UNICODE
1198TypeDef WSASERVICECLASSINFO = WSASERVICECLASSINFOW
1199TypeDef PWSASERVICECLASSINFO = PWSASERVICECLASSINFOW
1200TypeDef LPWSASERVICECLASSINFO = LPWSASERVICECLASSINFOW
1201#else
1202TypeDef WSASERVICECLASSINFO = WSASERVICECLASSINFOA
1203TypeDef PWSASERVICECLASSINFO = PWSASERVICECLASSINFOA
1204TypeDef LPWSASERVICECLASSINFO = LPWSASERVICECLASSINFOA
1205#endif
1206
1207Type WSANAMESPACE_INFOA
1208 NSProviderId As GUID
1209 dwNameSpace As DWord
1210 fActive As BOOL
1211 dwVersion As DWord
1212 lpszIdentifier As LPSTR
1213End Type
1214TypeDef PWSANAMESPACE_INFOA = *WSANAMESPACE_INFOA
1215TypeDef LPWSANAMESPACE_INFOA = *WSANAMESPACE_INFOA
1216
1217Type WSANAMESPACE_INFOW
1218 NSProviderId As GUID
1219 dwNameSpace As DWord
1220 fActive As BOOL
1221 dwVersion As DWord
1222 lpszIdentifier As LPWSTR
1223End Type
1224TypeDef PWSANAMESPACE_INFOW = *WSANAMESPACE_INFOW
1225TypeDef LPWSANAMESPACE_INFOW = *WSANAMESPACE_INFOW
1226
1227#ifdef UNICODE
1228TypeDef WSANAMESPACE_INFO = WSANAMESPACE_INFOW
1229TypeDef PWSANAMESPACE_INFO = PWSANAMESPACE_INFOW
1230TypeDef LPWSANAMESPACE_INFO = LPWSANAMESPACE_INFOW
1231#else
1232TypeDef WSANAMESPACE_INFO = WSANAMESPACE_INFOA
1233TypeDef PWSANAMESPACE_INFO = PWSANAMESPACE_INFOA
1234TypeDef LPWSANAMESPACE_INFO = LPWSANAMESPACE_INFOA
1235#endif
1236
1237' Socket function prototypes
1238
1239#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1240Declare Function accept Lib "ws2_32" (s As SOCKET, ByRef addr As sockaddr, ByRef addrlen As Long) As SOCKET
1241#endif
1242
1243#ifdef INCL_WINSOCK_API_TYPEDEFS
1244TypeDef LPFN_ACCEPT = *Function(s As SOCKET, ByRef addr As sockaddr, ByRef addrlen As Long) As SOCKET
1245#endif
1246
1247#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1248Declare Function bind Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, addrlen As Long) As Long
1249#endif
1250
1251#ifdef INCL_WINSOCK_API_TYPEDEFS
1252TypeDef LPFN_BIND = *Function(s As SOCKET, ByRef name As sockaddr, addrlen As Long) As Long
1253#endif
1254
1255#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1256Declare Function closesocket Lib "ws2_32" (s As SOCKET) As Long
1257#endif
1258
1259#ifdef INCL_WINSOCK_API_TYPEDEFS
1260TypeDef LPFN_CLOSESOCKET = *Function(s As SOCKET) As Long
1261#endif
1262
1263#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1264Declare Function connect Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, namelen As Long) As Long
1265#endif
1266
1267#ifdef INCL_WINSOCK_API_TYPEDEFS
1268TypeDef LPFN_CONNECT = *Function(s As SOCKET, ByRef name As sockaddr, namelen As Long) As Long
1269#endif
1270
1271#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1272Declare Function ioctlsocket Lib "ws2_32" (s As SOCKET, cmd As Long, ByRef argp As DWord) As Long
1273#endif
1274
1275#ifdef INCL_WINSOCK_API_TYPEDEFS
1276TypeDef LPFN_IOCTLSOCKET = *Function(s As SOCKET, cmd As Long, ByRef argp As DWord) As Long
1277#endif
1278
1279#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1280Declare Function getpeername Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, ByRef namelen As Long) As Long
1281#endif
1282
1283#ifdef INCL_WINSOCK_API_TYPEDEFS
1284TypeDef LPFN_GETPEERNAME = *Function(s As SOCKET, ByRef name As sockaddr, ByRef namelen As Long) As Long
1285#endif
1286
1287#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1288Declare Function getsockname Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, ByRef namelen As Long) As Long
1289#endif
1290
1291#ifdef INCL_WINSOCK_API_TYPEDEFS
1292TypeDef LPFN_GETSOCKNAME = *Function(s As SOCKET, ByRef name As sockaddr, ByRef namelen As Long) As Long
1293#endif
1294
1295#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1296Declare Function getsockopt Lib "ws2_32" (s As SOCKET, level As Long, optname As Long, optval As *Byte, ByRef optlen As Long) As Long
1297#endif
1298
1299#ifdef INCL_WINSOCK_API_TYPEDEFS
1300TypeDef LPFN_GETSOCKOPT = *Function(s As SOCKET, level As Long, optname As Long, optval As *Byte, ByRef optlen As Long) As Long
1301#endif
1302
1303#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1304Declare Function htonl Lib "ws2_32" (hostlong As DWord) As DWord
1305#endif
1306
1307#ifdef INCL_WINSOCK_API_TYPEDEFS
1308TypeDef LPFN_HTONL = *Function(hostlong As DWord) As DWord
1309#endif
1310
1311#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1312Declare Function htons Lib "ws2_32" (hostshort As Word) As Word
1313#endif
1314
1315#ifdef INCL_WINSOCK_API_TYPEDEFS
1316TypeDef LPFN_HTONS = *Function(hostshort As Word) As Word
1317#endif
1318
1319#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1320Declare Function inet_addr Lib "ws2_32" (cp As *Byte) As DWord
1321#endif
1322
1323#ifdef INCL_WINSOCK_API_TYPEDEFS
1324TypeDef LPFN_INET_ADDR = *Function(cp As *Byte) As DWord
1325#endif
1326
1327#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1328Declare Function inet_ntoa Lib "ws2_32" (in As DWord /*in_addr*/ ) As *Byte
1329#endif
1330
1331#ifdef INCL_WINSOCK_API_TYPEDEFS
1332TypeDef LPFN_INET_NTOA = *Function(in As in_addr) As *Byte
1333#endif
1334
1335#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1336Declare Function listen Lib "ws2_32" (s As SOCKET, backlog As Long) As Long
1337#endif
1338
1339#ifdef INCL_WINSOCK_API_TYPEDEFS
1340TypeDef LPFN_LISTEN = *Function(s As SOCKET, backlog As Long) As Long
1341#endif
1342
1343#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1344Declare Function ntohl Lib "ws2_32" (netlong As DWord) As DWord
1345#endif
1346
1347#ifdef INCL_WINSOCK_API_TYPEDEFS
1348TypeDef LPFN_NTOHL = *Function(netlong As DWord) As DWord
1349#endif
1350
1351#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1352Declare Function ntohs Lib "ws2_32" (netshort As Word) As Word
1353#endif
1354
1355#ifdef INCL_WINSOCK_API_TYPEDEFS
1356TypeDef LPFN_NTOHS = *Function(netshort As Word) As Word
1357#endif
1358
1359#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1360Declare Function recv Lib "ws2_32" (s As SOCKET, buf As *Byte, len As Long, flags As Long) As Long
1361#endif
1362
1363#ifdef INCL_WINSOCK_API_TYPEDEFS
1364TypeDef LPFN_RECV = *Function(s As SOCKET, buf As *Byte, len As Long, flags As Long) As Long
1365#endif
1366
1367#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1368Declare Function recvfrom Lib "ws2_32" (s As SOCKET, buf As *Byte, len As Long, flags As Long, ByRef from As sockaddr, ByRef fromlen As Long) As Long
1369#endif
1370
1371#ifdef INCL_WINSOCK_API_TYPEDEFS
1372TypeDef LPFN_RECVFROM = *Function(s As SOCKET, buf As *Byte, len As Long, flags As Long, ByRef from As sockaddr, ByRef fromlen As Long) As Long
1373#endif
1374
1375#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1376Declare Function select Lib "ws2_32" (nfds As Long, ByRef readfds As fd_set, ByRef writefds As fd_set, ByRef exceptfds As fd_set, ByRef timeout As timeval) As Long
1377#endif
1378
1379#ifdef INCL_WINSOCK_API_TYPEDEFS
1380TypeDef LPFN_SELECT = *Function(nfds As Long, ByRef readfds As fd_set, ByRef writefds As fd_set, ByRef exceptfds As fd_set, ByRef timeout As timeval) As Long
1381#endif
1382
1383#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1384Declare Function send Lib "ws2_32" (s As SOCKET, buf As *Byte, len As Long, flags As Long) As Long
1385#endif
1386
1387#ifdef INCL_WINSOCK_API_TYPEDEFS
1388TypeDef LPFN_SEND = *Function(s As SOCKET, buf As *Byte, len As Long, flags As Long) As Long
1389#endif
1390
1391#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1392Declare Function sendto Lib "ws2_32" (s As SOCKET, buf As *Byte, len As Long, flags As Long, ByRef to_ As sockaddr, tolen As Long) As Long
1393#endif
1394
1395#ifdef INCL_WINSOCK_API_TYPEDEFS
1396TypeDef LPFN_SENDTO = *Function(s As SOCKET, buf As *Byte, len As Long, flags As Long, ByRef to_ As sockaddr, tolen As Long) As Long
1397#endif
1398
1399#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1400Declare Function setsockopt Lib "ws2_32" (s As SOCKET, level As Long, optname As Long, optval As *Byte, optlen As Long) As Long
1401#endif
1402
1403#ifdef INCL_WINSOCK_API_TYPEDEFS
1404TypeDef LPFN_SETSOCKOPT = *Function(s As SOCKET, level As Long, optname As Long, optval As *Byte, optlen As Long) As Long
1405#endif
1406
1407#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1408Declare Function shutdown Lib "ws2_32" (s As SOCKET, how As Long) As Long
1409#endif
1410
1411#ifdef INCL_WINSOCK_API_TYPEDEFS
1412TypeDef LPFN_SHUTDOWN = *Function(s As SOCKET, how As Long) As Long
1413#endif
1414
1415#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1416Declare Function socket Lib "ws2_32" (af As Long, type_ As Long, protocol As Long) As SOCKET
1417#endif
1418
1419#ifdef INCL_WINSOCK_API_TYPEDEFS
1420TypeDef LPFN_SOCKET = *Function(af As Long, type_ As Long, protocol As Long) As SOCKET
1421#endif
1422
1423' Database function prototypes
1424
1425#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1426Declare Function gethostbyaddr Lib "ws2_32" (addr As PCSTR, len As Long, type_ As Long) As *hostent
1427#endif
1428
1429#ifdef INCL_WINSOCK_API_TYPEDEFS
1430TypeDef LPFN_GETHOSTBYADDR = *Function(addr As PCSTR, len As Long, type_ As Long) As *hostent
1431#endif
1432
1433#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1434Declare Function gethostbyname Lib "ws2_32" (name As PCSTR) As *hostent
1435#endif
1436
1437#ifdef INCL_WINSOCK_API_TYPEDEFS
1438TypeDef LPFN_GETHOSTBYNAME = *Function(name As PCSTR) As *hostent
1439#endif
1440
1441#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1442Declare Function gethostname Lib "ws2_32" (name As PCSTR, namelen As Long) As Long
1443#endif
1444
1445#ifdef INCL_WINSOCK_API_TYPEDEFS
1446TypeDef LPFN_GETHOSTNAME = *Function(name As PCSTR, namelen As Long) As Long
1447#endif
1448
1449#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1450Declare Function getservbyport Lib "ws2_32" (port As Long, proto As PCSTR) As *servent
1451#endif
1452
1453#ifdef INCL_WINSOCK_API_TYPEDEFS
1454TypeDef LPFN_GETSERVBYPORT = *Function(port As Long, proto As PCSTR) As *servent
1455#endif
1456
1457#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1458Declare Function getservbyname Lib "ws2_32" (name As PCSTR, proto As PCSTR) As *servent
1459#endif
1460
1461#ifdef INCL_WINSOCK_API_TYPEDEFS
1462TypeDef LPFN_GETSERVBYNAME = *Function(name As PCSTR, proto As PCSTR) As *servent
1463#endif
1464
1465#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1466Declare Function getprotobynumber Lib "ws2_32" (number As Long) As *protoent
1467#endif
1468
1469#ifdef INCL_WINSOCK_API_TYPEDEFS
1470TypeDef LPFN_GETPROTOBYNUMBER = *Function(number As Long) As *protoent
1471#endif
1472
1473#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1474Declare Function getprotobyname Lib "ws2_32" (name As PCSTR) As *protoent
1475#endif
1476
1477#ifdef INCL_WINSOCK_API_TYPEDEFS
1478TypeDef LPFN_GETPROTOBYNAME = (name As PCSTR) As *protoent
1479#endif
1480
1481' Microsoft Windows Extension function prototypes
1482
1483#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1484Declare Function WSAStartup Lib "ws2_32" (wVersionRequested As Word, ByRef WSAData As WSADATA) As Long
1485#endif
1486
1487#ifdef INCL_WINSOCK_API_TYPEDEFS
1488TypeDef LPFN_WSASTARTUP = *Function(wVersionRequested As Word, ByRef WSAData As WSADATA) As Long
1489#endif
1490
1491#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1492Declare Function WSACleanup Lib "ws2_32" () As Long
1493#endif
1494
1495#ifdef INCL_WINSOCK_API_TYPEDEFS
1496TypeDef LPFN_WSACLEANUP = *Function() As Long
1497#endif
1498
1499#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1500Declare Sub WSASetLastError Lib "ws2_32" (iError As Long)
1501#endif
1502
1503#ifdef INCL_WINSOCK_API_TYPEDEFS
1504TypeDef LPFN_WSASETLASTERROR = *Sub(iError As Long)
1505#endif
1506
1507#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1508Declare Function WSAGetLastError Lib "ws2_32" () As Long
1509#endif
1510
1511#ifdef INCL_WINSOCK_API_TYPEDEFS
1512TypeDef LPFN_WSAGETLASTERROR = *Function() As Long
1513#endif
1514
1515#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1516Declare Function WSAIsBlocking Lib "ws2_32" () As BOOL
1517#endif
1518
1519#ifdef INCL_WINSOCK_API_TYPEDEFS
1520TypeDef LPFN_WSAISBLOCKING = *Function() As BOOL
1521#endif
1522
1523#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1524Declare Function WSAUnhookBlockingHook Lib "ws2_32" () As Long
1525#endif
1526
1527#ifdef INCL_WINSOCK_API_TYPEDEFS
1528TypeDef LPFN_WSAUNHOOKBLOCKINGHOOK = *Function() As Long
1529#endif
1530
1531#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1532Declare Function WSASetBlockingHook Lib "ws2_32" (lpBlockFunc As FARPROC) As FARPROC
1533
1534#endif
1535
1536#ifdef INCL_WINSOCK_API_TYPEDEFS
1537TypeDef LPFN_WSASETBLOCKINGHOOK = *Function(lpBlockFunc As FARPROC) As FARPROC
1538#endif
1539
1540#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1541Declare Function WSACancelBlockingCall Lib "ws2_32" () As Long
1542#endif
1543
1544#ifdef INCL_WINSOCK_API_TYPEDEFS
1545TypeDef LPFN_WSACANCELBLOCKINGCALL = *Function() As Long
1546#endif
1547
1548#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1549Declare Function WSAAsyncGetServByName Lib "ws2_32" (hwnd As HWND, msg As DWord, name As PCSTR, proto As PCSTR, buf As *Byte, buflen As Long) As HANDLE
1550#endif
1551
1552#ifdef INCL_WINSOCK_API_TYPEDEFS
1553TypeDef LPFN_WSAASYNCGETSERVBYNAME = *Function(hwnd As HWND, msg As DWord, name As PCSTR, proto As PCSTR, buf As *Byte, buflen As Long) As HANDLE
1554#endif
1555
1556#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1557Declare Function WSAAsyncGetServByPort Lib "ws2_32" (hwnd As HWND, msg As DWord, port As Long, proto As PCSTR, buf As *Byte, buflen As Long) As HANDLE
1558#endif
1559
1560#ifdef INCL_WINSOCK_API_TYPEDEFS
1561TypeDef LPFN_WSAASYNCGETSERVBYPORT = *Function(hwnd As HWND, msg As DWord, port As Long, proto As PCSTR, buf As *Byte, buflen As Long) As HANDLE
1562#endif
1563
1564#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1565Declare Function WSAAsyncGetProtoByName Lib "ws2_32" (hwnd As HWND, msg As DWord, name As PCSTR, buf As *Byte, buflen As Long) As HANDLE
1566#endif
1567
1568#ifdef INCL_WINSOCK_API_TYPEDEFS
1569TypeDef LPFN_WSAASYNCGETPROTOBYNAME = *Function(hwnd As HWND, msg As DWord, name As PCSTR, buf As *Byte, buflen As Long) As HANDLE
1570#endif
1571
1572#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1573Declare Function WSAAsyncGetProtoByNumber Lib "ws2_32" (hwnd As HWND, msg As DWord, number As Long, buf As *Byte, buflen As Long) As HANDLE
1574#endif
1575
1576#ifdef INCL_WINSOCK_API_TYPEDEFS
1577TypeDef LPFN_WSAASYNCGETPROTOBYNUMBER = *Function(hwnd As HWND, msg As DWord, number As Long, buf As *Byte, buflen As Long) As HANDLE
1578#endif
1579
1580#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1581Declare Function WSAAsyncGetHostByName Lib "ws2_32" (hwnd As HWND, msg As DWord, name As PCSTR, buf As *Byte, buflen As Long) As HANDLE
1582#endif
1583
1584#ifdef INCL_WINSOCK_API_TYPEDEFS
1585TypeDef LPFN_WSAASYNCGETHOSTBYNAME = *Function(hwnd As HWND, msg As DWord, name As PCSTR, buf As *Byte, buflen As Long) As HANDLE
1586#endif
1587
1588#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1589Declare Function WSAAsyncGetHostByAddr Lib "ws2_32" (hwnd As HWND, msg As DWord, addr As PCSTR, len As Long, type_ As Long, buf As *Byte, buflen As Long) As HANDLE
1590#endif
1591
1592#ifdef INCL_WINSOCK_API_TYPEDEFS
1593TypeDef LPFN_WSAASYNCGETHOSTBYADDR = *Function(hwnd As HWND, msg As DWord, addr As PCSTR, len As Long, type_ As Long, buf As *Byte, buflen As Long) As HANDLE
1594#endif
1595
1596#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1597Declare Function WSACancelAsyncRequest Lib "ws2_32" (hAsyncTaskHandle As HANDLE) As Long
1598#endif
1599
1600#ifdef INCL_WINSOCK_API_TYPEDEFS
1601TypeDef LPFN_WSACANCELASYNCREQUEST = *Function(hAsyncTaskHandle As HANDLE) As Long
1602#endif
1603
1604#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1605Declare Function WSAAsyncSelect Lib "ws2_32" (s As SOCKET, hwnd As HWND, msg As DWord, Event As Long) As Long
1606#endif
1607
1608#ifdef INCL_WINSOCK_API_TYPEDEFS
1609TypeDef LPFN_WSAASYNCSELECT = *Function(s As SOCKET, hwnd As HWND, msg As DWord, Event As Long) As Long
1610#endif
1611
1612/* WinSock 2 API new function prototypes */
1613
1614#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1615Declare Function WSAAccept Lib "ws2_32" (s As SOCKET, ByRef addr As sockaddr, ByRef addrlen As Long, lpfnCondition As LPCONDITIONPROC, CallbackData As ULONG_PTR) As SOCKET
1616#endif
1617
1618#ifdef INCL_WINSOCK_API_TYPEDEFS
1619TypeDef LPFN_WSAACCEPT = *Function(s As SOCKET, ByRef addr As sockaddr, ByRef addrlen As Long, lpfnCondition As LPCONDITIONPROC, CallbackData As ULONG_PTR) As SOCKET
1620#endif
1621
1622#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1623Declare Function WSACloseEvent Lib "ws2_32" (hEvent As WSAEVENT) As BOOL
1624#endif
1625
1626#ifdef INCL_WINSOCK_API_TYPEDEFS
1627TypeDef LPFN_WSACLOSEEVENT = *Function(hEvent As WSAEVENT) As BOOL
1628#endif
1629
1630#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1631Declare Function WSAConnect Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, namelen As Long, ByRef CallerData As WSABUF, ByRef CalleeData As WSABUF, ByRef SQOS As QOS, ByRef GQOS As QOS) As Long
1632#endif
1633
1634#ifdef INCL_WINSOCK_API_TYPEDEFS
1635TypeDef LPFN_WSACONNECT = *Functions As SOCKET, ByRef name As sockaddr, namelen As Long, ByRef CallerData As WSABUF, ByRef CalleeData As WSABUF, ByRef SQOS As QOS, ByRef GQOS As QOS) As Long
1636#endif
1637
1638#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1639Declare Function WSACreateEvent Lib "ws2_32" () As WSAEVENT
1640#endif
1641
1642#ifdef INCL_WINSOCK_API_TYPEDEFS
1643TypeDef LPFN_WSACREATEEVENT = *Function() As WSAEVENT
1644#endif
1645
1646#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1647Declare Function WSADuplicateSocketA Lib "ws2_32" (s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA) As Long
1648Declare Function WSADuplicateSocketW Lib "ws2_32" (s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOW) As Long
1649#ifdef UNICODE
1650Declare Function WSADuplicateSocket Lib "ws2_32" Alias "WSADuplicateSocketW" (s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFO) As Long
1651#else
1652Declare Function WSADuplicateSocket Lib "ws2_32" Alias "WSADuplicateSocketA" (s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFO) As Long
1653#endif
1654#endif
1655
1656#ifdef INCL_WINSOCK_API_TYPEDEFS
1657TypeDef LPFN_WSADUPLICATESOCKETA = *Function(s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA) As Long
1658TypeDef LPFN_WSADUPLICATESOCKETW = *Function(s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOW) As Long
1659#ifdef UNICODE
1660TypeDef LPFN_WSADUPLICATESOCKET = LPFN_WSADUPLICATESOCKETW
1661#else
1662TypeDef LPFN_WSADUPLICATESOCKET = LPFN_WSADUPLICATESOCKETA
1663#endif
1664#endif
1665
1666#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1667Declare Function WSAEnumNetworkEvents Lib "ws2_32" (s As SOCKET, hEventObject As WSAEVENT, ByRef NetworkEvents As WSANETWORKEVENTS) As Long
1668#endif
1669
1670#ifdef INCL_WINSOCK_API_TYPEDEFS
1671TypeDef LPFN_WSAENUMNETWORKEVENTS = *Function(s As SOCKET, hEventObject As WSAEVENT, ByRef NetworkEvents As WSANETWORKEVENTS) As Long
1672#endif
1673
1674#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1675Declare Function WSAEnumProtocolsA Lib "ws2_32" (Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFOA, ByRef BufferLength As DWord) As Long
1676Declare Function WSAEnumProtocolsW Lib "ws2_32" (Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFOW, ByRef BufferLength As DWord) As Long
1677#ifdef UNICODE
1678Declare Function WSAEnumProtocols Lib "ws2_32" Alias "WSAEnumProtocolsW" (Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFO, ByRef BufferLength As DWord) As Long
1679#else
1680Declare Function WSAEnumProtocols Lib "ws2_32" Alias "WSAEnumProtocolsA" (Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFO, ByRef BufferLength As DWord) As Long
1681#endif
1682#endif
1683
1684#ifdef INCL_WINSOCK_API_TYPEDEFS
1685TypeDef LPFN_WSAENUMPROTOCOLSA = *Function(Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFOA, ByRef BufferLength As DWord) As Long
1686TypeDef LPFN_WSAENUMPROTOCOLSW = *Function(Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFOW, ByRef BufferLength As DWord) As Long
1687#ifdef UNICODE
1688TypeDef LPFN_WSAENUMPROTOCOLS = LPFN_WSAENUMPROTOCOLSW
1689#else
1690TypeDef LPFN_WSAENUMPROTOCOLS = LPFN_WSAENUMPROTOCOLSA
1691#endif
1692#endif
1693
1694#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1695Declare Function WSAEventSelect Lib "ws2_32" (s As SOCKET, hEventObject As WSAEVENT, NetworkEvents As Long) As Long
1696#endif
1697
1698#ifdef INCL_WINSOCK_API_TYPEDEFS
1699TypeDef LPFN_WSAEVENTSELECT = *Function(s As SOCKET, hEventObject As WSAEVENT, NetworkEvents As Long) As Long
1700#endif
1701
1702#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1703Declare Function WSAGetOverlappedResult Lib "ws2_32" (s As SOCKET, ByRef Overlapped As WSAOVERLAPPED, ByRef cbTransfer As DWord, Wait As BOOL, ByRef Flags As DWord) As BOOL
1704#endif
1705
1706#ifdef INCL_WINSOCK_API_TYPEDEFS
1707TypeDef LPFN_WSAGETOVERLAPPEDRESULT = *Function(s As SOCKET, ByRef Overlapped As WSAOVERLAPPED, ByRef cbTransfer As DWord, Wait As BOOL, ByRef Flags As DWord) As BOOL
1708#endif
1709
1710#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1711Declare Function WSAGetQOSByName Lib "ws2_32" (s As SOCKET, ByRef QOSName As WSABUF, ByRef qos As QOS) As BOOL
1712#endif
1713
1714#ifdef INCL_WINSOCK_API_TYPEDEFS
1715TypeDef LPFN_WSAGETQOSBYNAME = *Function(s As SOCKET, ByRef QOSName As WSABUF, ByRef qos As QOS) As BOOL
1716#endif
1717
1718#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1719Declare Function WSAHtonl Lib "ws2_32" (s As SOCKET, hostlong As DWord, ByRef netlong As DWord) As Long
1720#endif
1721
1722#ifdef INCL_WINSOCK_API_TYPEDEFS
1723TypeDef LPFN_WSAHTONL = *Function(s As SOCKET, hostlong As DWord, ByRef netlong As DWord) As Long
1724#endif
1725
1726#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1727Declare Function WSAHtons Lib "ws2_32" (s As SOCKET, hostshort As Word, ByRef netshort As Word) As Long
1728#endif
1729
1730#ifdef INCL_WINSOCK_API_TYPEDEFS
1731TypeDef LPFN_WSAHTONS = *Function(s As SOCKET, hostshort As Word, ByRef netshort As Word) As Long
1732#endif
1733
1734#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1735Declare Function WSAIoctl Lib "ws2_32" (s As SOCKET, IoControlCode As DWord, pvInBuffer As VoidPtr, cbInBuffer As DWord, pvOutBuffer As VoidPtr, cbOutBuffer As DWord,
1736 ByRef cbBytesReturned As DWord, ByRef Overlapped As WSAOVERLAPPED, pCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
1737#endif
1738
1739#ifdef INCL_WINSOCK_API_TYPEDEFS
1740TypeDef LPFN_WSAIOCTL = *Function(s As SOCKET, IoControlCode As DWord, pvInBuffer As VoidPtr, cbInBuffer As DWord, pvOutBuffer As VoidPtr, cbOutBuffer As DWord,
1741 ByRef cbBytesReturned As DWord, ByRef Overlapped As WSAOVERLAPPED, pCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
1742#endif
1743
1744#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1745Declare Function WSAJoinLeaf Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, namelen As Long, ByRef CallerData As WSABUF, ByRef CalleeData As WSABUF,
1746 ByRef SQOS As QOS, ByRef GQOS AS QOS, Flags As DWord) As SOCKET
1747#endif
1748
1749#ifdef INCL_WINSOCK_API_TYPEDEFS
1750TypeDef LPFN_WSAJOINLEAF = *Function(s As SOCKET, ByRef name As sockaddr, namelen As Long, ByRef CallerData As WSABUF, ByRef CalleeData As WSABUF,
1751 ByRef SQOS As QOS, ByRef GQOS AS QOS, Flags As DWord) As SOCKET
1752#endif
1753
1754#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1755Declare Function WSANtohl Lib "ws2_32" (s As SOCKET, netlong As DWord, ByRef hostlong As DWord) As Long
1756#endif
1757
1758#ifdef INCL_WINSOCK_API_TYPEDEFS
1759TypeDef LPFN_WSANTOHL = *Function(s As SOCKET, netlong As DWord, ByRef hostlong As DWord) As Long
1760#endif
1761
1762#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1763Declare Function WSANtohs Lib "ws2_32" (s As SOCKET, netshort As Word, ByRef hostshort As Word) As Long
1764#endif
1765
1766#ifdef INCL_WINSOCK_API_TYPEDEFS
1767TypeDef LPFN_WSANTOHS = *Function(s As SOCKET, netshort As Word, ByRef hostshort As Word) As Long
1768#endif
1769
1770#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1771Declare Function WSARecv Lib "ws2_32" (s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesRecvd As DWord, ByRef Flags As DWord,
1772 ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
1773#endif
1774
1775#ifdef INCL_WINSOCK_API_TYPEDEFS
1776TypeDef LPFN_WSARECV = *Function(s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesRecvd As DWord, ByRef Flags As DWord,
1777 ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
1778#endif
1779
1780#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1781Declare Function WSARecvDisconnect Lib "ws2_32" (s As SOCKET, ByRef InboundDisconnectData As WSABUF) As Long
1782#endif
1783
1784#ifdef INCL_WINSOCK_API_TYPEDEFS
1785TypeDef LPFN_WSARECVDISCONNECT = *Function(s As SOCKET, ByRef InboundDisconnectData As WSABUF) As Long
1786#endif
1787
1788#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1789Declare Function WSARecvFrom Lib "ws2_32" (s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesRecvd As DWord, ByRef Flags As DWord,
1790 ByRef From As sockaddr, ByRef Fromlen As Long, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
1791#endif
1792
1793#ifdef INCL_WINSOCK_API_TYPEDEFS
1794TypeDef LPFN_WSARECVFROM = *Function(s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesRecvd As DWord, ByRef Flags As DWord,
1795 ByRef From As sockaddr, ByRef Fromlen As Long, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
1796#endif
1797
1798#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1799Declare Function WSAResetEvent Lib "ws2_32" (hEvent As WSAEVENT) As BOOL
1800#endif
1801
1802#ifdef INCL_WINSOCK_API_TYPEDEFS
1803TypeDef LPFN_WSARESETEVENT = *Function(hEvent As WSAEVENT) As BOOL
1804#endif
1805
1806#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1807Declare Function WSASend Lib "ws2_32" (s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesSent As DWord, ByRef Flags As DWord,
1808 ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
1809#endif
1810
1811#ifdef INCL_WINSOCK_API_TYPEDEFS
1812TypeDef LPFN_WSASEND = *Function(s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesSent As DWord, ByRef Flags As DWord,
1813 ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
1814#endif
1815
1816#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1817Declare Function WSASendDisconnect Lib "ws2_32" (s As SOCKET, ByRef OutboundDisconnectData As WSABUF) As Long
1818#endif
1819
1820#ifdef INCL_WINSOCK_API_TYPEDEFS
1821TypeDef LPFN_WSASENDDISCONNECT = *Function(s As SOCKET, ByRef OutboundDisconnectData As WSABUF) As Long
1822#endif
1823
1824#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1825Declare Function WSASendTo Lib "ws2_32" (s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesSent As DWord, ByRef Flags As DWord,
1826 ByRef To_ As sockaddr, ToLen As Long, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
1827#endif
1828
1829#ifdef INCL_WINSOCK_API_TYPEDEFS
1830TypeDef LPFN_WSASENDTO = *Function(s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesSent As DWord, ByRef Flags As DWord,
1831 ByRef To_ As sockaddr, ToLen As Long, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
1832#endif
1833
1834#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1835Declare Function WSASetEvent Lib "ws2_32" (hEvent As WSAEVENT) As BOOL
1836#endif
1837
1838#ifdef INCL_WINSOCK_API_TYPEDEFS
1839TypeDef LPFN_WSASETEVENT = *Function(hEvent As WSAEVENT) As BOOL
1840#endif
1841
1842#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1843Declare Function WSASocketA Lib "ws2_32" (af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOA, g As GROUP, Flags As DWord) As SOCKET
1844Declare Function WSASocketW Lib "ws2_32" (af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOW, g As GROUP, Flags As DWord) As SOCKET
1845#ifdef UNICODE
1846Declare Function WSASocket Lib "ws2_32" Alias "WSASocketW" (af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFO, g As GROUP, Flags As DWord) As SOCKET
1847#else
1848Declare Function WSASocket Lib "ws2_32" Alias "WSASocketA" (af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFO, g As GROUP, Flags As DWord) As SOCKET
1849#endif
1850#endif
1851
1852#ifdef INCL_WINSOCK_API_TYPEDEFS
1853TypeDef LPFN_WSASOCKETA = *Function(af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOA, g As GROUP, Flags As DWord) As SOCKET
1854TypeDef LPFN_WSASOCKETW = *Function(af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOW, g As GROUP, Flags As DWord) As SOCKET
1855#ifdef UNICODE
1856TypeDef LPFN_WSASOCKET = LPFN_WSASOCKETW
1857#else
1858TypeDef LPFN_WSASOCKET = LPFN_WSASOCKETA
1859#endif
1860#endif
1861
1862#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1863Declare Function WSAWaitForMultipleEvents Lib "ws2_32" (cEvents As DWord, phEvents As *WSAEVENT, WaitAll As BOOL, Timeout As DWord, Alertable As BOOL) As DWord
1864#endif
1865
1866#ifdef INCL_WINSOCK_API_TYPEDEFS
1867TypeDef LPFN_WSAWAITFORMULTIPLEEVENTS = *Function(cEvents As DWord, phEvents As *WSAEVENT, WaitAll As BOOL, Timeout As DWord, Alertable As BOOL) As DWord
1868#endif
1869
1870#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1871Declare Function WSAAddressToStringA Lib "ws2_32" (ByRef saAddress As SOCKADDR, AddressLength As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA,
1872 AddressString As PSTR, ByRef dwAddressStringLength As DWord) As Long
1873Declare Function WSAAddressToStringW Lib "ws2_32" (ByRef saAddress As SOCKADDR, AddressLength As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA,
1874 AddressString As PWSTR, ByRef dwAddressStringLength As DWord) As Long
1875#ifdef UNICODE
1876Declare Function WSAAddressToString Lib "ws2_32" Alias "WSAAddressToStringW" (ByRef saAddress As SOCKADDR, AddressLength As DWord,
1877 ByRef ProtocolInfo As WSAPROTOCOL_INFO, AddressString As PSTR, ByRef dwAddressStringLength As DWord) As Long
1878#else
1879Declare Function WSAAddressToString Lib "ws2_32" Alias "WSAAddressToStringA" (ByRef saAddress As SOCKADDR, AddressLength As DWord,
1880 ByRef ProtocolInfo As WSAPROTOCOL_INFO, AddressString As PSTR, ByRef dwAddressStringLength As DWord) As Long
1881#endif
1882#endif
1883
1884#ifdef INCL_WINSOCK_API_TYPEDEFS
1885TypeDef LPFN_WSAADDRESSTOSTRINGA = *Function(ByRef saAddress As SOCKADDR, AddressLength As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA,
1886 AddressString As PSTR, ByRef dwAddressStringLength As DWord) As Long
1887TypeDef LPFN_WSAADDRESSTOSTRINGW = *Function(ByRef saAddress As SOCKADDR, AddressLength As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA,
1888 AddressString As PWSTR, ByRef dwAddressStringLength As DWord) As Long
1889#ifdef UNICODE
1890TypeDef LPFN_WSAADDRESSTOSTRING = LPFN_WSAADDRESSTOSTRINGW
1891#else
1892TypeDef LPFN_WSAADDRESSTOSTRING = LPFN_WSAADDRESSTOSTRINGA
1893#endif
1894#endif
1895
1896#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1897Declare Function WSAStringToAddressA Lib "ws2_32" (AddressString As PSTR, AddressFamily As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOA,
1898 ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long
1899Declare Function WSAStringToAddressW Lib "ws2_32" (AddressString As PWSTR, AddressFamily As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOW,
1900 ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long
1901#ifdef UNICODE
1902Declare Function WSAStringToAddress Lib "ws2_32" Alias "WSAStringToAddressW" (AddressString As PSTR, AddressFamily As Long,
1903 ByRef ProtocolInfo As WSAPROTOCOL_INFO, ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long
1904#else
1905Declare Function WSAStringToAddress Lib "ws2_32" Alias "WSAStringToAddressA" (AddressString As PSTR, AddressFamily As Long,
1906 ByRef ProtocolInfo As WSAPROTOCOL_INFO, ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long
1907#endif
1908#endif
1909
1910#ifdef INCL_WINSOCK_API_TYPEDEFS
1911TypeDef LPFN_WSASTRINGTOADDRESSA = *Function(AddressString As PSTR, AddressFamily As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOA,
1912 ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long
1913TypeDef LPFN_WSASTRINGTOADDRESSW = *Function(AddressString As PWSTR, AddressFamily As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOW,
1914 ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long
1915#ifdef UNICODE
1916TypeDef LPFN_WSASTRINGTOADDRESS = LPFN_WSASTRINGTOADDRESSW
1917#else
1918TypeDef LPFN_WSASTRINGTOADDRESS = LPFN_WSASTRINGTOADDRESSA
1919#endif
1920#endif
1921
1922' Registration and Name Resolution API functions
1923#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1924Declare Function WSALookupServiceBeginA Lib "ws2_32" (ByRef qsRestrictions As WSAQUERYSETA, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long
1925Declare Function WSALookupServiceBeginW Lib "ws2_32" (ByRef qsRestrictions As WSAQUERYSETW, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long
1926#ifdef UNICODE
1927Declare Function WSALookupServiceBegin Lib "ws2_32" Alias "WSALookupServiceBeginW" (ByRef qsRestrictions As WSAQUERYSET, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long
1928#else
1929Declare Function WSALookupServiceBegin Lib "ws2_32" Alias "WSALookupServiceBeginA" (ByRef qsRestrictions As WSAQUERYSET, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long
1930#endif
1931#endif
1932
1933#ifdef INCL_WINSOCK_API_TYPEDEFS
1934TypeDef LPFN_WSALOOKUPSERVICEBEGINA = *Function(ByRef qsRestrictions As WSAQUERYSETA, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long
1935TypeDef LPFN_WSALOOKUPSERVICEBEGINW = *Function(ByRef qsRestrictions As WSAQUERYSETW, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long
1936#ifdef UNICODE
1937TypeDef LPFN_WSALOOKUPSERVICEBEGIN = LPFN_WSALOOKUPSERVICEBEGINW
1938#else
1939TypeDef LPFN_WSALOOKUPSERVICEBEGIN = LPFN_WSALOOKUPSERVICEBEGINA
1940#endif
1941#endif
1942
1943#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1944Declare Function WSALookupServiceNextA Lib "ws2_32" (hLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSETA) As Long
1945Declare Function WSALookupServiceNextW Lib "ws2_32" (hLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSETW) As Long
1946#ifdef UNICODE
1947Declare Function WSALookupServiceNext Lib "ws2_32" Alias "WSALookupServiceNextW" (hLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSET) As Long
1948#else
1949Declare Function WSALookupServiceNext Lib "ws2_32" Alias "WSALookupServiceNextA" (hLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSET) As Long
1950#endif
1951#endif
1952
1953#ifdef INCL_WINSOCK_API_TYPEDEFS
1954TypeDef LPFN_WSALOOKUPSERVICENEXTA = *FunctionhLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSETA) As Long
1955TypeDef LPFN_WSALOOKUPSERVICENEXTW = *FunctionhLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSETW) As Long
1956#ifdef UNICODE
1957TypeDef LPFN_WSALOOKUPSERVICENEXT = LPFN_WSALOOKUPSERVICENEXTW
1958#else
1959TypeDef LPFN_WSALOOKUPSERVICENEXT = LPFN_WSALOOKUPSERVICENEXTA
1960#endif
1961#endif
1962
1963#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1964Declare Function WSANSPIoctl Lib "ws2_32" (hLookup As HANDLE, ControlCode As DWord, pvInBuffer As VoidPtr, cbInBuffer As DWord,
1965 pvOutBuffer As VoidPtr, cbOutBuffer As DWord, ByRef cbBytesReturned As DWord, ByRef Completion As WSACOMPLETION) As Long
1966#endif
1967
1968#ifdef INCL_WINSOCK_API_TYPEDEFS
1969TypeDef LPFN_WSANSPIOCTL = *Function(hLookup As HANDLE, ControlCode As DWord, pvInBuffer As VoidPtr, cbInBuffer As DWord,
1970 pvOutBuffer As VoidPtr, cbOutBuffer As DWord, ByRef cbBytesReturned As DWord, ByRef Completion As WSACOMPLETION) As Long
1971#endif
1972
1973#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1974Declare Function WSALookupServiceEnd Lib "ws2_32" (hLookup As HANDLE) As Long
1975#endif
1976
1977#ifdef INCL_WINSOCK_API_TYPEDEFS
1978TypeDef LPFN_WSALOOKUPSERVICEEND = *Function(hLookup As HANDLE) As Long
1979#endif
1980
1981#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
1982Declare Function WSAInstallServiceClassA Lib "ws2_32" (ByRef ServiceClassInfo As WSASERVICECLASSINFOA) As Long
1983Declare Function WSAInstallServiceClassW Lib "ws2_32" (ByRef ServiceClassInfo As WSASERVICECLASSINFOW) As Long
1984#ifdef UNICODE
1985Declare Function WSAInstallServiceClass Lib "ws2_32" Alias "WSAInstallServiceClassW" (ByRef ServiceClassInfo As WSASERVICECLASSINFO) As Long
1986#else
1987Declare Function WSAInstallServiceClass Lib "ws2_32" Alias "WSAInstallServiceClassA" (ByRef ServiceClassInfo As WSASERVICECLASSINFO) As Long
1988#endif
1989#endif
1990
1991#ifdef INCL_WINSOCK_API_TYPEDEFS
1992TypeDef LPFN_WSAINSTALLSERVICECLASSA = *Function(ByRef ServiceClassInfo As WSASERVICECLASSINFOA) As Long
1993TypeDef LPFN_WSAINSTALLSERVICECLASSW = *Function(ByRef ServiceClassInfo As WSASERVICECLASSINFOW) As Long
1994#ifdef UNICODE
1995TypeDef LPFN_WSAINSTALLSERVICECLASS = LPFN_WSAINSTALLSERVICECLASSW
1996#else
1997TypeDef LPFN_WSAINSTALLSERVICECLASS = LPFN_WSAINSTALLSERVICECLASSA
1998#endif
1999#endif
2000
2001#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
2002Declare Function WSARemoveServiceClass Lib "ws2_32" (ByRef ServiceClassId As GUID) As Long
2003#endif
2004
2005#ifdef INCL_WINSOCK_API_TYPEDEFS
2006TypeDef LPFN_WSAREMOVESERVICECLASS = *Function(ByRef ServiceClassId As GUID) As Long
2007#endif
2008
2009#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
2010Declare Function WSAGetServiceClassInfoA Lib "ws2_32" (ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFOA) As Long
2011Declare Function WSAGetServiceClassInfoW Lib "ws2_32" (ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFOW) As Long
2012#ifdef UNICODE
2013Declare Function WSAGetServiceClassInfo Lib "ws2_32" Alias "WSAGetServiceClassInfoW" (ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFO) As Long
2014#else
2015Declare Function WSAGetServiceClassInfo Lib "ws2_32" Alias "WSAGetServiceClassInfoA" (ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFO) As Long
2016#endif
2017#endif
2018
2019#ifdef INCL_WINSOCK_API_TYPEDEFS
2020TypeDef LPFN_WSAGETSERVICECLASSINFOA = *Function(ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFOA) As Long
2021TypeDef LPFN_WSAGETSERVICECLASSINFOW = *Function(ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFOW) As Long
2022#ifdef UNICODE
2023TypeDef LPFN_WSAGETSERVICECLASSINFO = LPFN_WSAGETSERVICECLASSINFOW
2024#else
2025TypeDef LPFN_WSAGETSERVICECLASSINFO = LPFN_WSAGETSERVICECLASSINFOA
2026#endif
2027#endif
2028
2029#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
2030Declare Function WSAEnumNameSpaceProvidersA Lib "ws2_32" (ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFOA) As Long
2031Declare Function WSAEnumNameSpaceProvidersW Lib "ws2_32" (ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFOW) As Long
2032#ifdef UNICODE
2033Declare Function WSAEnumNameSpaceProviders Lib "ws2_32" Alias "WSAEnumNameSpaceProvidersW" (ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFO) As Long
2034#else
2035Declare Function WSAEnumNameSpaceProviders Lib "ws2_32" Alias "WSAEnumNameSpaceProvidersA" (ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFO) As Long
2036#endif
2037#endif
2038
2039#ifdef INCL_WINSOCK_API_TYPEDEFS
2040TypeDef LPFN_WSAENUMNAMESPACEPROVIDERSA = *Function(ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFOA) As Long
2041TypeDef LPFN_WSAENUMNAMESPACEPROVIDERSW = *Function(ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFOW) As Long
2042#ifdef UNICODE
2043TypeDef LPFN_WSAENUMNAMESPACEPROVIDERS = LPFN_WSAENUMNAMESPACEPROVIDERSW
2044#else
2045TypeDef LPFN_WSAENUMNAMESPACEPROVIDERS = LPFN_WSAENUMNAMESPACEPROVIDERSA
2046#endif
2047#endif
2048
2049#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
2050Declare Function WSAGetServiceClassNameByClassIdA Lib "ws2_32" (ByRef ServiceClassId As GUID, ServiceClassName As PSTR, ByRef BufferLength As DWord) As Long
2051Declare Function WSAGetServiceClassNameByClassIdW Lib "ws2_32" (ByRef ServiceClassId As GUID, ServiceClassName As PWSTR, ByRef BufferLength As DWord) As Long
2052#ifdef UNICODE
2053Declare Function WSAGetServiceClassNameByClassId Lib "ws2_32" Alias "WSAGetServiceClassNameByClassIdW" (ByRef ServiceClassId As GUID, ServiceClassName As PWSTR, ByRef BufferLength As DWord) As Long
2054#else
2055Declare Function WSAGetServiceClassNameByClassId Lib "ws2_32" Alias "WSAGetServiceClassNameByClassIdA" (ByRef ServiceClassId As GUID, ServiceClassName As PSTR, ByRef BufferLength As DWord) As Long
2056#endif
2057#endif
2058
2059#ifdef INCL_WINSOCK_API_TYPEDEFS
2060TypeDef LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA = *Function(ByRef ServiceClassId As GUID, ServiceClassName As PSTR, ByRef BufferLength As DWord) As Long
2061TypeDef LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW = *Function(ByRef ServiceClassId As GUID, ServiceClassName As PWSTR, ByRef BufferLength As DWord) As Long
2062#ifdef UNICODE
2063TypeDef LPFN_WSAGETSERVICECLASSNAMEBYCLASSID = LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW
2064#else
2065TypeDef LPFN_WSAGETSERVICECLASSNAMEBYCLASSID = LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA
2066#endif
2067#endif
2068
2069#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
2070Declare Function WSASetServiceA Lib "ws2_32" (ByRef qsRegInfo As WSAQUERYSETA, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long
2071Declare Function WSASetServiceW Lib "ws2_32" (ByRef qsRegInfo As WSAQUERYSETW, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long
2072#ifdef UNICODE
2073Declare Function WSASetService Lib "ws2_32" Alias "WSASetServiceW" (ByRef qsRegInfo As WSAQUERYSET, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long
2074#else
2075Declare Function WSASetService Lib "ws2_32" Alias "WSASetServiceA" (ByRef qsRegInfo As WSAQUERYSET, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long
2076#endif
2077#endif
2078
2079#ifdef INCL_WINSOCK_API_TYPEDEFS
2080TypeDef LPFN_WSASETSERVICEA = *Function(ByRef qsRegInfo As WSAQUERYSETA, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long
2081TypeDef LPFN_WSASETSERVICEW = *Function(ByRef qsRegInfo As WSAQUERYSETW, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long
2082#ifdef UNICODE
2083TypeDef LPFN_WSASETSERVICE = LPFN_WSASETSERVICEW
2084#else
2085TypeDef LPFN_WSASETSERVICE = LPFN_WSASETSERVICEA
2086#endif
2087#endif
2088
2089#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
2090Declare Function WSAProviderConfigChange Lib "ws2_32" (ByRef NotificationHandle As HANDLE, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
2091#endif
2092
2093#ifdef INCL_WINSOCK_API_TYPEDEFS
2094TypeDef LPFN_WSAPROVIDERCONFIGCHANGE = *Function(ByRef NotificationHandle As HANDLE, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
2095#endif
2096
2097' Microsoft Windows Extended data types
2098TypeDef SOCKADDR_IN = sockaddr_in
2099TypeDef PSOCKADDR_IN = *sockaddr_in
2100TypeDef LPSOCKADDR_IN = *sockaddr_in
2101
2102TypeDef LINGER = linger
2103TypeDef PLINGER = *linger
2104TypeDef LPLINGER = *linger
2105
2106TypeDef IN_ADDR = in_addr
2107TypeDef PIN_ADDR = *in_addr
2108TypeDef LPIN_ADDR = *in_addr
2109
2110TypeDef FD_SET = fd_set
2111TypeDef PFD_SET = *fd_set
2112TypeDef LPFD_SET = *fd_set
2113
2114TypeDef HOSTENT = hostent
2115TypeDef PHOSTENT = *hostent
2116TypeDef LPHOSTENT = *hostent
2117
2118TypeDef SERVENT = servent
2119TypeDef PSERVENT = *servent
2120TypeDef LPSERVENT = *servent
2121
2122TypeDef PROTOENT = protoent
2123TypeDef PPROTOENT = *protoent
2124TypeDef LPPROTOENT = *protoent
2125
2126TypeDef TIMEVAL = timeval
2127TypeDef PTIMEVAL = *timeval
2128TypeDef LPTIMEVAL = *timeval
2129
2130' Windows message parameter composition and decomposition macros.
2131Const WSAMAKEASYNCREPLY(buflen, error) = MAKELONG(buflen, error)
2132Const WSAMAKESELECTREPLY(event, error) = MAKELONG(event, error)
2133Const WSAGETASYNCBUFLEN(lParam) = LOWORD(lParam)
2134Const WSAGETASYNCERROR(lParam) = HIWORD(lParam)
2135Const WSAGETSELECTEVENT(lParam) = LOWORD(lParam)
2136Const WSAGETSELECTERROR(lParam) = HIWORD(lParam)
2137
2138#ifdef IPV6STRICT
2139'#include <wsipv6ok.ab>
2140#endif
2141
2142#endif
Note: See TracBrowser for help on using the repository browser.