- Fix calculation of required buffer size.
[wine/multimedia.git] / include / winsock2.h
bloba14b19cc644e3c0f3e6b0ad9a9e8679f24de760d
1 /*
2 * Winsock 2 definitions - used for ws2_32.dll
4 * Copyright (C) 1999 Ove Kaaven
5 * Copyright (C) 2001 Francois Gouget
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * FIXME: Still missing required Winsock 2 definitions.
24 #ifndef _WINSOCK2API_
25 #define _WINSOCK2API_
28 * Setup phase
31 /* Everything common between winsock.h and winsock2.h */
32 #ifndef INCL_WINSOCK_API_PROTOTYPES
33 #define INCL_WINSOCK_API_PROTOTYPES 1
34 #define WS_API_PROTOTYPES 1
35 #else
36 #define WS_API_PROTOTYPES INCL_WINSOCK_API_PROTOTYPES
37 #endif
39 #ifndef INCL_WINSOCK_API_TYPEDEFS
40 #define INCL_WINSOCK_API_TYPEDEFS 0
41 #define WS_API_TYPEDEFS 0
42 #else
43 #define WS_API_TYPEDEFS INCL_WINSOCK_API_TYPEDEFS
44 #endif
46 #define __WINE_WINSOCK2__
47 #include <winsock.h>
48 #undef __WINE_WINSOCK2__
51 #ifdef __cplusplus
52 extern "C" {
53 #endif /* defined(__cplusplus) */
55 /* proper 4-byte packing */
56 #include <pshpack4.h>
59 #ifndef USE_WS_PREFIX
60 #define SO_GROUP_ID 0x2001
61 #define SO_GROUP_PRIORITY 0x2002
62 #define SO_MAX_MSG_SIZE 0x2003
63 #define SO_PROTOCOL_INFOA 0x2004
64 #define SO_PROTOCOL_INFOW 0x2005
65 #define SO_PROTOCOL_INFO WINELIB_NAME_AW(WS_SO_PROTOCOL_INFO)
66 #define PVD_CONFIG 0x3001
67 #define SO_CONDITIONAL_ACCEPT 0x3002
68 #else
69 #define WS_SO_GROUP_ID 0x2001
70 #define WS_SO_GROUP_PRIORITY 0x2002
71 #define WS_SO_MAX_MSG_SIZE 0x2003
72 #define WS_SO_PROTOCOL_INFOA 0x2004
73 #define WS_SO_PROTOCOL_INFOW 0x2005
74 #define WS_SO_PROTOCOL_INFO WINELIB_NAME_AW(WS_SO_PROTOCOL_INFO)
75 #define WS_PVD_CONFIG 0x3001
76 #define WS_SO_CONDITIONAL_ACCEPT 0x3002
77 #endif
79 /* protocol types */
81 #ifndef USE_WS_PREFIX
82 #define SOCK_STREAM 1
83 #define SOCK_DGRAM 2
84 #define SOCK_RAW 3
85 #define SOCK_RDM 4
86 #define SOCK_SEQPACKET 5
87 #else /* USE_WS_PREFIX */
88 #define WS_SOCK_STREAM 1
89 #define WS_SOCK_DGRAM 2
90 #define WS_SOCK_RAW 3
91 #define WS_SOCK_RDM 4
92 #define WS_SOCK_SEQPACKET 5
93 #endif /* USE_WS_PREFIX */
95 /* option flags per socket */
97 #define FD_MAX_EVENTS 10
98 #define FD_READ_BIT 0
99 #define FD_WRITE_BIT 1
100 #define FD_OOB_BIT 2
101 #define FD_ACCEPT_BIT 3
102 #define FD_CONNECT_BIT 4
103 #define FD_CLOSE_BIT 5
105 /* Constants for LPCONDITIONPROC */
106 #define CF_ACCEPT 0x0000
107 #define CF_REJECT 0x0001
108 #define CF_DEFER 0x0002
110 /* Constants for shutdown() */
111 #define SD_RECEIVE 0x00
112 #define SD_SEND 0x01
113 #define SD_BOTH 0x02
115 /* Constants for WSAIoctl() */
116 #define IOC_UNIX 0x00000000
117 #define IOC_WS2 0x08000000
118 #define IOC_PROTOCOL 0x10000000
119 #define IOC_VENDOR 0x18000000
120 #define IOC_VOID 0x20000000
121 #define _WSAIO(x,y) (IOC_VOID|(x)|(y))
122 #define _WSAIOR(x,y) (IOC_OUT|(x)|(y))
123 #define _WSAIOW(x,y) (IOC_IN|(x)|(y))
124 #define _WSAIORW(x,y) (IOC_INOUT|(x)|(y))
125 #define SIO_ASSOCIATE_HANDLE _WSAIOW(IOC_WS2,1)
126 #define SIO_ENABLE_CIRCULAR_QUEUEING _WSAIO(IOC_WS2,2)
127 #define SIO_FIND_ROUTE _WSAIOR(IOC_WS2,3)
128 #define SIO_FLUSH _WSAIO(IOC_WS2,4)
129 #define SIO_GET_BROADCAST_ADDRESS _WSAIOR(IOC_WS2,5)
130 #define SIO_GET_EXTENSION_FUNCTION_POINTER _WSAIORW(IOC_WS2,6)
131 #define SIO_GET_QOS _WSAIORW(IOC_WS2,7)
132 #define SIO_GET_GROUP_QOS _WSAIORW(IOC_WS2,8)
133 #define SIO_MULTIPOINT_LOOPBACK _WSAIOW(IOC_WS2,9)
134 #define SIO_MULTICAST_SCOPE _WSAIOW(IOC_WS2,10)
135 #define SIO_SET_QOS _WSAIOW(IOC_WS2,11)
136 #define SIO_SET_GROUP_QOS _WSAIOW(IOC_WS2,12)
137 #define SIO_TRANSLATE_HANDLE _WSAIORW(IOC_WS2,13)
138 #define SIO_ROUTING_INTERFACE_QUERY _WSAIORW(IOC_WS2,20)
139 #define SIO_ROUTING_INTERFACE_CHANGE _WSAIOW(IOC_WS2,21)
140 #define SIO_ADDRESS_LIST_QUERY _WSAIOR(IOC_WS2,22)
141 #define SIO_ADDRESS_LIST_CHANGE _WSAIO(IOC_WS2,23)
142 #define SIO_QUERY_TARGET_PNP_HANDLE _WSAIOR(IOC_WS2,24)
143 #ifndef USE_WS_PREFIX
144 #define SIO_GET_INTERFACE_LIST _IOR ('t', 127, u_long)
145 #else
146 #define SIO_GET_INTERFACE_LIST WS__IOR ('t', 127, u_long)
147 #endif
149 /* Constants for WSAIoctl() */
150 #define WSA_FLAG_OVERLAPPED 0x01
151 #define WSA_FLAG_MULTIPOINT_C_ROOT 0x02
152 #define WSA_FLAG_MULTIPOINT_C_LEAF 0x04
153 #define WSA_FLAG_MULTIPOINT_D_ROOT 0x08
154 #define WSA_FLAG_MULTIPOINT_D_LEAF 0x10
156 /* Constants for WSAJoinLeaf() */
157 #define JL_SENDER_ONLY 0x01
158 #define JL_RECEIVER_ONLY 0x02
159 #define JL_BOTH 0x04
162 #ifndef GUID_DEFINED
163 #include <guiddef.h>
164 #endif
166 #define MAX_PROTOCOL_CHAIN 7
167 #define BASE_PROTOCOL 1
168 #define LAYERED_PROTOCOL 0
170 typedef struct _WSAPROTOCOLCHAIN
172 int ChainLen; /* the length of the chain, */
173 /* length = 0 means layered protocol, */
174 /* length = 1 means base protocol, */
175 /* length > 1 means protocol chain */
176 DWORD ChainEntries[MAX_PROTOCOL_CHAIN]; /* a list of dwCatalogEntryIds */
177 } WSAPROTOCOLCHAIN, * LPWSAPROTOCOLCHAIN;
179 #define WSAPROTOCOL_LEN 255
180 typedef struct _WSAPROTOCOL_INFOA
182 DWORD dwServiceFlags1;
183 DWORD dwServiceFlags2;
184 DWORD dwServiceFlags3;
185 DWORD dwServiceFlags4;
186 DWORD dwProviderFlags;
187 GUID ProviderId;
188 DWORD dwCatalogEntryId;
189 WSAPROTOCOLCHAIN ProtocolChain;
190 int iVersion;
191 int iAddressFamily;
192 int iMaxSockAddr;
193 int iMinSockAddr;
194 int iSocketType;
195 int iProtocol;
196 int iProtocolMaxOffset;
197 int iNetworkByteOrder;
198 int iSecurityScheme;
199 DWORD dwMessageSize;
200 DWORD dwProviderReserved;
201 CHAR szProtocol[WSAPROTOCOL_LEN+1];
202 } WSAPROTOCOL_INFOA, * LPWSAPROTOCOL_INFOA;
204 typedef struct _WSAPROTOCOL_INFOW
206 DWORD dwServiceFlags1;
207 DWORD dwServiceFlags2;
208 DWORD dwServiceFlags3;
209 DWORD dwServiceFlags4;
210 DWORD dwProviderFlags;
211 GUID ProviderId;
212 DWORD dwCatalogEntryId;
213 WSAPROTOCOLCHAIN ProtocolChain;
214 int iVersion;
215 int iAddressFamily;
216 int iMaxSockAddr;
217 int iMinSockAddr;
218 int iSocketType;
219 int iProtocol;
220 int iProtocolMaxOffset;
221 int iNetworkByteOrder;
222 int iSecurityScheme;
223 DWORD dwMessageSize;
224 DWORD dwProviderReserved;
225 WCHAR szProtocol[WSAPROTOCOL_LEN+1];
226 } WSAPROTOCOL_INFOW, *LPWSAPROTOCOL_INFOW;
228 DECL_WINELIB_TYPE_AW(WSAPROTOCOL_INFO)
229 DECL_WINELIB_TYPE_AW(LPWSAPROTOCOL_INFO)
231 typedef struct _WSANETWORKEVENTS
233 long lNetworkEvents;
234 int iErrorCode[FD_MAX_EVENTS];
235 } WSANETWORKEVENTS, *LPWSANETWORKEVENTS;
237 typedef struct _WSANSClassInfoA
239 LPSTR lpszName;
240 DWORD dwNameSpace;
241 DWORD dwValueType;
242 DWORD dwValueSize;
243 LPVOID lpValue;
244 } WSANSCLASSINFOA, *PWSANSCLASSINFOA, *LPWSANSCLASSINFOA;
246 typedef struct _WSANSClassInfoW
248 LPSTR lpszName;
249 DWORD dwNameSpace;
250 DWORD dwValueType;
251 DWORD dwValueSize;
252 LPVOID lpValue;
253 } WSANSCLASSINFOW, *PWSANSCLASSINFOW, *LPWSANSCLASSINFOW;
255 DECL_WINELIB_TYPE_AW(WSANSCLASSINFO)
256 DECL_WINELIB_TYPE_AW(PWSANSCLASSINFO)
257 DECL_WINELIB_TYPE_AW(LPWSANSCLASSINFO)
259 typedef struct _WSAServiceClassInfoA
261 LPGUID lpServiceClassId;
262 LPSTR lpszServiceClassName;
263 DWORD dwCount;
264 LPWSANSCLASSINFOA lpClassInfos;
265 } WSASERVICECLASSINFOA, *PWSASERVICECLASSINFOA, *LPWSASERVICECLASSINFOA;
267 typedef struct _WSAServiceClassInfoW
269 LPGUID lpServiceClassId;
270 LPWSTR lpszServiceClassName;
271 DWORD dwCount;
272 LPWSANSCLASSINFOW lpClassInfos;
273 } WSASERVICECLASSINFOW, *PWSASERVICECLASSINFOW, *LPWSASERVICECLASSINFOW;
276 DECL_WINELIB_TYPE_AW(WSASERVICECLASSINFO)
277 DECL_WINELIB_TYPE_AW(PWSASERVICECLASSINFO)
278 DECL_WINELIB_TYPE_AW(LPWSASERVICECLASSINFO)
280 typedef struct _WSABUF
282 ULONG len;
283 CHAR* buf;
284 } WSABUF, *LPWSABUF;
286 #define WSAEVENT HANDLE
287 #define LPWSAEVENT LPHANDLE
288 #define WSAOVERLAPPED OVERLAPPED
289 typedef struct _OVERLAPPED* LPWSAOVERLAPPED;
291 #define WSA_IO_PENDING (ERROR_IO_PENDING)
292 #define WSA_IO_INCOMPLETE (ERROR_IO_INCOMPLETE)
293 #define WSA_INVALID_HANDLE (ERROR_INVALID_HANDLE)
294 #define WSA_INVALID_PARAMETER (ERROR_INVALID_PARAMETER)
295 #define WSA_NOT_ENOUGH_MEMORY (ERROR_NOT_ENOUGH_MEMORY)
296 #define WSA_OPERATION_ABORTED (ERROR_OPERATION_ABORTED)
298 #define WSA_INVALID_EVENT ((WSAEVENT)NULL)
299 #define WSA_MAXIMUM_WAIT_EVENTS (MAXIMUM_WAIT_OBJECTS)
300 #define WSA_WAIT_FAILED ((DWORD)-1L)
301 #define WSA_WAIT_EVENT_0 (WAIT_OBJECT_0)
302 #define WSA_WAIT_IO_COMPLETION (WAIT_IO_COMPLETION)
303 #define WSA_WAIT_TIMEOUT (WAIT_TIMEOUT)
304 #define WSA_INFINITE (INFINITE)
306 typedef unsigned int GROUP;
307 #define SG_UNCONSTRAINED_GROUP 0x01
308 #define SG_CONSTRAINED_GROUP 0x02
311 * FLOWSPEC and SERVICETYPE should eventually move to qos.h
314 typedef ULONG SERVICETYPE;
316 typedef struct _FLOWSPEC {
317 unsigned int TokenRate;
318 unsigned int TokenBucketSize;
319 unsigned int PeakBandwidth;
320 unsigned int Latency;
321 unsigned int DelayVariation;
322 SERVICETYPE ServiceType;
323 unsigned int MaxSduSize;
324 unsigned int MinimumPolicedSize;
325 } FLOWSPEC, *PFLOWSPEC, *LPFLOWSPEC;
327 typedef struct _QUALITYOFSERVICE {
328 FLOWSPEC SendingFlowspec;
329 FLOWSPEC ReceivingFlowspec;
330 WSABUF ProviderSpecific;
331 } QOS, *LPQOS;
333 typedef int (CALLBACK *LPCONDITIONPROC)
335 LPWSABUF lpCallerId,
336 LPWSABUF lpCallerData,
337 LPQOS lpSQOS,
338 LPQOS lpGQOS,
339 LPWSABUF lpCalleeId,
340 LPWSABUF lpCalleeData,
341 GROUP *g,
342 DWORD dwCallbackData
345 typedef void (CALLBACK *LPWSAOVERLAPPED_COMPLETION_ROUTINE)
347 DWORD dwError,
348 DWORD cbTransferred,
349 LPWSAOVERLAPPED lpOverlapped,
350 DWORD dwFlags
353 #ifndef _tagBLOB_DEFINED
354 #define _tagBLOB_DEFINED
355 #define _BLOB_DEFINED
356 #define _LPBLOB_DEFINED
357 typedef struct _BLOB {
358 ULONG cbSize;
359 BYTE *pBlobData;
360 } BLOB, *LPBLOB;
361 #endif
363 #ifndef __CSADDR_DEFINED__
364 #define __CSADDR_DEFINED__
366 typedef struct _SOCKET_ADDRESS {
367 LPSOCKADDR lpSockaddr;
368 INT iSockaddrLength;
369 } SOCKET_ADDRESS, *PSOCKET_ADDRESS, *LPSOCKET_ADDRESS;
371 typedef struct _CSADDR_INFO {
372 SOCKET_ADDRESS LocalAddr;
373 SOCKET_ADDRESS RemoteAddr;
374 INT iSocketType;
375 INT iProtocol;
376 } CSADDR_INFO, *PCSADDR_INFO, *LPCSADDR_INFO;
377 #endif
379 /*socket address list */
380 typedef struct _SOCKET_ADDRESS_LIST {
381 INT iAddressCount;
382 SOCKET_ADDRESS Address[1];
383 } SOCKET_ADDRESS_LIST, *LPSOCKET_ADDRESS_LIST;
385 /* addressfamily protocol pairs */
386 typedef struct _AFPROTOCOLS {
387 INT iAddressFamily;
388 INT iProtocol;
389 } AFPROTOCOLS, *PAFPROTOCOLS, *LPAFPROTOCOLS;
391 /* client query definitions */
392 typedef enum _WSAEcomparator {
393 COMP_EQUAL = 0,
394 COMP_NOTLESS
395 } WSAECOMPARATOR, *PWSAECOMPARATOR, *LPWSAECOMPARATOR;
397 typedef struct _WSAVersion {
398 DWORD dwVersion;
399 WSAECOMPARATOR ecHow;
400 } WSAVERSION, *PWSAVERSION, *LPWSAVERSION;
403 typedef struct _WSAQuerySetA {
404 DWORD dwSize;
405 LPSTR lpszServiceInstanceName;
406 LPGUID lpServiceClassId;
407 LPWSAVERSION lpVersion;
408 LPSTR lpszComment;
409 DWORD dwNameSpace;
410 LPGUID lpNSProviderId;
411 LPSTR lpszContext;
412 DWORD dwNumberOfProtocols;
413 LPAFPROTOCOLS lpafpProtocols;
414 LPSTR lpszQueryString;
415 DWORD dwNumberOfCsAddrs;
416 LPCSADDR_INFO lpcsaBuffer;
417 DWORD dwOutputFlags;
418 LPBLOB lpBlob;
419 } WSAQUERYSETA, *PWSAQUERYSETA, *LPWSAQUERYSETA;
421 typedef struct _WSAQuerySetW {
422 DWORD dwSize;
423 LPWSTR lpszServiceInstanceName;
424 LPGUID lpServiceClassId;
425 LPWSAVERSION lpVersion;
426 LPWSTR lpszComment;
427 DWORD dwNameSpace;
428 LPGUID lpNSProviderId;
429 LPWSTR lpszContext;
430 DWORD dwNumberOfProtocols;
431 LPAFPROTOCOLS lpafpProtocols;
432 LPWSTR lpszQueryString;
433 DWORD dwNumberOfCsAddrs;
434 LPCSADDR_INFO lpcsaBuffer;
435 DWORD dwOutputFlags;
436 LPBLOB lpBlob;
437 } WSAQUERYSETW, *PWSAQUERYSETW, *LPWSAQUERYSETW;
439 DECL_WINELIB_TYPE_AW(WSAQUERYSET)
440 DECL_WINELIB_TYPE_AW(PWSAQUERYSET)
441 DECL_WINELIB_TYPE_AW(LPWSAQUERYSET)
445 * Winsock Function Typedefs
447 * Remember to keep this section in sync with the
448 * "Prototypes" section in winsock.h.
450 #if WS_API_TYPEDEFS
451 typedef HANDLE (WINAPI *LPFN_WSAASYNCGETHOSTBYADDR)(HWND,u_int,const char*,int,int,char*,int);
452 typedef HANDLE (WINAPI *LPFN_WSAASYNCGETHOSTBYNAME)(HWND,u_int,const char*,char*,int);
453 typedef HANDLE (WINAPI *LPFN_WSAASYNCGETPROTOBYNAME)(HWND,u_int,const char*,char*,int);
454 typedef HANDLE (WINAPI *LPFN_WSAASYNCGETPROTOBYNUMBER)(HWND,u_int,int,char*,int);
455 typedef HANDLE (WINAPI *LPFN_WSAASYNCGETSERVBYNAME)(HWND,u_int,const char*,const char*,char*,int);
456 typedef HANDLE (WINAPI *LPFN_WSAASYNCGETSERVBYPORT)(HWND,u_int,int,const char*,char*,int);
457 typedef int (WINAPI *LPFN_WSAASYNCSELECT)(SOCKET,HWND,u_int,long);
458 typedef int (WINAPI *LPFN_WSACANCELASYNCREQUEST)(HANDLE);
459 typedef int (WINAPI *LPFN_WSACANCELBLOCKINGCALL)(void);
460 typedef int (WINAPI *LPFN_WSACLEANUP)(void);
461 typedef int (WINAPI *LPFN_WSAGETLASTERROR)(void);
462 typedef BOOL (WINAPI *LPFN_WSAISBLOCKING)(void);
463 typedef FARPROC (WINAPI *LPFN_WSASETBLOCKINGHOOK)(FARPROC);
464 typedef void (WINAPI *LPFN_WSASETLASTERROR)(int);
465 typedef int (WINAPI *LPFN_WSASTARTUP)(WORD,LPWSADATA);
466 typedef int (WINAPI *LPFN_WSAUNHOOKBLOCKINGHOOK)(void);
468 typedef SOCKET (WINAPI *LPFN_ACCEPT)(SOCKET,struct WS(sockaddr)*,int*);
469 typedef int (WINAPI *LPFN_BIND)(SOCKET,const struct WS(sockaddr)*,int);
470 typedef int (WINAPI *LPFN_CLOSESOCKET)(SOCKET);
471 typedef int (WINAPI *LPFN_CONNECT)(SOCKET,const struct WS(sockaddr)*,int);
472 typedef struct WS(hostent)* (WINAPI *LPFN_GETHOSTBYADDR)(const char*,int,int);
473 typedef struct WS(hostent)* (WINAPI *LPFN_GETHOSTBYNAME)(const char*);
474 typedef int (WINAPI *LPFN_GETHOSTNAME)(char*,int);
475 typedef int (WINAPI *LPFN_GETPEERNAME)(SOCKET,struct WS(sockaddr)*,int*);
476 typedef struct WS(protoent)* (WINAPI *LPFN_GETPROTOBYNAME)(const char*);
477 typedef struct WS(protoent)* (WINAPI *LPFN_GETPROTOBYNUMBER)(int);
478 #ifdef WS_DEFINE_SELECT
479 typedef int (WINAPI* LPFN_SELECT)(int,WS(fd_set)*,WS(fd_set)*,WS(fd_set)*,const struct WS(timeval)*);
480 #endif
481 typedef struct WS(servent)* (WINAPI *LPFN_GETSERVBYNAME)(const char*,const char*);
482 typedef struct WS(servent)* (WINAPI *LPFN_GETSERVBYPORT)(int,const char*);
483 typedef int (WINAPI *LPFN_GETSOCKNAME)(SOCKET,struct WS(sockaddr)*,int*);
484 typedef int (WINAPI *LPFN_GETSOCKOPT)(SOCKET,int,int,char*,int*);
485 typedef u_long (WINAPI *LPFN_HTONL)(u_long);
486 typedef u_short (WINAPI *LPFN_HTONS)(u_short);
487 typedef unsigned long (WINAPI *LPFN_INET_ADDR)(const char*);
488 typedef char* (WINAPI *LPFN_INET_NTOA)(struct WS(in_addr);
489 typedef int (WINAPI *LPFN_IOCTLSOCKET)(SOCKET,long,u_long*);
490 typedef int (WINAPI *LPFN_LISTEN)(SOCKET,int);
491 typedef u_long (WINAPI *LPFN_NTOHL)(u_long);
492 typedef u_short (WINAPI *LPFN_NTOHS)(u_short);
493 typedef int (WINAPI *LPFN_RECV)(SOCKET,char*,int,int);
494 typedef int (WINAPI *LPFN_RECVFROM)(SOCKET,char*,int,int,struct WS(sockaddr)*,int*);
495 typedef int (WINAPI *LPFN_SEND)(SOCKET,const char*,int,int);
496 typedef int (WINAPI *LPFN_SENDTO)(SOCKET,const char*,int,int,const struct WS(sockaddr)*,int);
497 typedef int (WINAPI *LPFN_SETSOCKOPT)(SOCKET,int,int,const char*,int);
498 typedef int (WINAPI *LPFN_SHUTDOWN)(SOCKET,int);
499 typedef SOCKET (WINAPI *LPFN_SOCKET)(int,int,int);
500 #endif /* WS_API_TYPEDEFS */
505 * Winsock2 Prototypes
507 * Remember to keep this section in sync with the
508 * "Winsock2 Function Typedefs" section below.
510 #if WS_API_PROTOTYPES
511 SOCKET WINAPI WSAAccept(SOCKET,struct WS(sockaddr)*,LPINT,LPCONDITIONPROC,DWORD);
512 INT WINAPI WSAAddressToStringA(LPSOCKADDR,DWORD,LPWSAPROTOCOL_INFOA,LPSTR,LPDWORD);
513 INT WINAPI WSAAddressToStringW(LPSOCKADDR,DWORD,LPWSAPROTOCOL_INFOW,LPWSTR,LPDWORD);
514 #define WSAAddressToString WINELIB_NAME_AW(WSAAddressToString)
515 BOOL WINAPI WSACloseEvent(WSAEVENT);
516 int WINAPI WSAConnect(SOCKET,const struct WS(sockaddr)*,int,LPWSABUF,LPWSABUF,LPQOS,LPQOS);
517 WSAEVENT WINAPI WSACreateEvent(void);
518 /* WSADuplicateSocketA */
519 /* WSADuplicateSocketW */
520 /* WSAEnumNameSpaceProvidersA */
521 /* WSAEnumNameSpaceProvidersW */
522 int WINAPI WSAEnumNetworkEvents(SOCKET,WSAEVENT,LPWSANETWORKEVENTS);
523 int WINAPI WSAEnumProtocolsA(LPINT,LPWSAPROTOCOL_INFOA,LPDWORD);
524 int WINAPI WSAEnumProtocolsW(LPINT,LPWSAPROTOCOL_INFOW,LPDWORD);
525 #define WSAEnumProtocols WINELIB_NAME_AW(WSAEnumProtocols)
526 int WINAPI WSAEventSelect(SOCKET,WSAEVENT,long);
527 BOOL WINAPI WSAGetOverlappedResult(SOCKET,LPWSAOVERLAPPED,LPDWORD,BOOL,LPDWORD);
528 /* WSAGetQOSByName */
529 /* WSAGetServiceClassInfoA */
530 /* WSAGetServiceClassInfoW */
531 /* WSAGetServiceClassNameByClassIdA */
532 /* WSAGetServiceClassNameByClassIdW */
533 int WINAPI WSAHtonl(SOCKET,u_long,u_long*);
534 int WINAPI WSAHtons(SOCKET,u_short,u_short*);
535 int WINAPI WSAInstallServiceClassA(LPWSASERVICECLASSINFOA);
536 int WINAPI WSAInstallServiceClassW(LPWSASERVICECLASSINFOW);
537 #define WSAInstallServiceClass WINELIB_NAME_AW(WSAInstallServiceClass)
538 int WINAPI WSAIoctl(SOCKET,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
539 SOCKET WINAPI WSAJoinLeaf(SOCKET,const struct WS(sockaddr)*,int,LPWSABUF,LPWSABUF,LPQOS,LPQOS,DWORD);
540 INT WINAPI WSALookupServiceBeginA( LPWSAQUERYSETA, DWORD, LPHANDLE);
541 INT WINAPI WSALookupServiceBeginW( LPWSAQUERYSETW, DWORD, LPHANDLE);
542 #define WSALookupServiceBegin WINELIB_NAME_AW(WSALookupServiceBegin)
543 /* WSALookupServiceEnd */
544 /* WSALookupServiceNextA */
545 /* WSALookupServiceNextW */
546 int WINAPI WSANtohl(SOCKET,u_long,u_long*);
547 int WINAPI WSANtohs(SOCKET,u_short,u_short*);
548 /* WSAProviderConfigChange */
549 int WINAPI WSARecv(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
550 int WINAPI WSARecvDisconnect(SOCKET,LPWSABUF);
551 int WINAPI WSARecvFrom(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,struct WS(sockaddr)*,LPINT,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
552 /* WSARemoveServiceClass */
553 BOOL WINAPI WSAResetEvent(WSAEVENT);
554 int WINAPI WSASend(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
555 int WINAPI WSASendDisconnect(SOCKET,LPWSABUF);
556 int WINAPI WSASendTo(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,const struct WS(sockaddr)*,int,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
557 BOOL WINAPI WSASetEvent(WSAEVENT);
558 /* WSASetServiceA */
559 /* WSASetServiceW */
560 SOCKET WINAPI WSASocketA(int,int,int,LPWSAPROTOCOL_INFOA,GROUP,DWORD);
561 SOCKET WINAPI WSASocketW(int,int,int,LPWSAPROTOCOL_INFOW,GROUP,DWORD);
562 #define WSASocket WINELIB_NAME_AW(WSASocket)
563 INT WINAPI WSAStringToAddressA(LPSTR,INT,LPWSAPROTOCOL_INFOA,LPSOCKADDR,LPINT);
564 INT WINAPI WSAStringToAddressW(LPWSTR,INT,LPWSAPROTOCOL_INFOW,LPSOCKADDR,LPINT);
565 #define WSAStringToAddress WINELIB_NAME_AW(WSAStringToAddress)
566 DWORD WINAPI WSAWaitForMultipleEvents(DWORD,const WSAEVENT*,BOOL,DWORD,BOOL);
567 #endif /* WS_API_PROTOTYPES */
572 * Winsock2 Function Typedefs
574 * Remember to keep this section in sync with the
575 * "Winsock2 Prototypes" section above.
577 #if WS_API_TYPEDEFS
578 typedef SOCKET (WINAPI *LPFN_WSAACCEPT)(SOCKET,WS(sockaddr)*,LPINT,LPCONDITIONPROC,DWORD);
579 typedef INT (WINAPI *LPFN_WSAADRESSTOSTRINGA)(LPSOCKADDR,DWORD,LPWSAPROTOCOL_INFOA,LPSTR,LPDWORD);
580 typedef INT (WINAPI *LPFN_WSAADRESSTOSTRINGW)(LPSOCKADDR,DWORD,LPWSAPROTOCOL_INFOW,LPWSTR,LPDWORD);
581 #define LPFN_WSAADDRESSTOSTRING WINELIB_NAME_AW(LPFN_WSAADDRESSTOSTRING)
582 typedef BOOL (WINAPI *LPFN_WSACLOSEEVENT)(WSAEVENT);
583 typedef int (WINAPI *LPFN_WSACONNECT)(SOCKET,const struct WS(sockaddr)*,int,LPWSABUF,LPWSABUF,LPQOS,LPQOS);
584 typedef WSAEVENT (WINAPI *LPFN_WSACREATEEVENT)(void);
585 /* WSADuplicateSocketA */
586 /* WSADuplicateSocketW */
587 /* WSAEnumNameSpaceProvidersA */
588 /* WSAEnumNameSpaceProvidersW */
589 typedef int (WINAPI *LPFN_WSAENUMNETWORKEVENT)(SOCKET,WSAEVENT,LPWSANETWORKEVENTS);
590 typedef int (WINAPI *LPFN_WSAENUMPROTOCOLSA)(LPINT,LPWSAPROTOCOL_INFOA,LPDWORD);
591 typedef int (WINAPI *LPFN_WSAENUMPROTOCOLSW)(LPINT,LPWSAPROTOCOL_INFOW,LPDWORD);
592 #define LPFN_WSAENUMPROTOCOLS WINELIB_NAME_AW(LPFN_WSAENUMPROTOCOLS)
593 typedef int (WINAPI *LPFN_WSAEVENTSELECT)(SOCKET,WSAEVENT,long);
594 typedef BOOL (WINAPI *LPFN_WSAGETOVERLAPPEDRESULT)(SOCKET,LPWSAOVERLAPPED,LPDWORD,BOOL,LPDWORD);
595 /* WSAGetQOSByName */
596 /* WSAGetServiceClassInfoA */
597 /* WSAGetServiceClassInfoW */
598 /* WSAGetServiceClassNameByClassIdA */
599 /* WSAGetServiceClassNameByClassIdW */
600 typedef int (WINAPI *LPFN_WSAHTONL)(SOCKET,u_long,u_long*);
601 typedef int (WINAPI *LPFN_WSAHTONS)(SOCKET,u_short,u_short*);
602 typedef int (WINAPI LPFN_WSAINSTALLSERVICECLASSA)(LPWSASERVICECLASSINFOA);
603 typedef int (WINAPI LPFN_WSAINSTALLSERVICECLASSW)(LPWSASERVICECLASSINFOW);
604 typedef int (WINAPI *LPFN_WSAIOCTL)(SOCKET,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
605 typedef int (WINAPI *LPFN_WSAJOINLEAF)(SOCKET,const struct WS(sockaddr)*,int,LPWSABUF,LPWSABUF,LPQOS,LPQOS,DWORD);
606 /* WSALookupServiceBeginA */
607 /* WSALookupServiceBeginW */
608 /* WSALookupServiceEnd */
609 /* WSALookupServiceNextA */
610 /* WSALookupServiceNextW */
611 typedef int (WINAPI *LPFN_WSANTOHL)(SOCKET,u_long,u_long*);
612 typedef int (WINAPI *LPFN_WSANTOHS)(SOCKET,u_short,u_short*);
613 /* WSAProviderConfigChange */
614 typedef int (WINAPI *LPFN_WSARECV)(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
615 typedef int (WINAPI *LPFN_WSARECVDISCONNECT)(SOCKET,LPWSABUF);
616 typedef int (WINAPI *LPFN_WSARECVFROM)(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,struct WS(sockaddr)*,LPINT,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
617 /* WSARemoveServiceClass */
618 typedef BOOL (WINAPI *LPFN_WSARESETEVENT)(WSAEVENT);
619 typedef int (WINAPI *LPFN_WSASEND)(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
620 typedef int (WINAPI *LPFN_WSASENDDISCONNECT)(SOCKET,LPWSABUF);
621 typedef int (WINAPI *LPFN_WSASENDTO)(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,const struct WS(sockaddr)*,int,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
622 typedef BOOL (WINAPI *LPFN_WSASETEVENT)(WSAEVENT);
623 /* WSASetServiceA */
624 /* WSASetServiceW */
625 typedef SOCKET (WINAPI *LPFN_WSASOCKETA)(int,int,int,LPWSAPROTOCOL_INFOA,GROUP,DWORD);
626 typedef SOCKET (WINAPI *LPFN_WSASOCKETW)(int,int,int,LPWSAPROTOCOL_INFOW,GROUP,DWORD);
627 typedef INT (WINAPI *LPFN_WSASTRINGTOADDRESSA)(LPSTR,INT,LPWSAPROTOCOL_INFOA,LPSOCKADDR,LPINT);
628 typedef INT (WINAPI *LPFN_WSASTRINGTOADDRESSW)(LPSTR,INT,LPWSAPROTOCOL_INFOA,LPSOCKADDR,LPINT);
629 #define LPFN_WSASOCKET WINELIB_NAME_AW(LPFN_WSASOCKET)
630 #define LPFN_WSASTRINGTOADDRESS WINELIB_NAME_AW(LPFN_WSASTRINGTOADDRESS)
631 typedef DWORD (WINAPI *LPFN_WSAWAITFORMULTIPLEEVENTS)(DWORD,const WSAEVENT*,BOOL,DWORD,BOOL);
632 #endif /* WS_API_TYPEDEFS */
635 /* Condition function return values */
636 #define CF_ACCEPT 0x0000
637 #define CF_REJECT 0x0001
638 #define CF_DEFER 0x0002
640 #include <poppack.h>
642 #ifdef __cplusplus
644 #endif
646 #undef WS
647 #undef WS_API_PROTOTYPES
648 #undef WS_API_TYPEDEFS
650 #endif /* __WINSOCK2API__ */