source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/winsock2.h@ 1167

Last change on this file since 1167 was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 49.2 KB
Line 
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#ifndef _WINSOCK2API_
8#define _WINSOCK2API_
9
10#include <_mingw_unicode.h>
11
12#ifndef _WINSOCKAPI_
13#define _WINSOCKAPI_
14#else
15#warning Please include winsock2.h before windows.h
16#endif
17
18#ifndef INCL_WINSOCK_API_TYPEDEFS
19#define INCL_WINSOCK_API_TYPEDEFS 0
20#endif
21
22#ifndef _INC_WINDOWS
23#include <windows.h>
24#endif
25
26#ifndef MAKEWORD
27#define MAKEWORD(low,high) ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8))
28#endif
29
30#ifndef WINSOCK_VERSION
31#define WINSOCK_VERSION MAKEWORD(2,2)
32#endif
33
34#ifndef WINSOCK_API_LINKAGE
35#ifdef DECLSPEC_IMPORT
36#define WINSOCK_API_LINKAGE DECLSPEC_IMPORT
37#else
38#define WINSOCK_API_LINKAGE
39#endif
40#endif /* WINSOCK_API_LINKAGE */
41#define WSAAPI WINAPI
42
43/* undefine macros from winsock.h */
44#include <psdk_inc/_ws1_undef.h>
45
46#ifdef __LP64__
47#pragma push_macro("u_long")
48#undef u_long
49#define u_long __ms_u_long
50#endif
51
52#include <_timeval.h>
53#include <_bsd_types.h>
54#include <inaddr.h>
55#include <psdk_inc/_socket_types.h>
56#include <psdk_inc/_fd_types.h>
57#include <psdk_inc/_ip_types.h>
58#include <psdk_inc/_wsadata.h>
59#include <ws2def.h> /* FIXME: include order */
60
61#ifdef __cplusplus
62extern "C" {
63#endif
64
65#define IOCPARM_MASK 0x7f
66#define IOC_VOID 0x20000000
67#define IOC_OUT 0x40000000
68#define IOC_IN 0x80000000
69#define IOC_INOUT (IOC_IN|IOC_OUT)
70
71#define _IO(x,y) (IOC_VOID|((x)<<8)|(y))
72#define _IOR(x,y,t) (IOC_OUT|(((__LONG32)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
73#define _IOW(x,y,t) (IOC_IN|(((__LONG32)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
74
75#define FIONREAD _IOR('f',127,u_long)
76#define FIONBIO _IOW('f',126,u_long)
77#define FIOASYNC _IOW('f',125,u_long)
78
79#define SIOCSHIWAT _IOW('s',0,u_long)
80#define SIOCGHIWAT _IOR('s',1,u_long)
81#define SIOCSLOWAT _IOW('s',2,u_long)
82#define SIOCGLOWAT _IOR('s',3,u_long)
83#define SIOCATMARK _IOR('s',7,u_long)
84
85#define IPPROTO_IP 0
86#define IPPROTO_HOPOPTS 0
87#define IPPROTO_ICMP 1
88#define IPPROTO_IGMP 2
89#define IPPROTO_GGP 3
90#define IPPROTO_IPV4 4
91#define IPPROTO_ST 5
92#define IPPROTO_TCP 6
93#define IPPROTO_CBT 7
94#define IPPROTO_EGP 8
95#define IPPROTO_IGP 9
96#define IPPROTO_PUP 12
97#define IPPROTO_UDP 17
98#define IPPROTO_IDP 22
99#define IPPROTO_RDP 27
100#define IPPROTO_IPV6 41
101#define IPPROTO_ROUTING 43
102#define IPPROTO_FRAGMENT 44
103#define IPPROTO_ESP 50
104#define IPPROTO_AH 51
105#define IPPROTO_ICMPV6 58
106#define IPPROTO_NONE 59
107#define IPPROTO_DSTOPTS 60
108#define IPPROTO_ND 77
109#define IPPROTO_ICLFXBM 78
110#define IPPROTO_PIM 103
111#define IPPROTO_PGM 113
112#define IPPROTO_L2TP 115
113#define IPPROTO_SCTP 132
114
115#define IPPROTO_RAW 255
116#define IPPROTO_MAX 256
117
118#define IPPORT_ECHO 7
119#define IPPORT_DISCARD 9
120#define IPPORT_SYSTAT 11
121#define IPPORT_DAYTIME 13
122#define IPPORT_NETSTAT 15
123#define IPPORT_FTP 21
124#define IPPORT_TELNET 23
125#define IPPORT_SMTP 25
126#define IPPORT_TIMESERVER 37
127#define IPPORT_NAMESERVER 42
128#define IPPORT_WHOIS 43
129#define IPPORT_MTP 57
130
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
137#define IPPORT_EXECSERVER 512
138#define IPPORT_LOGINSERVER 513
139#define IPPORT_CMDSERVER 514
140#define IPPORT_EFSSERVER 520
141
142#define IPPORT_BIFFUDP 512
143#define IPPORT_WHOSERVER 513
144#define IPPORT_ROUTESERVER 520
145
146#define IPPORT_RESERVED 1024
147
148#define IMPLINK_IP 155
149#define IMPLINK_LOWEXPER 156
150#define IMPLINK_HIGHEXPER 158
151
152
153#define IN_CLASSA(i) (((__LONG32)(i) & 0x80000000)==0)
154#define IN_CLASSA_NET 0xff000000
155#define IN_CLASSA_NSHIFT 24
156#define IN_CLASSA_HOST 0x00ffffff
157#define IN_CLASSA_MAX 128
158
159#define IN_CLASSB(i) (((__LONG32)(i) & 0xc0000000)==0x80000000)
160#define IN_CLASSB_NET 0xffff0000
161#define IN_CLASSB_NSHIFT 16
162#define IN_CLASSB_HOST 0x0000ffff
163#define IN_CLASSB_MAX 65536
164
165#define IN_CLASSC(i) (((__LONG32)(i) & 0xe0000000)==0xc0000000)
166#define IN_CLASSC_NET 0xffffff00
167#define IN_CLASSC_NSHIFT 8
168#define IN_CLASSC_HOST 0x000000ff
169
170#define IN_CLASSD(i) (((__LONG32)(i) & 0xf0000000)==0xe0000000)
171#define IN_CLASSD_NET 0xf0000000
172#define IN_CLASSD_NSHIFT 28
173#define IN_CLASSD_HOST 0x0fffffff
174#define IN_MULTICAST(i) IN_CLASSD(i)
175
176#define INADDR_ANY (u_long)0x00000000
177#define INADDR_LOOPBACK 0x7f000001
178#define INADDR_BROADCAST (u_long)0xffffffff
179#define INADDR_NONE 0xffffffff
180
181#define ADDR_ANY INADDR_ANY
182
183#define FROM_PROTOCOL_INFO (-1)
184
185#define SOCK_STREAM 1
186#define SOCK_DGRAM 2
187#define SOCK_RAW 3
188#define SOCK_RDM 4
189#define SOCK_SEQPACKET 5
190
191#define SO_DEBUG 0x0001
192#define SO_ACCEPTCONN 0x0002
193#define SO_REUSEADDR 0x0004
194#define SO_KEEPALIVE 0x0008
195#define SO_DONTROUTE 0x0010
196#define SO_BROADCAST 0x0020
197#define SO_USELOOPBACK 0x0040
198#define SO_LINGER 0x0080
199#define SO_OOBINLINE 0x0100
200
201#define SO_DONTLINGER (int)(~SO_LINGER)
202#define SO_EXCLUSIVEADDRUSE ((int)(~SO_REUSEADDR))
203
204#define SO_SNDBUF 0x1001
205#define SO_RCVBUF 0x1002
206#define SO_SNDLOWAT 0x1003
207#define SO_RCVLOWAT 0x1004
208#define SO_SNDTIMEO 0x1005
209#define SO_RCVTIMEO 0x1006
210#define SO_ERROR 0x1007
211#define SO_TYPE 0x1008
212
213#define SO_GROUP_ID 0x2001
214#define SO_GROUP_PRIORITY 0x2002
215#define SO_MAX_MSG_SIZE 0x2003
216#define SO_PROTOCOL_INFOA 0x2004
217#define SO_PROTOCOL_INFOW 0x2005
218
219#define SO_PROTOCOL_INFO __MINGW_NAME_AW(SO_PROTOCOL_INFO)
220
221#define PVD_CONFIG 0x3001
222#define SO_CONDITIONAL_ACCEPT 0x3002
223
224#define TCP_NODELAY 0x0001
225
226#define AF_UNSPEC 0
227
228#define AF_UNIX 1
229#define AF_INET 2
230#define AF_IMPLINK 3
231#define AF_PUP 4
232#define AF_CHAOS 5
233#define AF_NS 6
234#define AF_IPX AF_NS
235#define AF_ISO 7
236#define AF_OSI AF_ISO
237#define AF_ECMA 8
238#define AF_DATAKIT 9
239#define AF_CCITT 10
240#define AF_SNA 11
241#define AF_DECnet 12
242#define AF_DLI 13
243#define AF_LAT 14
244#define AF_HYLINK 15
245#define AF_APPLETALK 16
246#define AF_NETBIOS 17
247#define AF_VOICEVIEW 18
248#define AF_FIREFOX 19
249#define AF_UNKNOWN1 20
250#define AF_BAN 21
251#define AF_ATM 22
252#define AF_INET6 23
253#define AF_CLUSTER 24
254#define AF_12844 25
255#define AF_IRDA 26
256#define AF_NETDES 28
257#define AF_TCNPROCESS 29
258#define AF_TCNMESSAGE 30
259#define AF_ICLFXBM 31
260#define AF_BTH 32
261#define AF_MAX 33
262
263#define _SS_MAXSIZE 128
264#define _SS_ALIGNSIZE (8)
265
266#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof (short))
267#define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof (short) + _SS_PAD1SIZE + _SS_ALIGNSIZE))
268
269 struct sockaddr_storage {
270 short ss_family;
271 char __ss_pad1[_SS_PAD1SIZE];
272
273 __MINGW_EXTENSION __int64 __ss_align;
274 char __ss_pad2[_SS_PAD2SIZE];
275 };
276
277#define PF_UNSPEC AF_UNSPEC
278#define PF_UNIX AF_UNIX
279#define PF_INET AF_INET
280#define PF_IMPLINK AF_IMPLINK
281#define PF_PUP AF_PUP
282#define PF_CHAOS AF_CHAOS
283#define PF_NS AF_NS
284#define PF_IPX AF_IPX
285#define PF_ISO AF_ISO
286#define PF_OSI AF_OSI
287#define PF_ECMA AF_ECMA
288#define PF_DATAKIT AF_DATAKIT
289#define PF_CCITT AF_CCITT
290#define PF_SNA AF_SNA
291#define PF_DECnet AF_DECnet
292#define PF_DLI AF_DLI
293#define PF_LAT AF_LAT
294#define PF_HYLINK AF_HYLINK
295#define PF_APPLETALK AF_APPLETALK
296#define PF_VOICEVIEW AF_VOICEVIEW
297#define PF_FIREFOX AF_FIREFOX
298#define PF_UNKNOWN1 AF_UNKNOWN1
299#define PF_BAN AF_BAN
300#define PF_ATM AF_ATM
301#define PF_INET6 AF_INET6
302#define PF_BTH AF_BTH
303
304#define PF_MAX AF_MAX
305
306#define SOL_SOCKET 0xffff
307
308#define SOMAXCONN 0x7fffffff
309
310#define MSG_OOB 0x1
311#define MSG_PEEK 0x2
312#define MSG_DONTROUTE 0x4
313
314#if(_WIN32_WINNT >= 0x0502)
315#define MSG_WAITALL 0x8
316#endif
317
318#if(_WIN32_WINNT >= 0x0603)
319#define MSG_PUSH_IMMEDIATE 0x20
320#endif
321
322#define MSG_PARTIAL 0x8000
323
324#define MSG_INTERRUPT 0x10
325
326#define MSG_MAXIOVLEN 16
327
328#define MAXGETHOSTSTRUCT 1024
329
330#define FD_READ_BIT 0
331#define FD_READ (1 << FD_READ_BIT)
332
333#define FD_WRITE_BIT 1
334#define FD_WRITE (1 << FD_WRITE_BIT)
335
336#define FD_OOB_BIT 2
337#define FD_OOB (1 << FD_OOB_BIT)
338
339#define FD_ACCEPT_BIT 3
340#define FD_ACCEPT (1 << FD_ACCEPT_BIT)
341
342#define FD_CONNECT_BIT 4
343#define FD_CONNECT (1 << FD_CONNECT_BIT)
344
345#define FD_CLOSE_BIT 5
346#define FD_CLOSE (1 << FD_CLOSE_BIT)
347
348#define FD_QOS_BIT 6
349#define FD_QOS (1 << FD_QOS_BIT)
350
351#define FD_GROUP_QOS_BIT 7
352#define FD_GROUP_QOS (1 << FD_GROUP_QOS_BIT)
353
354#define FD_ROUTING_INTERFACE_CHANGE_BIT 8
355#define FD_ROUTING_INTERFACE_CHANGE (1 << FD_ROUTING_INTERFACE_CHANGE_BIT)
356
357#define FD_ADDRESS_LIST_CHANGE_BIT 9
358#define FD_ADDRESS_LIST_CHANGE (1 << FD_ADDRESS_LIST_CHANGE_BIT)
359
360#define FD_MAX_EVENTS 10
361#define FD_ALL_EVENTS ((1 << FD_MAX_EVENTS) - 1)
362
363#include <psdk_inc/_wsa_errnos.h>
364
365#define WSAEVENT HANDLE
366#define LPWSAEVENT LPHANDLE
367#define WSAOVERLAPPED OVERLAPPED
368
369 typedef struct _OVERLAPPED *LPWSAOVERLAPPED;
370
371#define WSA_IO_PENDING (ERROR_IO_PENDING)
372#define WSA_IO_INCOMPLETE (ERROR_IO_INCOMPLETE)
373#define WSA_INVALID_HANDLE (ERROR_INVALID_HANDLE)
374#define WSA_INVALID_PARAMETER (ERROR_INVALID_PARAMETER)
375#define WSA_NOT_ENOUGH_MEMORY (ERROR_NOT_ENOUGH_MEMORY)
376#define WSA_OPERATION_ABORTED (ERROR_OPERATION_ABORTED)
377
378#define WSA_INVALID_EVENT ((WSAEVENT)NULL)
379#define WSA_MAXIMUM_WAIT_EVENTS (MAXIMUM_WAIT_OBJECTS)
380#define WSA_WAIT_FAILED (WAIT_FAILED)
381#define WSA_WAIT_EVENT_0 (WAIT_OBJECT_0)
382#define WSA_WAIT_IO_COMPLETION (WAIT_IO_COMPLETION)
383#define WSA_WAIT_TIMEOUT (WAIT_TIMEOUT)
384#define WSA_INFINITE (INFINITE)
385
386 typedef struct _WSABUF {
387 u_long len;
388 char *buf;
389 } WSABUF,*LPWSABUF;
390
391#include <qos.h>
392
393 typedef struct _QualityOfService {
394 FLOWSPEC SendingFlowspec;
395 FLOWSPEC ReceivingFlowspec;
396 WSABUF ProviderSpecific;
397 } QOS,*LPQOS;
398
399#define CF_ACCEPT 0x0000
400#define CF_REJECT 0x0001
401#define CF_DEFER 0x0002
402
403#define SD_RECEIVE 0x00
404#define SD_SEND 0x01
405#define SD_BOTH 0x02
406
407typedef unsigned int GROUP;
408
409#define SG_UNCONSTRAINED_GROUP 0x01
410#define SG_CONSTRAINED_GROUP 0x02
411
412 typedef struct _WSANETWORKEVENTS {
413 __LONG32 lNetworkEvents;
414 int iErrorCode[FD_MAX_EVENTS];
415 } WSANETWORKEVENTS,*LPWSANETWORKEVENTS;
416
417#ifndef GUID_DEFINED
418#include <guiddef.h>
419#endif
420
421#define MAX_PROTOCOL_CHAIN 7
422
423#define BASE_PROTOCOL 1
424#define LAYERED_PROTOCOL 0
425
426 typedef struct _WSAPROTOCOLCHAIN {
427 int ChainLen;
428
429 DWORD ChainEntries[MAX_PROTOCOL_CHAIN];
430 } WSAPROTOCOLCHAIN,*LPWSAPROTOCOLCHAIN;
431
432#define WSAPROTOCOL_LEN 255
433
434 typedef struct _WSAPROTOCOL_INFOA {
435 DWORD dwServiceFlags1;
436 DWORD dwServiceFlags2;
437 DWORD dwServiceFlags3;
438 DWORD dwServiceFlags4;
439 DWORD dwProviderFlags;
440 GUID ProviderId;
441 DWORD dwCatalogEntryId;
442 WSAPROTOCOLCHAIN ProtocolChain;
443 int iVersion;
444 int iAddressFamily;
445 int iMaxSockAddr;
446 int iMinSockAddr;
447 int iSocketType;
448 int iProtocol;
449 int iProtocolMaxOffset;
450 int iNetworkByteOrder;
451 int iSecurityScheme;
452 DWORD dwMessageSize;
453 DWORD dwProviderReserved;
454 CHAR szProtocol[WSAPROTOCOL_LEN+1];
455 } WSAPROTOCOL_INFOA,*LPWSAPROTOCOL_INFOA;
456
457 typedef struct _WSAPROTOCOL_INFOW {
458 DWORD dwServiceFlags1;
459 DWORD dwServiceFlags2;
460 DWORD dwServiceFlags3;
461 DWORD dwServiceFlags4;
462 DWORD dwProviderFlags;
463 GUID ProviderId;
464 DWORD dwCatalogEntryId;
465 WSAPROTOCOLCHAIN ProtocolChain;
466 int iVersion;
467 int iAddressFamily;
468 int iMaxSockAddr;
469 int iMinSockAddr;
470 int iSocketType;
471 int iProtocol;
472 int iProtocolMaxOffset;
473 int iNetworkByteOrder;
474 int iSecurityScheme;
475 DWORD dwMessageSize;
476 DWORD dwProviderReserved;
477 WCHAR szProtocol[WSAPROTOCOL_LEN+1];
478 } WSAPROTOCOL_INFOW,*LPWSAPROTOCOL_INFOW;
479
480 __MINGW_TYPEDEF_AW(WSAPROTOCOL_INFO)
481 __MINGW_TYPEDEF_AW(LPWSAPROTOCOL_INFO)
482
483#define PFL_MULTIPLE_PROTO_ENTRIES 0x00000001
484#define PFL_RECOMMENDED_PROTO_ENTRY 0x00000002
485#define PFL_HIDDEN 0x00000004
486#define PFL_MATCHES_PROTOCOL_ZERO 0x00000008
487#define PFL_NETWORKDIRECT_PROVIDER 0x00000010
488
489#define XP1_CONNECTIONLESS 0x00000001
490#define XP1_GUARANTEED_DELIVERY 0x00000002
491#define XP1_GUARANTEED_ORDER 0x00000004
492#define XP1_MESSAGE_ORIENTED 0x00000008
493#define XP1_PSEUDO_STREAM 0x00000010
494#define XP1_GRACEFUL_CLOSE 0x00000020
495#define XP1_EXPEDITED_DATA 0x00000040
496#define XP1_CONNECT_DATA 0x00000080
497#define XP1_DISCONNECT_DATA 0x00000100
498#define XP1_SUPPORT_BROADCAST 0x00000200
499#define XP1_SUPPORT_MULTIPOINT 0x00000400
500#define XP1_MULTIPOINT_CONTROL_PLANE 0x00000800
501#define XP1_MULTIPOINT_DATA_PLANE 0x00001000
502#define XP1_QOS_SUPPORTED 0x00002000
503#define XP1_INTERRUPT 0x00004000
504#define XP1_UNI_SEND 0x00008000
505#define XP1_UNI_RECV 0x00010000
506#define XP1_IFS_HANDLES 0x00020000
507#define XP1_PARTIAL_MESSAGE 0x00040000
508#define XP1_SAN_SUPPORT_SDP 0x00080000
509
510#define BIGENDIAN 0x0000
511#define LITTLEENDIAN 0x0001
512
513#define SECURITY_PROTOCOL_NONE 0x0000
514
515#define JL_SENDER_ONLY 0x01
516#define JL_RECEIVER_ONLY 0x02
517#define JL_BOTH 0x04
518
519#define WSA_FLAG_OVERLAPPED 0x01
520#define WSA_FLAG_MULTIPOINT_C_ROOT 0x02
521#define WSA_FLAG_MULTIPOINT_C_LEAF 0x04
522#define WSA_FLAG_MULTIPOINT_D_ROOT 0x08
523#define WSA_FLAG_MULTIPOINT_D_LEAF 0x10
524#define WSA_FLAG_ACCESS_SYSTEM_SECURITY 0x40
525#define WSA_FLAG_NO_HANDLE_INHERIT 0x80
526#define WSA_FLAG_REGISTERED_IO 0x100
527
528#define IOC_UNIX 0x00000000
529#define IOC_WS2 0x08000000
530#define IOC_PROTOCOL 0x10000000
531#define IOC_VENDOR 0x18000000
532
533#define _WSAIO(x,y) (IOC_VOID|(x)|(y))
534#define _WSAIOR(x,y) (IOC_OUT|(x)|(y))
535#define _WSAIOW(x,y) (IOC_IN|(x)|(y))
536#define _WSAIORW(x,y) (IOC_INOUT|(x)|(y))
537
538#define SIO_ASSOCIATE_HANDLE _WSAIOW(IOC_WS2,1)
539#define SIO_ENABLE_CIRCULAR_QUEUEING _WSAIO(IOC_WS2,2)
540#define SIO_FIND_ROUTE _WSAIOR(IOC_WS2,3)
541#define SIO_FLUSH _WSAIO(IOC_WS2,4)
542#define SIO_GET_BROADCAST_ADDRESS _WSAIOR(IOC_WS2,5)
543#define SIO_GET_EXTENSION_FUNCTION_POINTER _WSAIORW(IOC_WS2,6)
544#define SIO_GET_QOS _WSAIORW(IOC_WS2,7)
545#define SIO_GET_GROUP_QOS _WSAIORW(IOC_WS2,8)
546#define SIO_MULTIPOINT_LOOPBACK _WSAIOW(IOC_WS2,9)
547#define SIO_MULTICAST_SCOPE _WSAIOW(IOC_WS2,10)
548#define SIO_SET_QOS _WSAIOW(IOC_WS2,11)
549#define SIO_SET_GROUP_QOS _WSAIOW(IOC_WS2,12)
550#define SIO_TRANSLATE_HANDLE _WSAIORW(IOC_WS2,13)
551#define SIO_ROUTING_INTERFACE_QUERY _WSAIORW(IOC_WS2,20)
552#define SIO_ROUTING_INTERFACE_CHANGE _WSAIOW(IOC_WS2,21)
553#define SIO_ADDRESS_LIST_QUERY _WSAIOR(IOC_WS2,22)
554#define SIO_ADDRESS_LIST_CHANGE _WSAIO(IOC_WS2,23)
555#define SIO_QUERY_TARGET_PNP_HANDLE _WSAIOR(IOC_WS2,24)
556#define SIO_ADDRESS_LIST_SORT _WSAIORW(IOC_WS2,25)
557#if (_WIN32_WINNT >= 0x0600)
558#define SIO_RESERVED_1 _WSAIOW(IOC_WS2,26)
559#define SIO_RESERVED_2 _WSAIOW(IOC_WS2,33)
560#endif /* _WIN32_WINNT >= 0x0600 */
561
562 typedef int (CALLBACK *LPCONDITIONPROC)(LPWSABUF lpCallerId,LPWSABUF lpCallerData,LPQOS lpSQOS,LPQOS lpGQOS,LPWSABUF lpCalleeId,LPWSABUF lpCalleeData,GROUP *g,DWORD_PTR dwCallbackData);
563 typedef void (CALLBACK *LPWSAOVERLAPPED_COMPLETION_ROUTINE)(DWORD dwError,DWORD cbTransferred,LPWSAOVERLAPPED lpOverlapped,DWORD dwFlags);
564
565#define SIO_NSP_NOTIFY_CHANGE _WSAIOW(IOC_WS2,25)
566
567 typedef enum _WSACOMPLETIONTYPE {
568 NSP_NOTIFY_IMMEDIATELY = 0,
569 NSP_NOTIFY_HWND,
570 NSP_NOTIFY_EVENT,
571 NSP_NOTIFY_PORT,
572 NSP_NOTIFY_APC
573 } WSACOMPLETIONTYPE,*PWSACOMPLETIONTYPE,*LPWSACOMPLETIONTYPE;
574
575 typedef struct _WSACOMPLETION {
576 WSACOMPLETIONTYPE Type;
577 union {
578 struct {
579 HWND hWnd;
580 UINT uMsg;
581 WPARAM context;
582 } WindowMessage;
583 struct {
584 LPWSAOVERLAPPED lpOverlapped;
585 } Event;
586 struct {
587 LPWSAOVERLAPPED lpOverlapped;
588 LPWSAOVERLAPPED_COMPLETION_ROUTINE lpfnCompletionProc;
589 } Apc;
590 struct {
591 LPWSAOVERLAPPED lpOverlapped;
592 HANDLE hPort;
593 ULONG_PTR Key;
594 } Port;
595 } Parameters;
596 } WSACOMPLETION,*PWSACOMPLETION,*LPWSACOMPLETION;
597
598#define TH_NETDEV 0x00000001
599#define TH_TAPI 0x00000002
600
601 typedef struct sockaddr_storage SOCKADDR_STORAGE;
602 typedef struct sockaddr_storage *PSOCKADDR_STORAGE;
603 typedef struct sockaddr_storage *LPSOCKADDR_STORAGE;
604 typedef u_short ADDRESS_FAMILY;
605
606#ifndef _tagBLOB_DEFINED
607#define _tagBLOB_DEFINED
608#define _BLOB_DEFINED
609#define _LPBLOB_DEFINED
610 typedef struct _BLOB {
611 ULONG cbSize;
612 BYTE *pBlobData;
613 } BLOB,*LPBLOB;
614#endif /* _tagBLOB_DEFINED */
615
616#define SERVICE_MULTIPLE (0x00000001)
617
618#define NS_ALL (0)
619
620#define NS_SAP (1)
621#define NS_NDS (2)
622#define NS_PEER_BROWSE (3)
623#define NS_SLP (5)
624#define NS_DHCP (6)
625
626#define NS_TCPIP_LOCAL (10)
627#define NS_TCPIP_HOSTS (11)
628#define NS_DNS (12)
629#define NS_NETBT (13)
630#define NS_WINS (14)
631#if(_WIN32_WINNT >= 0x0501)
632#define NS_NLA (15)
633#endif
634#if (_WIN32_WINNT >= 0x0600)
635#define NS_BTH (16)
636#endif
637
638#define NS_NBP (20)
639
640#define NS_MS (30)
641#define NS_STDA (31)
642#define NS_NTDS (32)
643
644#if (_WIN32_WINNT >= 0x0600)
645#define NS_EMAIL (37)
646#define NS_PNRPNAME (38)
647#define NS_PNRPCLOUD (39)
648#endif
649
650#define NS_X500 (40)
651#define NS_NIS (41)
652#define NS_NISPLUS (42)
653
654#define NS_WRQ (50)
655
656#define NS_NETDES (60)
657
658#define RES_UNUSED_1 (0x00000001)
659#define RES_FLUSH_CACHE (0x00000002)
660#ifndef RES_SERVICE
661#define RES_SERVICE (0x00000004)
662#endif
663
664#define SERVICE_TYPE_VALUE_IPXPORTA "IpxSocket"
665#define SERVICE_TYPE_VALUE_IPXPORTW L"IpxSocket"
666#define SERVICE_TYPE_VALUE_SAPIDA "SapId"
667#define SERVICE_TYPE_VALUE_SAPIDW L"SapId"
668
669#define SERVICE_TYPE_VALUE_TCPPORTA "TcpPort"
670#define SERVICE_TYPE_VALUE_TCPPORTW L"TcpPort"
671
672#define SERVICE_TYPE_VALUE_UDPPORTA "UdpPort"
673#define SERVICE_TYPE_VALUE_UDPPORTW L"UdpPort"
674
675#define SERVICE_TYPE_VALUE_OBJECTIDA "ObjectId"
676#define SERVICE_TYPE_VALUE_OBJECTIDW L"ObjectId"
677
678#define SERVICE_TYPE_VALUE_SAPID __MINGW_NAME_AW(SERVICE_TYPE_VALUE_SAPID)
679#define SERVICE_TYPE_VALUE_TCPPORT __MINGW_NAME_AW(SERVICE_TYPE_VALUE_TCPPORT)
680#define SERVICE_TYPE_VALUE_UDPPORT __MINGW_NAME_AW(SERVICE_TYPE_VALUE_UDPPORT)
681#define SERVICE_TYPE_VALUE_OBJECTID __MINGW_NAME_AW(SERVICE_TYPE_VALUE_OBJECTID)
682
683#ifndef __CSADDR_DEFINED__
684#define __CSADDR_DEFINED__
685
686 typedef struct _SOCKET_ADDRESS {
687 LPSOCKADDR lpSockaddr;
688 INT iSockaddrLength;
689 } SOCKET_ADDRESS,*PSOCKET_ADDRESS,*LPSOCKET_ADDRESS;
690
691 typedef struct _CSADDR_INFO {
692 SOCKET_ADDRESS LocalAddr;
693 SOCKET_ADDRESS RemoteAddr;
694 INT iSocketType;
695 INT iProtocol;
696 } CSADDR_INFO,*PCSADDR_INFO,*LPCSADDR_INFO;
697#endif /* __CSADDR_DEFINED__ */
698
699 typedef struct _SOCKET_ADDRESS_LIST {
700 INT iAddressCount;
701 SOCKET_ADDRESS Address[1];
702 } SOCKET_ADDRESS_LIST,*PSOCKET_ADDRESS_LIST,*LPSOCKET_ADDRESS_LIST;
703
704 typedef struct _AFPROTOCOLS {
705 INT iAddressFamily;
706 INT iProtocol;
707 } AFPROTOCOLS,*PAFPROTOCOLS,*LPAFPROTOCOLS;
708
709 typedef enum _WSAEcomparator {
710 COMP_EQUAL = 0,
711 COMP_NOTLESS
712 } WSAECOMPARATOR,*PWSAECOMPARATOR,*LPWSAECOMPARATOR;
713
714 typedef struct _WSAVersion {
715 DWORD dwVersion;
716 WSAECOMPARATOR ecHow;
717 } WSAVERSION,*PWSAVERSION,*LPWSAVERSION;
718
719 typedef struct _WSAQuerySetA {
720 DWORD dwSize;
721 LPSTR lpszServiceInstanceName;
722 LPGUID lpServiceClassId;
723 LPWSAVERSION lpVersion;
724 LPSTR lpszComment;
725 DWORD dwNameSpace;
726 LPGUID lpNSProviderId;
727 LPSTR lpszContext;
728 DWORD dwNumberOfProtocols;
729 LPAFPROTOCOLS lpafpProtocols;
730 LPSTR lpszQueryString;
731 DWORD dwNumberOfCsAddrs;
732 LPCSADDR_INFO lpcsaBuffer;
733 DWORD dwOutputFlags;
734 LPBLOB lpBlob;
735 } WSAQUERYSETA,*PWSAQUERYSETA,*LPWSAQUERYSETA;
736
737 typedef struct _WSAQuerySetW {
738 DWORD dwSize;
739 LPWSTR lpszServiceInstanceName;
740 LPGUID lpServiceClassId;
741 LPWSAVERSION lpVersion;
742 LPWSTR lpszComment;
743 DWORD dwNameSpace;
744 LPGUID lpNSProviderId;
745 LPWSTR lpszContext;
746 DWORD dwNumberOfProtocols;
747 LPAFPROTOCOLS lpafpProtocols;
748 LPWSTR lpszQueryString;
749 DWORD dwNumberOfCsAddrs;
750 LPCSADDR_INFO lpcsaBuffer;
751 DWORD dwOutputFlags;
752 LPBLOB lpBlob;
753 } WSAQUERYSETW,*PWSAQUERYSETW,*LPWSAQUERYSETW;
754
755 __MINGW_TYPEDEF_AW(WSAQUERYSET)
756 __MINGW_TYPEDEF_AW(PWSAQUERYSET)
757 __MINGW_TYPEDEF_AW(LPWSAQUERYSET)
758
759#define LUP_DEEP 0x0001
760#define LUP_CONTAINERS 0x0002
761#define LUP_NOCONTAINERS 0x0004
762#define LUP_NEAREST 0x0008
763#define LUP_RETURN_NAME 0x0010
764#define LUP_RETURN_TYPE 0x0020
765#define LUP_RETURN_VERSION 0x0040
766#define LUP_RETURN_COMMENT 0x0080
767#define LUP_RETURN_ADDR 0x0100
768#define LUP_RETURN_BLOB 0x0200
769#define LUP_RETURN_ALIASES 0x0400
770#define LUP_RETURN_QUERY_STRING 0x0800
771#define LUP_RETURN_ALL 0x0FF0
772#define LUP_RES_SERVICE 0x8000
773
774#define LUP_FLUSHCACHE 0x1000
775#define LUP_FLUSHPREVIOUS 0x2000
776
777#define LUP_NON_AUTHORITATIVE 0x4000
778#define LUP_SECURE 0x8000
779#define LUP_RETURN_PREFERRED_NAMES 0x10000
780#define LUP_DNS_ONLY 0x20000
781
782#define LUP_ADDRCONFIG 0x100000
783#define LUP_DUAL_ADDR 0x200000
784#define LUP_FILESERVER 0x400000
785#define LUP_DISABLE_IDN_ENCODING 0x00800000
786#define LUP_API_ANSI 0x01000000
787
788#define LUP_RESOLUTION_HANDLE 0x80000000
789
790#define LUP_RES_RESERVICE 0x8000 /* FIXME: not in PSDK anymore?? */
791
792#define RESULT_IS_ALIAS 0x0001
793#if(_WIN32_WINNT >= 0x0501)
794#define RESULT_IS_ADDED 0x0010
795#define RESULT_IS_CHANGED 0x0020
796#define RESULT_IS_DELETED 0x0040
797#endif
798
799 typedef enum _WSAESETSERVICEOP {
800 RNRSERVICE_REGISTER = 0,
801 RNRSERVICE_DEREGISTER,
802 RNRSERVICE_DELETE
803 } WSAESETSERVICEOP,*PWSAESETSERVICEOP,*LPWSAESETSERVICEOP;
804
805 typedef struct _WSANSClassInfoA {
806 LPSTR lpszName;
807 DWORD dwNameSpace;
808 DWORD dwValueType;
809 DWORD dwValueSize;
810 LPVOID lpValue;
811 } WSANSCLASSINFOA,*PWSANSCLASSINFOA,*LPWSANSCLASSINFOA;
812
813 typedef struct _WSANSClassInfoW {
814 LPWSTR lpszName;
815 DWORD dwNameSpace;
816 DWORD dwValueType;
817 DWORD dwValueSize;
818 LPVOID lpValue;
819 } WSANSCLASSINFOW,*PWSANSCLASSINFOW,*LPWSANSCLASSINFOW;
820
821 __MINGW_TYPEDEF_AW(WSANSCLASSINFO)
822 __MINGW_TYPEDEF_AW(PWSANSCLASSINFO)
823 __MINGW_TYPEDEF_AW(LPWSANSCLASSINFO)
824
825 typedef struct _WSAServiceClassInfoA {
826 LPGUID lpServiceClassId;
827 LPSTR lpszServiceClassName;
828 DWORD dwCount;
829 LPWSANSCLASSINFOA lpClassInfos;
830 } WSASERVICECLASSINFOA,*PWSASERVICECLASSINFOA,*LPWSASERVICECLASSINFOA;
831
832 typedef struct _WSAServiceClassInfoW {
833 LPGUID lpServiceClassId;
834 LPWSTR lpszServiceClassName;
835 DWORD dwCount;
836 LPWSANSCLASSINFOW lpClassInfos;
837 } WSASERVICECLASSINFOW,*PWSASERVICECLASSINFOW,*LPWSASERVICECLASSINFOW;
838
839 __MINGW_TYPEDEF_AW(WSASERVICECLASSINFO)
840 __MINGW_TYPEDEF_AW(PWSASERVICECLASSINFO)
841 __MINGW_TYPEDEF_AW(LPWSASERVICECLASSINFO)
842
843 typedef struct _WSANAMESPACE_INFOA {
844 GUID NSProviderId;
845 DWORD dwNameSpace;
846 WINBOOL fActive;
847 DWORD dwVersion;
848 LPSTR lpszIdentifier;
849 } WSANAMESPACE_INFOA,*PWSANAMESPACE_INFOA,*LPWSANAMESPACE_INFOA;
850
851 typedef struct _WSANAMESPACE_INFOW {
852 GUID NSProviderId;
853 DWORD dwNameSpace;
854 WINBOOL fActive;
855 DWORD dwVersion;
856 LPWSTR lpszIdentifier;
857 } WSANAMESPACE_INFOW,*PWSANAMESPACE_INFOW,*LPWSANAMESPACE_INFOW;
858
859 __MINGW_TYPEDEF_AW(WSANAMESPACE_INFO)
860 __MINGW_TYPEDEF_AW(PWSANAMESPACE_INFO)
861 __MINGW_TYPEDEF_AW(LPWSANAMESPACE_INFO)
862
863/* FIXME: WSAMSG originally lived in mswsock.h,
864 * newer SDKs moved it into a new ws2def.h. for
865 * now we keep it here. */
866 typedef struct _WSAMSG {
867 LPSOCKADDR name;
868 INT namelen;
869 LPWSABUF lpBuffers;
870 DWORD dwBufferCount;
871 WSABUF Control;
872 DWORD dwFlags;
873 } WSAMSG,*PWSAMSG,*LPWSAMSG;
874
875#if INCL_WINSOCK_API_TYPEDEFS
876#define LPFN_WSADUPLICATESOCKET __MINGW_NAME_AW(LPFN_WSADUPLICATESOCKET)
877#define LPFN_WSAENUMPROTOCOLS __MINGW_NAME_AW(LPFN_WSAENUMPROTOCOLS)
878#define LPFN_WSASOCKET __MINGW_NAME_AW(LPFN_WSASOCKET)
879#define LPFN_WSAADDRESSTOSTRING __MINGW_NAME_AW(LPFN_WSAADDRESSTOSTRING)
880#define LPFN_WSASTRINGTOADDRESS __MINGW_NAME_AW(LPFN_WSASTRINGTOADDRESS)
881#define LPFN_WSALOOKUPSERVICEBEGIN __MINGW_NAME_AW(LPFN_WSALOOKUPSERVICEBEGIN)
882#define LPFN_WSALOOKUPSERVICENEXT __MINGW_NAME_AW(LPFN_WSALOOKUPSERVICENEXT)
883#define LPFN_WSAINSTALLSERVICECLASS __MINGW_NAME_AW(LPFN_WSAINSTALLSERVICECLASS)
884#define LPFN_WSAGETSERVICECLASSINFO __MINGW_NAME_AW(LPFN_WSAGETSERVICECLASSINFO)
885#define LPFN_WSAENUMNAMESPACEPROVIDERS __MINGW_NAME_AW(LPFN_WSAENUMNAMESPACEPROVIDERS)
886#define LPFN_WSAGETSERVICECLASSNAMEBYCLASSID __MINGW_NAME_AW(LPFN_WSAGETSERVICECLASSNAMEBYCLASSID)
887#define LPFN_WSASETSERVICE __MINGW_NAME_AW(LPFN_WSASETSERVICE)
888
889 typedef SOCKET (WSAAPI *LPFN_ACCEPT)(SOCKET s,struct sockaddr *addr,int *addrlen);
890 typedef int (WSAAPI *LPFN_BIND)(SOCKET s,const struct sockaddr *name,int namelen);
891 typedef int (WSAAPI *LPFN_CLOSESOCKET)(SOCKET s);
892 typedef int (WSAAPI *LPFN_CONNECT)(SOCKET s,const struct sockaddr *name,int namelen);
893 typedef int (WSAAPI *LPFN_IOCTLSOCKET)(SOCKET s,__LONG32 cmd,u_long *argp);
894 typedef int (WSAAPI *LPFN_GETPEERNAME)(SOCKET s,struct sockaddr *name,int *namelen);
895 typedef int (WSAAPI *LPFN_GETSOCKNAME)(SOCKET s,struct sockaddr *name,int *namelen);
896 typedef int (WSAAPI *LPFN_GETSOCKOPT)(SOCKET s,int level,int optname,char *optval,int *optlen);
897 typedef u_long (WSAAPI *LPFN_HTONL)(u_long hostlong);
898 typedef u_short (WSAAPI *LPFN_HTONS)(u_short hostshort);
899 typedef unsigned __LONG32 (WSAAPI *LPFN_INET_ADDR)(const char *cp);
900 typedef char *(WSAAPI *LPFN_INET_NTOA)(struct in_addr in);
901 typedef int (WSAAPI *LPFN_LISTEN)(SOCKET s,int backlog);
902 typedef u_long (WSAAPI *LPFN_NTOHL)(u_long netlong);
903 typedef u_short (WSAAPI *LPFN_NTOHS)(u_short netshort);
904 typedef int (WSAAPI *LPFN_RECV)(SOCKET s,char *buf,int len,int flags);
905 typedef int (WSAAPI *LPFN_RECVFROM)(SOCKET s,char *buf,int len,int flags,struct sockaddr *from,int *fromlen);
906 typedef int (WSAAPI *LPFN_SELECT)(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,const PTIMEVAL timeout);
907 typedef int (WSAAPI *LPFN_SEND)(SOCKET s,const char *buf,int len,int flags);
908 typedef int (WSAAPI *LPFN_SENDTO)(SOCKET s,const char *buf,int len,int flags,const struct sockaddr *to,int tolen);
909 typedef int (WSAAPI *LPFN_SETSOCKOPT)(SOCKET s,int level,int optname,const char *optval,int optlen);
910 typedef int (WSAAPI *LPFN_SHUTDOWN)(SOCKET s,int how);
911 typedef SOCKET (WSAAPI *LPFN_SOCKET)(int af,int type,int protocol);
912 typedef struct hostent *(WSAAPI *LPFN_GETHOSTBYADDR)(const char *addr,int len,int type);
913 typedef struct hostent *(WSAAPI *LPFN_GETHOSTBYNAME)(const char *name);
914 typedef int (WSAAPI *LPFN_GETHOSTNAME)(char *name,int namelen);
915 typedef struct servent *(WSAAPI *LPFN_GETSERVBYPORT)(int port,const char *proto);
916 typedef struct servent *(WSAAPI *LPFN_GETSERVBYNAME)(const char *name,const char *proto);
917 typedef struct protoent *(WSAAPI *LPFN_GETPROTOBYNUMBER)(int number);
918 typedef struct protoent *(WSAAPI *LPFN_GETPROTOBYNAME)(const char *name);
919 typedef int (WSAAPI *LPFN_WSASTARTUP)(WORD wVersionRequested,LPWSADATA lpWSAData);
920 typedef int (WSAAPI *LPFN_WSACLEANUP)(void);
921 typedef void (WSAAPI *LPFN_WSASETLASTERROR)(int iError);
922 typedef int (WSAAPI *LPFN_WSAGETLASTERROR)(void);
923 typedef WINBOOL (WSAAPI *LPFN_WSAISBLOCKING)(void);
924 typedef int (WSAAPI *LPFN_WSAUNHOOKBLOCKINGHOOK)(void);
925 typedef FARPROC (WSAAPI *LPFN_WSASETBLOCKINGHOOK)(FARPROC lpBlockFunc);
926 typedef int (WSAAPI *LPFN_WSACANCELBLOCKINGCALL)(void);
927 typedef HANDLE (WSAAPI *LPFN_WSAASYNCGETSERVBYNAME)(HWND hWnd,u_int wMsg,const char *name,const char *proto,char *buf,int buflen);
928 typedef HANDLE (WSAAPI *LPFN_WSAASYNCGETSERVBYPORT)(HWND hWnd,u_int wMsg,int port,const char *proto,char *buf,int buflen);
929 typedef HANDLE (WSAAPI *LPFN_WSAASYNCGETPROTOBYNAME)(HWND hWnd,u_int wMsg,const char *name,char *buf,int buflen);
930 typedef HANDLE (WSAAPI *LPFN_WSAASYNCGETPROTOBYNUMBER)(HWND hWnd,u_int wMsg,int number,char *buf,int buflen);
931 typedef HANDLE (WSAAPI *LPFN_WSAASYNCGETHOSTBYNAME)(HWND hWnd,u_int wMsg,const char *name,char *buf,int buflen);
932 typedef HANDLE (WSAAPI *LPFN_WSAASYNCGETHOSTBYADDR)(HWND hWnd,u_int wMsg,const char *addr,int len,int type,char *buf,int buflen);
933 typedef int (WSAAPI *LPFN_WSACANCELASYNCREQUEST)(HANDLE hAsyncTaskHandle);
934 typedef int (WSAAPI *LPFN_WSAASYNCSELECT)(SOCKET s,HWND hWnd,u_int wMsg,__LONG32 lEvent);
935 typedef SOCKET (WSAAPI *LPFN_WSAACCEPT)(SOCKET s,struct sockaddr *addr,LPINT addrlen,LPCONDITIONPROC lpfnCondition,DWORD_PTR dwCallbackData);
936 typedef WINBOOL (WSAAPI *LPFN_WSACLOSEEVENT)(WSAEVENT hEvent);
937 typedef int (WSAAPI *LPFN_WSACONNECT)(SOCKET s,const struct sockaddr *name,int namelen,LPWSABUF lpCallerData,LPWSABUF lpCalleeData,LPQOS lpSQOS,LPQOS lpGQOS);
938 typedef WSAEVENT (WSAAPI *LPFN_WSACREATEEVENT)(void);
939 typedef int (WSAAPI *LPFN_WSADUPLICATESOCKETA)(SOCKET s,DWORD dwProcessId,LPWSAPROTOCOL_INFOA lpProtocolInfo);
940 typedef int (WSAAPI *LPFN_WSADUPLICATESOCKETW)(SOCKET s,DWORD dwProcessId,LPWSAPROTOCOL_INFOW lpProtocolInfo);
941 typedef int (WSAAPI *LPFN_WSAENUMNETWORKEVENTS)(SOCKET s,WSAEVENT hEventObject,LPWSANETWORKEVENTS lpNetworkEvents);
942 typedef int (WSAAPI *LPFN_WSAENUMPROTOCOLSA)(LPINT lpiProtocols,LPWSAPROTOCOL_INFOA lpProtocolBuffer,LPDWORD lpdwBufferLength);
943 typedef int (WSAAPI *LPFN_WSAENUMPROTOCOLSW)(LPINT lpiProtocols,LPWSAPROTOCOL_INFOW lpProtocolBuffer,LPDWORD lpdwBufferLength);
944 typedef int (WSAAPI *LPFN_WSAEVENTSELECT)(SOCKET s,WSAEVENT hEventObject,__LONG32 lNetworkEvents);
945 typedef WINBOOL (WSAAPI *LPFN_WSAGETOVERLAPPEDRESULT)(SOCKET s,LPWSAOVERLAPPED lpOverlapped,LPDWORD lpcbTransfer,WINBOOL fWait,LPDWORD lpdwFlags);
946 typedef WINBOOL (WSAAPI *LPFN_WSAGETQOSBYNAME)(SOCKET s,LPWSABUF lpQOSName,LPQOS lpQOS);
947 typedef int (WSAAPI *LPFN_WSAHTONL)(SOCKET s,u_long hostlong,u_long *lpnetlong);
948 typedef int (WSAAPI *LPFN_WSAHTONS)(SOCKET s,u_short hostshort,u_short *lpnetshort);
949 typedef int (WSAAPI *LPFN_WSAIOCTL)(SOCKET s,DWORD dwIoControlCode,LPVOID lpvInBuffer,DWORD cbInBuffer,LPVOID lpvOutBuffer,DWORD cbOutBuffer,LPDWORD lpcbBytesReturned,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
950 typedef SOCKET (WSAAPI *LPFN_WSAJOINLEAF)(SOCKET s,const struct sockaddr *name,int namelen,LPWSABUF lpCallerData,LPWSABUF lpCalleeData,LPQOS lpSQOS,LPQOS lpGQOS,DWORD dwFlags);
951 typedef int (WSAAPI *LPFN_WSANTOHL)(SOCKET s,u_long netlong,u_long *lphostlong);
952 typedef int (WSAAPI *LPFN_WSANTOHS)(SOCKET s,u_short netshort,u_short *lphostshort);
953 typedef int (WSAAPI *LPFN_WSARECV)(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesRecvd,LPDWORD lpFlags,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
954 typedef int (WSAAPI *LPFN_WSARECVDISCONNECT)(SOCKET s,LPWSABUF lpInboundDisconnectData);
955 typedef int (WSAAPI *LPFN_WSARECVFROM)(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesRecvd,LPDWORD lpFlags,struct sockaddr *lpFrom,LPINT lpFromlen,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
956 typedef WINBOOL (WSAAPI *LPFN_WSARESETEVENT)(WSAEVENT hEvent);
957 typedef int (WSAAPI *LPFN_WSASEND)(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesSent,DWORD dwFlags,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
958 typedef int (WSAAPI *LPFN_WSASENDDISCONNECT)(SOCKET s,LPWSABUF lpOutboundDisconnectData);
959 typedef int (WSAAPI *LPFN_WSASENDTO)(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesSent,DWORD dwFlags,const struct sockaddr *lpTo,int iTolen,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
960 typedef WINBOOL (WSAAPI *LPFN_WSASETEVENT)(WSAEVENT hEvent);
961 typedef SOCKET (WSAAPI *LPFN_WSASOCKETA)(int af,int type,int protocol,LPWSAPROTOCOL_INFOA lpProtocolInfo,GROUP g,DWORD dwFlags);
962 typedef SOCKET (WSAAPI *LPFN_WSASOCKETW)(int af,int type,int protocol,LPWSAPROTOCOL_INFOW lpProtocolInfo,GROUP g,DWORD dwFlags);
963 typedef DWORD (WSAAPI *LPFN_WSAWAITFORMULTIPLEEVENTS)(DWORD cEvents,const WSAEVENT *lphEvents,WINBOOL fWaitAll,DWORD dwTimeout,WINBOOL fAlertable);
964 typedef INT (WSAAPI *LPFN_WSAADDRESSTOSTRINGA)(LPSOCKADDR lpsaAddress,DWORD dwAddressLength,LPWSAPROTOCOL_INFOA lpProtocolInfo,LPSTR lpszAddressString,LPDWORD lpdwAddressStringLength);
965 typedef INT (WSAAPI *LPFN_WSAADDRESSTOSTRINGW)(LPSOCKADDR lpsaAddress,DWORD dwAddressLength,LPWSAPROTOCOL_INFOW lpProtocolInfo,LPWSTR lpszAddressString,LPDWORD lpdwAddressStringLength);
966 typedef INT (WSAAPI *LPFN_WSASTRINGTOADDRESSA)(LPSTR AddressString,INT AddressFamily,LPWSAPROTOCOL_INFOA lpProtocolInfo,LPSOCKADDR lpAddress,LPINT lpAddressLength);
967 typedef INT (WSAAPI *LPFN_WSASTRINGTOADDRESSW)(LPWSTR AddressString,INT AddressFamily,LPWSAPROTOCOL_INFOW lpProtocolInfo,LPSOCKADDR lpAddress,LPINT lpAddressLength);
968 typedef INT (WSAAPI *LPFN_WSALOOKUPSERVICEBEGINA)(LPWSAQUERYSETA lpqsRestrictions,DWORD dwControlFlags,LPHANDLE lphLookup);
969 typedef INT (WSAAPI *LPFN_WSALOOKUPSERVICEBEGINW)(LPWSAQUERYSETW lpqsRestrictions,DWORD dwControlFlags,LPHANDLE lphLookup);
970 typedef INT (WSAAPI *LPFN_WSALOOKUPSERVICENEXTA)(HANDLE hLookup,DWORD dwControlFlags,LPDWORD lpdwBufferLength,LPWSAQUERYSETA lpqsResults);
971 typedef INT (WSAAPI *LPFN_WSALOOKUPSERVICENEXTW)(HANDLE hLookup,DWORD dwControlFlags,LPDWORD lpdwBufferLength,LPWSAQUERYSETW lpqsResults);
972 typedef INT (WSAAPI *LPFN_WSANSPIOCTL)(HANDLE hLookup,DWORD dwControlCode,LPVOID lpvInBuffer,DWORD cbInBuffer,LPVOID lpvOutBuffer,DWORD cbOutBuffer,LPDWORD lpcbBytesReturned,LPWSACOMPLETION lpCompletion);
973 typedef INT (WSAAPI *LPFN_WSALOOKUPSERVICEEND)(HANDLE hLookup);
974 typedef INT (WSAAPI *LPFN_WSAINSTALLSERVICECLASSA)(LPWSASERVICECLASSINFOA lpServiceClassInfo);
975 typedef INT (WSAAPI *LPFN_WSAINSTALLSERVICECLASSW)(LPWSASERVICECLASSINFOW lpServiceClassInfo);
976 typedef INT (WSAAPI *LPFN_WSAREMOVESERVICECLASS)(LPGUID lpServiceClassId);
977 typedef INT (WSAAPI *LPFN_WSAGETSERVICECLASSINFOA)(LPGUID lpProviderId,LPGUID lpServiceClassId,LPDWORD lpdwBufSize,LPWSASERVICECLASSINFOA lpServiceClassInfo);
978 typedef INT (WSAAPI *LPFN_WSAGETSERVICECLASSINFOW)(LPGUID lpProviderId,LPGUID lpServiceClassId,LPDWORD lpdwBufSize,LPWSASERVICECLASSINFOW lpServiceClassInfo);
979 typedef INT (WSAAPI *LPFN_WSAENUMNAMESPACEPROVIDERSA)(LPDWORD lpdwBufferLength,LPWSANAMESPACE_INFOA lpnspBuffer);
980 typedef INT (WSAAPI *LPFN_WSAENUMNAMESPACEPROVIDERSW)(LPDWORD lpdwBufferLength,LPWSANAMESPACE_INFOW lpnspBuffer);
981 typedef INT (WSAAPI *LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA)(LPGUID lpServiceClassId,LPSTR lpszServiceClassName,LPDWORD lpdwBufferLength);
982 typedef INT (WSAAPI *LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW)(LPGUID lpServiceClassId,LPWSTR lpszServiceClassName,LPDWORD lpdwBufferLength);
983 typedef INT (WSAAPI *LPFN_WSASETSERVICEA)(LPWSAQUERYSETA lpqsRegInfo,WSAESETSERVICEOP essoperation,DWORD dwControlFlags);
984 typedef INT (WSAAPI *LPFN_WSASETSERVICEW)(LPWSAQUERYSETW lpqsRegInfo,WSAESETSERVICEOP essoperation,DWORD dwControlFlags);
985 typedef INT (WSAAPI *LPFN_WSAPROVIDERCONFIGCHANGE)(LPHANDLE lpNotificationHandle,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
986#endif
987
988#define WSADuplicateSocket __MINGW_NAME_AW(WSADuplicateSocket)
989#define WSAEnumProtocols __MINGW_NAME_AW(WSAEnumProtocols)
990#define WSAAddressToString __MINGW_NAME_AW(WSAAddressToString)
991#define WSASocket __MINGW_NAME_AW(WSASocket)
992#define WSAStringToAddress __MINGW_NAME_AW(WSAStringToAddress)
993#define WSALookupServiceBegin __MINGW_NAME_AW(WSALookupServiceBegin)
994#define WSALookupServiceNext __MINGW_NAME_AW(WSALookupServiceNext)
995#define WSAInstallServiceClass __MINGW_NAME_AW(WSAInstallServiceClass)
996#define WSAGetServiceClassInfo __MINGW_NAME_AW(WSAGetServiceClassInfo)
997#define WSAEnumNameSpaceProviders __MINGW_NAME_AW(WSAEnumNameSpaceProviders)
998#define WSAGetServiceClassNameByClassId __MINGW_NAME_AW(WSAGetServiceClassNameByClassId)
999#define WSASetService __MINGW_NAME_AW(WSASetService)
1000
1001#ifndef __WINSOCK_WS1_SHARED
1002/* these 46 functions have the same prototypes as in winsock2 */
1003 WINSOCK_API_LINKAGE SOCKET WSAAPI accept(SOCKET s,struct sockaddr *addr,int *addrlen);
1004 WINSOCK_API_LINKAGE int WSAAPI bind(SOCKET s,const struct sockaddr *name,int namelen);
1005 WINSOCK_API_LINKAGE int WSAAPI closesocket(SOCKET s);
1006 WINSOCK_API_LINKAGE int WSAAPI connect(SOCKET s,const struct sockaddr *name,int namelen);
1007 WINSOCK_API_LINKAGE int WSAAPI ioctlsocket(SOCKET s,__LONG32 cmd,u_long *argp);
1008 WINSOCK_API_LINKAGE int WSAAPI getpeername(SOCKET s,struct sockaddr *name,int *namelen);
1009 WINSOCK_API_LINKAGE int WSAAPI getsockname(SOCKET s,struct sockaddr *name,int *namelen);
1010 WINSOCK_API_LINKAGE int WSAAPI getsockopt(SOCKET s,int level,int optname,char *optval,int *optlen);
1011#ifndef __INSIDE_CYGWIN__
1012 WINSOCK_API_LINKAGE u_long WSAAPI htonl(u_long hostlong);
1013 WINSOCK_API_LINKAGE u_short WSAAPI htons(u_short hostshort);
1014#endif /* !__INSIDE_CYGWIN__ */
1015 WINSOCK_API_LINKAGE unsigned __LONG32 WSAAPI inet_addr(const char *cp);
1016 WINSOCK_API_LINKAGE char *WSAAPI inet_ntoa(struct in_addr in);
1017 WINSOCK_API_LINKAGE int WSAAPI listen(SOCKET s,int backlog);
1018#ifndef __INSIDE_CYGWIN__
1019 WINSOCK_API_LINKAGE u_long WSAAPI ntohl(u_long netlong);
1020 WINSOCK_API_LINKAGE u_short WSAAPI ntohs(u_short netshort);
1021#endif /* !__INSIDE_CYGWIN__ */
1022 WINSOCK_API_LINKAGE int WSAAPI recv(SOCKET s,char *buf,int len,int flags);
1023 WINSOCK_API_LINKAGE int WSAAPI recvfrom(SOCKET s,char *buf,int len,int flags,struct sockaddr *from,int *fromlen);
1024#ifndef __INSIDE_CYGWIN__
1025 WINSOCK_API_LINKAGE int WSAAPI select(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,const PTIMEVAL timeout);
1026#endif /* !__INSIDE_CYGWIN__ */
1027 WINSOCK_API_LINKAGE int WSAAPI send(SOCKET s,const char *buf,int len,int flags);
1028 WINSOCK_API_LINKAGE int WSAAPI sendto(SOCKET s,const char *buf,int len,int flags,const struct sockaddr *to,int tolen);
1029 WINSOCK_API_LINKAGE int WSAAPI setsockopt(SOCKET s,int level,int optname,const char *optval,int optlen);
1030 WINSOCK_API_LINKAGE int WSAAPI shutdown(SOCKET s,int how);
1031 WINSOCK_API_LINKAGE SOCKET WSAAPI socket(int af,int type,int protocol);
1032 WINSOCK_API_LINKAGE struct hostent *WSAAPI gethostbyaddr(const char *addr,int len,int type);
1033 WINSOCK_API_LINKAGE struct hostent *WSAAPI gethostbyname(const char *name);
1034 WINSOCK_API_LINKAGE int WSAAPI gethostname(char *name,int namelen);
1035 WINSOCK_API_LINKAGE int WSAAPI GetHostNameW(PWSTR name, int namelen);
1036 WINSOCK_API_LINKAGE struct servent *WSAAPI getservbyport(int port,const char *proto);
1037 WINSOCK_API_LINKAGE struct servent *WSAAPI getservbyname(const char *name,const char *proto);
1038 WINSOCK_API_LINKAGE struct protoent *WSAAPI getprotobynumber(int number);
1039 WINSOCK_API_LINKAGE struct protoent *WSAAPI getprotobyname(const char *name);
1040 WINSOCK_API_LINKAGE int WSAAPI WSAStartup(WORD wVersionRequested,LPWSADATA lpWSAData);
1041 WINSOCK_API_LINKAGE int WSAAPI WSACleanup(void);
1042 WINSOCK_API_LINKAGE void WSAAPI WSASetLastError(int iError);
1043 WINSOCK_API_LINKAGE int WSAAPI WSAGetLastError(void);
1044 WINSOCK_API_LINKAGE WINBOOL WSAAPI WSAIsBlocking(void);
1045 WINSOCK_API_LINKAGE int WSAAPI WSAUnhookBlockingHook(void);
1046 WINSOCK_API_LINKAGE FARPROC WSAAPI WSASetBlockingHook(FARPROC lpBlockFunc);
1047 WINSOCK_API_LINKAGE int WSAAPI WSACancelBlockingCall(void);
1048 WINSOCK_API_LINKAGE HANDLE WSAAPI WSAAsyncGetServByName(HWND hWnd,u_int wMsg,const char *name,const char *proto,char *buf,int buflen);
1049 WINSOCK_API_LINKAGE HANDLE WSAAPI WSAAsyncGetServByPort(HWND hWnd,u_int wMsg,int port,const char *proto,char *buf,int buflen);
1050 WINSOCK_API_LINKAGE HANDLE WSAAPI WSAAsyncGetProtoByName(HWND hWnd,u_int wMsg,const char *name,char *buf,int buflen);
1051 WINSOCK_API_LINKAGE HANDLE WSAAPI WSAAsyncGetProtoByNumber(HWND hWnd,u_int wMsg,int number,char *buf,int buflen);
1052 WINSOCK_API_LINKAGE HANDLE WSAAPI WSAAsyncGetHostByName(HWND hWnd,u_int wMsg,const char *name,char *buf,int buflen);
1053 WINSOCK_API_LINKAGE HANDLE WSAAPI WSAAsyncGetHostByAddr(HWND hWnd,u_int wMsg,const char *addr,int len,int type,char *buf,int buflen);
1054 WINSOCK_API_LINKAGE int WSAAPI WSACancelAsyncRequest(HANDLE hAsyncTaskHandle);
1055 WINSOCK_API_LINKAGE int WSAAPI WSAAsyncSelect(SOCKET s,HWND hWnd,u_int wMsg,__LONG32 lEvent);
1056#endif /* __WINSOCK_WS1_SHARED */
1057 WINSOCK_API_LINKAGE SOCKET WSAAPI WSAAccept(SOCKET s,struct sockaddr *addr,LPINT addrlen,LPCONDITIONPROC lpfnCondition,DWORD_PTR dwCallbackData);
1058 WINSOCK_API_LINKAGE WINBOOL WSAAPI WSACloseEvent(WSAEVENT hEvent);
1059 WINSOCK_API_LINKAGE int WSAAPI WSAConnect(SOCKET s,const struct sockaddr *name,int namelen,LPWSABUF lpCallerData,LPWSABUF lpCalleeData,LPQOS lpSQOS,LPQOS lpGQOS);
1060 WINSOCK_API_LINKAGE WSAEVENT WSAAPI WSACreateEvent(void);
1061 WINSOCK_API_LINKAGE int WSAAPI WSADuplicateSocketA(SOCKET s,DWORD dwProcessId,LPWSAPROTOCOL_INFOA lpProtocolInfo);
1062 WINSOCK_API_LINKAGE int WSAAPI WSADuplicateSocketW(SOCKET s,DWORD dwProcessId,LPWSAPROTOCOL_INFOW lpProtocolInfo);
1063 WINSOCK_API_LINKAGE int WSAAPI WSAEnumNetworkEvents(SOCKET s,WSAEVENT hEventObject,LPWSANETWORKEVENTS lpNetworkEvents);
1064 WINSOCK_API_LINKAGE int WSAAPI WSAEnumProtocolsA(LPINT lpiProtocols,LPWSAPROTOCOL_INFOA lpProtocolBuffer,LPDWORD lpdwBufferLength);
1065 WINSOCK_API_LINKAGE int WSAAPI WSAEnumProtocolsW(LPINT lpiProtocols,LPWSAPROTOCOL_INFOW lpProtocolBuffer,LPDWORD lpdwBufferLength);
1066 WINSOCK_API_LINKAGE int WSAAPI WSAEventSelect(SOCKET s,WSAEVENT hEventObject,__LONG32 lNetworkEvents);
1067 WINSOCK_API_LINKAGE WINBOOL WSAAPI WSAGetOverlappedResult(SOCKET s,LPWSAOVERLAPPED lpOverlapped,LPDWORD lpcbTransfer,WINBOOL fWait,LPDWORD lpdwFlags);
1068 WINSOCK_API_LINKAGE WINBOOL WSAAPI WSAGetQOSByName(SOCKET s,LPWSABUF lpQOSName,LPQOS lpQOS);
1069 WINSOCK_API_LINKAGE int WSAAPI WSAHtonl(SOCKET s,u_long hostlong,u_long *lpnetlong);
1070 WINSOCK_API_LINKAGE int WSAAPI WSAHtons(SOCKET s,u_short hostshort,u_short *lpnetshort);
1071 WINSOCK_API_LINKAGE int WSAAPI WSAIoctl(SOCKET s,DWORD dwIoControlCode,LPVOID lpvInBuffer,DWORD cbInBuffer,LPVOID lpvOutBuffer,DWORD cbOutBuffer,LPDWORD lpcbBytesReturned,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
1072 WINSOCK_API_LINKAGE SOCKET WSAAPI WSAJoinLeaf(SOCKET s,const struct sockaddr *name,int namelen,LPWSABUF lpCallerData,LPWSABUF lpCalleeData,LPQOS lpSQOS,LPQOS lpGQOS,DWORD dwFlags);
1073 WINSOCK_API_LINKAGE int WSAAPI WSANtohl(SOCKET s,u_long netlong,u_long *lphostlong);
1074 WINSOCK_API_LINKAGE int WSAAPI WSANtohs(SOCKET s,u_short netshort,u_short *lphostshort);
1075 WINSOCK_API_LINKAGE int WSAAPI WSARecv(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesRecvd,LPDWORD lpFlags,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
1076 WINSOCK_API_LINKAGE int WSAAPI WSARecvDisconnect(SOCKET s,LPWSABUF lpInboundDisconnectData);
1077 WINSOCK_API_LINKAGE int WSAAPI WSARecvFrom(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesRecvd,LPDWORD lpFlags,struct sockaddr *lpFrom,LPINT lpFromlen,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
1078 WINSOCK_API_LINKAGE WINBOOL WSAAPI WSAResetEvent(WSAEVENT hEvent);
1079 WINSOCK_API_LINKAGE int WSAAPI WSASend(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesSent,DWORD dwFlags,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
1080 WINSOCK_API_LINKAGE int WSAAPI WSASendDisconnect(SOCKET s,LPWSABUF lpOutboundDisconnectData);
1081 WINSOCK_API_LINKAGE int WSAAPI WSASendTo(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesSent,DWORD dwFlags,const struct sockaddr *lpTo,int iTolen,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
1082 WINSOCK_API_LINKAGE WINBOOL WSAAPI WSASetEvent(WSAEVENT hEvent);
1083 WINSOCK_API_LINKAGE SOCKET WSAAPI WSASocketA(int af,int type,int protocol,LPWSAPROTOCOL_INFOA lpProtocolInfo,GROUP g,DWORD dwFlags);
1084 WINSOCK_API_LINKAGE SOCKET WSAAPI WSASocketW(int af,int type,int protocol,LPWSAPROTOCOL_INFOW lpProtocolInfo,GROUP g,DWORD dwFlags);
1085 WINSOCK_API_LINKAGE DWORD WSAAPI WSAWaitForMultipleEvents(DWORD cEvents,const WSAEVENT *lphEvents,WINBOOL fWaitAll,DWORD dwTimeout,WINBOOL fAlertable);
1086 WINSOCK_API_LINKAGE INT WSAAPI WSAAddressToStringA(LPSOCKADDR lpsaAddress,DWORD dwAddressLength,LPWSAPROTOCOL_INFOA lpProtocolInfo,LPSTR lpszAddressString,LPDWORD lpdwAddressStringLength);
1087 WINSOCK_API_LINKAGE INT WSAAPI WSAAddressToStringW(LPSOCKADDR lpsaAddress,DWORD dwAddressLength,LPWSAPROTOCOL_INFOW lpProtocolInfo,LPWSTR lpszAddressString,LPDWORD lpdwAddressStringLength);
1088 WINSOCK_API_LINKAGE INT WSAAPI WSAStringToAddressA(LPSTR AddressString,INT AddressFamily,LPWSAPROTOCOL_INFOA lpProtocolInfo,LPSOCKADDR lpAddress,LPINT lpAddressLength);
1089 WINSOCK_API_LINKAGE INT WSAAPI WSAStringToAddressW(LPWSTR AddressString,INT AddressFamily,LPWSAPROTOCOL_INFOW lpProtocolInfo,LPSOCKADDR lpAddress,LPINT lpAddressLength);
1090 WINSOCK_API_LINKAGE INT WSAAPI WSALookupServiceBeginA(LPWSAQUERYSETA lpqsRestrictions,DWORD dwControlFlags,LPHANDLE lphLookup);
1091 WINSOCK_API_LINKAGE INT WSAAPI WSALookupServiceBeginW(LPWSAQUERYSETW lpqsRestrictions,DWORD dwControlFlags,LPHANDLE lphLookup);
1092 WINSOCK_API_LINKAGE INT WSAAPI WSALookupServiceNextA(HANDLE hLookup,DWORD dwControlFlags,LPDWORD lpdwBufferLength,LPWSAQUERYSETA lpqsResults);
1093 WINSOCK_API_LINKAGE INT WSAAPI WSALookupServiceNextW(HANDLE hLookup,DWORD dwControlFlags,LPDWORD lpdwBufferLength,LPWSAQUERYSETW lpqsResults);
1094 WINSOCK_API_LINKAGE INT WSAAPI WSANSPIoctl(HANDLE hLookup,DWORD dwControlCode,LPVOID lpvInBuffer,DWORD cbInBuffer,LPVOID lpvOutBuffer,DWORD cbOutBuffer,LPDWORD lpcbBytesReturned,LPWSACOMPLETION lpCompletion);
1095 WINSOCK_API_LINKAGE INT WSAAPI WSALookupServiceEnd(HANDLE hLookup);
1096 WINSOCK_API_LINKAGE INT WSAAPI WSAInstallServiceClassA(LPWSASERVICECLASSINFOA lpServiceClassInfo);
1097 WINSOCK_API_LINKAGE INT WSAAPI WSAInstallServiceClassW(LPWSASERVICECLASSINFOW lpServiceClassInfo);
1098 WINSOCK_API_LINKAGE INT WSAAPI WSARemoveServiceClass(LPGUID lpServiceClassId);
1099 WINSOCK_API_LINKAGE INT WSAAPI WSAGetServiceClassInfoA(LPGUID lpProviderId,LPGUID lpServiceClassId,LPDWORD lpdwBufSize,LPWSASERVICECLASSINFOA lpServiceClassInfo);
1100 WINSOCK_API_LINKAGE INT WSAAPI WSAGetServiceClassInfoW(LPGUID lpProviderId,LPGUID lpServiceClassId,LPDWORD lpdwBufSize,LPWSASERVICECLASSINFOW lpServiceClassInfo);
1101 WINSOCK_API_LINKAGE INT WSAAPI WSAEnumNameSpaceProvidersA(LPDWORD lpdwBufferLength,LPWSANAMESPACE_INFOA lpnspBuffer);
1102 WINSOCK_API_LINKAGE INT WSAAPI WSAEnumNameSpaceProvidersW(LPDWORD lpdwBufferLength,LPWSANAMESPACE_INFOW lpnspBuffer);
1103 WINSOCK_API_LINKAGE INT WSAAPI WSAGetServiceClassNameByClassIdA(LPGUID lpServiceClassId,LPSTR lpszServiceClassName,LPDWORD lpdwBufferLength);
1104 WINSOCK_API_LINKAGE INT WSAAPI WSAGetServiceClassNameByClassIdW(LPGUID lpServiceClassId,LPWSTR lpszServiceClassName,LPDWORD lpdwBufferLength);
1105 WINSOCK_API_LINKAGE INT WSAAPI WSASetServiceA(LPWSAQUERYSETA lpqsRegInfo,WSAESETSERVICEOP essoperation,DWORD dwControlFlags);
1106 WINSOCK_API_LINKAGE INT WSAAPI WSASetServiceW(LPWSAQUERYSETW lpqsRegInfo,WSAESETSERVICEOP essoperation,DWORD dwControlFlags);
1107 WINSOCK_API_LINKAGE INT WSAAPI WSAProviderConfigChange(LPHANDLE lpNotificationHandle,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
1108
1109#define WSAMAKEASYNCREPLY(buflen,error) MAKELONG(buflen,error)
1110#define WSAMAKESELECTREPLY(event,error) MAKELONG(event,error)
1111#define WSAGETASYNCBUFLEN(lParam) LOWORD(lParam)
1112#define WSAGETASYNCERROR(lParam) HIWORD(lParam)
1113#define WSAGETSELECTEVENT(lParam) LOWORD(lParam)
1114#define WSAGETSELECTERROR(lParam) HIWORD(lParam)
1115
1116#if (_WIN32_WINNT >= 0x0600)
1117typedef struct _WSANAMESPACE_INFOEXA {
1118 GUID NSProviderId;
1119 DWORD dwNameSpace;
1120 WINBOOL fActive;
1121 DWORD dwVersion;
1122 LPSTR lpszIdentifier;
1123 BLOB ProviderSpecific;
1124} WSANAMESPACE_INFOEXA, *PWSANAMESPACE_INFOEXA, *LPWSANAMESPACE_INFOEXA;
1125
1126typedef struct _WSANAMESPACE_INFOEXW {
1127 GUID NSProviderId;
1128 DWORD dwNameSpace;
1129 WINBOOL fActive;
1130 DWORD dwVersion;
1131 LPWSTR lpszIdentifier;
1132 BLOB ProviderSpecific;
1133} WSANAMESPACE_INFOEXW, *PWSANAMESPACE_INFOEXW, *LPWSANAMESPACE_INFOEXW;
1134
1135__MINGW_TYPEDEF_AW(WSANAMESPACE_INFOEX)
1136__MINGW_TYPEDEF_AW(PWSANAMESPACE_INFOEX)
1137__MINGW_TYPEDEF_AW(LPWSANAMESPACE_INFOEX)
1138
1139typedef struct _WSAQUERYSET2A {
1140 DWORD dwSize;
1141 LPSTR lpszServiceInstanceName;
1142 LPWSAVERSION lpVersion;
1143 LPSTR lpszComment;
1144 DWORD dwNameSpace;
1145 LPGUID lpNSProviderId;
1146 LPSTR lpszContext;
1147 DWORD dwNumberOfProtocols;
1148 LPAFPROTOCOLS lpafpProtocols;
1149 LPSTR lpszQueryString;
1150 DWORD dwNumberOfCsAddrs;
1151 LPCSADDR_INFO lpcsaBuffer;
1152 DWORD dwOutputFlags;
1153 LPBLOB lpBlob;
1154} WSAQUERYSET2A, *PWSAQUERYSET2A, *LPWSAQUERYSET2A;
1155
1156typedef struct _WSAQUERYSET2W {
1157 DWORD dwSize;
1158 LPWSTR lpszServiceInstanceName;
1159 LPWSAVERSION lpVersion;
1160 LPWSTR lpszComment;
1161 DWORD dwNameSpace;
1162 LPGUID lpNSProviderId;
1163 LPTSTR lpszContext;
1164 DWORD dwNumberOfProtocols;
1165 LPAFPROTOCOLS lpafpProtocols;
1166 LPWSTR lpszQueryString;
1167 DWORD dwNumberOfCsAddrs;
1168 LPCSADDR_INFO lpcsaBuffer;
1169 DWORD dwOutputFlags;
1170 LPBLOB lpBlob;
1171} WSAQUERYSET2W, *PWSAQUERYSET2W, *LPWSAQUERYSET2W;
1172
1173#define POLLRDNORM 0x0100
1174#define POLLRDBAND 0x0200
1175#define POLLIN (POLLRDNORM | POLLRDBAND)
1176#define POLLPRI 0x0400
1177
1178#define POLLWRNORM 0x0010
1179#define POLLOUT (POLLWRNORM)
1180#define POLLWRBAND 0x0020
1181
1182#define POLLERR 0x0001
1183#define POLLHUP 0x0002
1184#define POLLNVAL 0x0004
1185
1186typedef struct pollfd {
1187 SOCKET fd;
1188 short events;
1189 short revents;
1190} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
1191
1192WINSOCK_API_LINKAGE WINBOOL PASCAL WSAConnectByList(
1193 SOCKET s,
1194 PSOCKET_ADDRESS_LIST SocketAddressList,
1195 LPDWORD LocalAddressLength,
1196 LPSOCKADDR LocalAddress,
1197 LPDWORD RemoteAddressLength,
1198 LPSOCKADDR RemoteAddress,
1199 const PTIMEVAL timeout,
1200 LPWSAOVERLAPPED Reserved
1201);
1202
1203WINSOCK_API_LINKAGE WINBOOL PASCAL WSAConnectByNameA(
1204 SOCKET s,
1205 LPSTR nodename,
1206 LPSTR servicename,
1207 LPDWORD LocalAddressLength,
1208 LPSOCKADDR LocalAddress,
1209 LPDWORD RemoteAddressLength,
1210 LPSOCKADDR RemoteAddress,
1211 const PTIMEVAL timeout,
1212 LPWSAOVERLAPPED Reserved
1213);
1214
1215WINSOCK_API_LINKAGE WINBOOL PASCAL WSAConnectByNameW(
1216 SOCKET s,
1217 LPWSTR nodename,
1218 LPWSTR servicename,
1219 LPDWORD LocalAddressLength,
1220 LPSOCKADDR LocalAddress,
1221 LPDWORD RemoteAddressLength,
1222 LPSOCKADDR RemoteAddress,
1223 const PTIMEVAL timeout,
1224 LPWSAOVERLAPPED Reserved
1225);
1226#define WSAConnectByName __MINGW_NAME_AW(WSAConnectByName)
1227
1228INT WSAAPI WSAEnumNameSpaceProvidersExA(
1229 LPDWORD lpdwBufferLength,
1230 LPWSANAMESPACE_INFOEXA lpnspBuffer
1231);
1232
1233INT WSAAPI WSAEnumNameSpaceProvidersExW(
1234 LPDWORD lpdwBufferLength,
1235 LPWSANAMESPACE_INFOEXW lpnspBuffer
1236);
1237#define WSAEnumNameSpaceProvidersEx __MINGW_NAME_AW(WSAEnumNameSpaceProvidersEx)
1238
1239int WSAAPI WSAPoll(
1240 WSAPOLLFD fdarray[],
1241 ULONG nfds,
1242 INT timeout
1243);
1244
1245int WSAAPI WSASendMsg(
1246 SOCKET s,
1247 LPWSAMSG lpMsg,
1248 DWORD dwFlags,
1249 LPDWORD lpNumberOfBytesSent,
1250 LPWSAOVERLAPPED lpOverlapped,
1251 LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
1252);
1253#endif /*(_WIN32_WINNT >= 0x0600)*/
1254
1255#ifdef __cplusplus
1256}
1257#endif
1258
1259#ifdef _NEED_POPPACK
1260#include <poppack.h>
1261#endif
1262
1263#ifdef IPV6STRICT
1264#include <wsipv6ok.h>
1265#endif
1266
1267#ifdef __LP64__
1268#pragma pop_macro("u_long")
1269#endif
1270
1271#endif /* _WINSOCK2API_ */
Note: See TracBrowser for help on using the repository browser.