ReactOS 0.4.16-dev-297-gc569aee
ws2tcpip.h
Go to the documentation of this file.
1/*
2 * ws2tcpip.h : TCP/IP specific extensions in Windows Sockets 2
3 *
4 * Portions Copyright (c) 1980, 1983, 1988, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 */
8
9#pragma once
10
11#define _WS2TCPIP_H
12
13#include <winsock2.h>
14#include <ws2ipdef.h>
15#include <limits.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21#define UDP_NOCHECKSUM 1
22#define UDP_CHECKSUM_COVERAGE 20
23
24#ifdef _MSC_VER
25#define WS2TCPIP_INLINE __inline
26#else
27#define WS2TCPIP_INLINE static inline
28#endif
29
30/* getaddrinfo error codes */
31#define EAI_AGAIN WSATRY_AGAIN
32#define EAI_BADFLAGS WSAEINVAL
33#define EAI_FAIL WSANO_RECOVERY
34#define EAI_FAMILY WSAEAFNOSUPPORT
35#define EAI_MEMORY WSA_NOT_ENOUGH_MEMORY
36#define EAI_NODATA EAI_NONAME
37#define EAI_NOSECURENAME WSA_SECURE_HOST_NOT_FOUND
38#define EAI_NONAME WSAHOST_NOT_FOUND
39#define EAI_SERVICE WSATYPE_NOT_FOUND
40#define EAI_SOCKTYPE WSAESOCKTNOSUPPORT
41#define EAI_IPSECPOLICY WSA_IPSEC_NAME_POLICY_ERROR
42
43#ifdef UNICODE
45#else
47#endif
48
50
51#if (_WIN32_WINNT >= 0x0600)
52
53#ifdef UNICODE
54typedef ADDRINFOEXW ADDRINFOEX, *PADDRINFOEX;
55#else
56typedef ADDRINFOEXA ADDRINFOEX, *PADDRINFOEX;
57#endif
58
59#endif /* (_WIN32_WINNT >= 0x0600) */
60
62INT
65 _In_opt_ PCSTR pNodeName,
66 _In_opt_ PCSTR pServiceName,
67 _In_opt_ const ADDRINFOA *pHints,
69
70#if (NTDDI_VERSION >= NTDDI_WINXPSP2) || (_WIN32_WINNT >= 0x0502)
71
73INT
76 _In_opt_ PCWSTR pNodeName,
77 _In_opt_ PCWSTR pServiceName,
78 _In_opt_ const ADDRINFOW *pHints,
80
81#define GetAddrInfoA getaddrinfo
82
83#ifdef UNICODE
84#define GetAddrInfo GetAddrInfoW
85#else
86#define GetAddrInfo GetAddrInfoA
87#endif
88
89#endif /* (NTDDI_VERSION >= NTDDI_WINXPSP2) || (_WIN32_WINNT >= 0x0502) */
90
91#if INCL_WINSOCK_API_TYPEDEFS
92
93typedef INT
94(WSAAPI *LPFN_GETADDRINFO)(
95 _In_opt_ PCSTR pNodeName,
96 _In_opt_ PCSTR pServiceName,
97 _In_opt_ const ADDRINFOA *pHints,
99
100typedef INT
101(WSAAPI *LPFN_GETADDRINFOW)(
102 _In_opt_ PCWSTR pNodeName,
103 _In_opt_ PCWSTR pServiceName,
104 _In_opt_ const ADDRINFOW *pHints,
106
107#define LPFN_GETADDRINFOA LPFN_GETADDRINFO
108
109#ifdef UNICODE
110#define LPFN_GETADDRINFOT LPFN_GETADDRINFOW
111#else
112#define LPFN_GETADDRINFOT LPFN_GETADDRINFOA
113#endif
114
115#endif /* INCL_WINSOCK_API_TYPEDEFS */
116
117#if (_WIN32_WINNT >= 0x0600)
118
119typedef void
120(CALLBACK *LPLOOKUPSERVICE_COMPLETION_ROUTINE)(
121 _In_ DWORD dwError,
122 _In_ DWORD dwBytes,
124
126INT
127WSAAPI
128GetAddrInfoExA(
130 _In_opt_ PCSTR pServiceName,
131 _In_ DWORD dwNameSpace,
132 _In_opt_ LPGUID lpNspId,
133 _In_opt_ const ADDRINFOEXA *hints,
134 _Outptr_ PADDRINFOEXA *ppResult,
135 _In_opt_ struct timeval *timeout,
137 _In_opt_ LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
138 _Out_opt_ LPHANDLE lpNameHandle);
139
141INT
142WSAAPI
143GetAddrInfoExW(
145 _In_opt_ PCWSTR pServiceName,
146 _In_ DWORD dwNameSpace,
147 _In_opt_ LPGUID lpNspId,
148 _In_opt_ const ADDRINFOEXW *hints,
149 _Outptr_ PADDRINFOEXW *ppResult,
150 _In_opt_ struct timeval *timeout,
152 _In_opt_ LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
153 _Out_opt_ LPHANDLE lpHandle);
154
155#ifdef UNICODE
156#define GetAddrInfoEx GetAddrInfoExW
157#else
158#define GetAddrInfoEx GetAddrInfoExA
159#endif
160
161#if INCL_WINSOCK_API_TYPEDEFS
162
163typedef INT
164(WSAAPI *LPFN_GETADDRINFOEXA)(
166 _In_opt_ PCSTR pServiceName,
167 _In_ DWORD dwNameSpace,
168 _In_opt_ LPGUID lpNspId,
169 _In_opt_ const ADDRINFOEXA *hints,
170 _Outptr_ PADDRINFOEXA *ppResult,
171 _In_opt_ struct timeval *timeout,
173 _In_opt_ LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
174 _Out_opt_ LPHANDLE lpNameHandle);
175
176typedef INT
177(WSAAPI *LPFN_GETADDRINFOEXW)(
179 _In_opt_ PCWSTR pServiceName,
180 _In_ DWORD dwNameSpace,
181 _In_opt_ LPGUID lpNspId,
182 _In_opt_ const ADDRINFOEXW *hints,
183 _Outptr_ PADDRINFOEXW *ppResult,
184 _In_opt_ struct timeval *timeout,
186 _In_opt_ LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
187 _Out_opt_ LPHANDLE lpHandle);
188
189#ifdef UNICODE
190#define LPFN_GETADDRINFOEX LPFN_GETADDRINFOEXW
191#else
192#define LPFN_GETADDRINFOEX LPFN_GETADDRINFOEXA
193#endif
194#endif
195
196#endif
197
198#if (_WIN32_WINNT >= 0x0600)
199
201INT
202WSAAPI
203SetAddrInfoExA(
205 _In_opt_ PCSTR pServiceName,
206 _In_opt_ SOCKET_ADDRESS *pAddresses,
207 _In_ DWORD dwAddressCount,
208 _In_opt_ LPBLOB lpBlob,
210 _In_ DWORD dwNameSpace,
211 _In_opt_ LPGUID lpNspId,
212 _In_opt_ struct timeval *timeout,
214 _In_opt_ LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
215 _Out_opt_ LPHANDLE lpNameHandle);
216
218INT
219WSAAPI
220SetAddrInfoExW(
222 _In_opt_ PCWSTR pServiceName,
223 _In_opt_ SOCKET_ADDRESS *pAddresses,
224 _In_ DWORD dwAddressCount,
225 _In_opt_ LPBLOB lpBlob,
227 _In_ DWORD dwNameSpace,
228 _In_opt_ LPGUID lpNspId,
229 _In_opt_ struct timeval *timeout,
231 _In_opt_ LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
232 _Out_opt_ LPHANDLE lpNameHandle);
233
234#ifdef UNICODE
235#define SetAddrInfoEx SetAddrInfoExW
236#else
237#define SetAddrInfoEx SetAddrInfoExA
238#endif
239
240#if INCL_WINSOCK_API_TYPEDEFS
241
242typedef INT
243(WSAAPI *LPFN_SETADDRINFOEXA)(
245 _In_opt_ PCSTR pServiceName,
246 _In_opt_ SOCKET_ADDRESS *pAddresses,
247 _In_ DWORD dwAddressCount,
248 _In_opt_ LPBLOB lpBlob,
250 _In_ DWORD dwNameSpace,
251 _In_opt_ LPGUID lpNspId,
252 _In_opt_ struct timeval *timeout,
254 _In_opt_ LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
255 _Out_opt_ LPHANDLE lpNameHandle);
256
257typedef INT
258(WSAAPI *LPFN_SETADDRINFOEXW)(
260 _In_opt_ PCWSTR pServiceName,
261 _In_opt_ SOCKET_ADDRESS *pAddresses,
262 _In_ DWORD dwAddressCount,
263 _In_opt_ LPBLOB lpBlob,
265 _In_ DWORD dwNameSpace,
266 _In_opt_ LPGUID lpNspId,
267 _In_opt_ struct timeval *timeout,
269 _In_opt_ LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
270 _Out_opt_ LPHANDLE lpNameHandle);
271
272#ifdef UNICODE
273#define LPFN_SETADDRINFOEX LPFN_SETADDRINFOEXW
274#else
275#define LPFN_SETADDRINFOEX LPFN_SETADDRINFOEXA
276#endif
277#endif
278
279#endif
280
282VOID
283WSAAPI
285 _In_opt_ PADDRINFOA pAddrInfo);
286
287#if (NTDDI_VERSION >= NTDDI_WINXPSP2) || (_WIN32_WINNT >= 0x0502)
288
290VOID
291WSAAPI
293 _In_opt_ PADDRINFOW pAddrInfo);
294
295#define FreeAddrInfoA freeaddrinfo
296
297#ifdef UNICODE
298#define FreeAddrInfo FreeAddrInfoW
299#else
300#define FreeAddrInfo FreeAddrInfoA
301#endif
302#endif
303
304#if INCL_WINSOCK_API_TYPEDEFS
305
306typedef VOID
307(WSAAPI *LPFN_FREEADDRINFO)(
308 _In_opt_ PADDRINFOA pAddrInfo);
309
310typedef VOID
311(WSAAPI *LPFN_FREEADDRINFOW)(
312 _In_opt_ PADDRINFOW pAddrInfo);
313
314#define LPFN_FREEADDRINFOA LPFN_FREEADDRINFO
315
316#ifdef UNICODE
317#define LPFN_FREEADDRINFOT LPFN_FREEADDRINFOW
318#else
319#define LPFN_FREEADDRINFOT LPFN_FREEADDRINFOA
320#endif
321
322#endif
323
324#if (_WIN32_WINNT >= 0x0600)
325
327void
328WSAAPI
329FreeAddrInfoEx(
330 _In_opt_ PADDRINFOEXA pAddrInfoEx);
331
333void
334WSAAPI
335FreeAddrInfoExW(
336 _In_opt_ PADDRINFOEXW pAddrInfoEx);
337
338#define FreeAddrInfoExA FreeAddrInfoEx
339
340#ifdef UNICODE
341#define FreeAddrInfoEx FreeAddrInfoExW
342#endif
343
344#ifdef INCL_WINSOCK_API_TYPEDEFS
345
346typedef void
347(WSAAPI *LPFN_FREEADDRINFOEXA)(
348 _In_ PADDRINFOEXA pAddrInfoEx);
349
350typedef void
351(WSAAPI *LPFN_FREEADDRINFOEXW)(
352 _In_ PADDRINFOEXW pAddrInfoEx);
353
354
355#ifdef UNICODE
356#define LPFN_FREEADDRINFOEX LPFN_FREEADDRINFOEXW
357#else
358#define LPFN_FREEADDRINFOEX LPFN_FREEADDRINFOEXA
359#endif
360
361#endif
362#endif
363
364typedef int socklen_t;
365
367INT
368WSAAPI
370 _In_reads_bytes_(SockaddrLength) const SOCKADDR *pSockaddr,
371 _In_ socklen_t SockaddrLength,
372 _Out_writes_opt_(NodeBufferSize) PCHAR pNodeBuffer,
373 _In_ DWORD NodeBufferSize,
374 _Out_writes_opt_(ServiceBufferSize) PCHAR pServiceBuffer,
375 _In_ DWORD ServiceBufferSize,
376 _In_ INT Flags);
377
378#if (NTDDI_VERSION >= NTDDI_WINXPSP2) || (_WIN32_WINNT >= 0x0502)
379
381INT
382WSAAPI
384 _In_reads_bytes_(SockaddrLength) const SOCKADDR *pSockaddr,
385 _In_ socklen_t SockaddrLength,
386 _Out_writes_opt_(NodeBufferSize) PWCHAR pNodeBuffer,
387 _In_ DWORD NodeBufferSize,
388 _Out_writes_opt_(ServiceBufferSize) PWCHAR pServiceBuffer,
389 _In_ DWORD ServiceBufferSize,
390 _In_ INT Flags);
391
392#define GetNameInfoA getnameinfo
393
394#ifdef UNICODE
395#define GetNameInfo GetNameInfoW
396#else
397#define GetNameInfo GetNameInfoA
398#endif
399
400#endif
401
402#if INCL_WINSOCK_API_TYPEDEFS
403
404typedef int
405(WSAAPI *LPFN_GETNAMEINFO)(
406 _In_reads_bytes_(SockaddrLength) const SOCKADDR *pSockaddr,
407 _In_ socklen_t SockaddrLength,
408 _Out_writes_opt_(NodeBufferSize) PCHAR pNodeBuffer,
409 _In_ DWORD NodeBufferSize,
410 _Out_writes_opt_(ServiceBufferSize) PCHAR pServiceBuffer,
411 _In_ DWORD ServiceBufferSize,
412 _In_ INT Flags);
413
414typedef INT
415(WSAAPI *LPFN_GETNAMEINFOW)(
416 _In_reads_bytes_(SockaddrLength) const SOCKADDR *pSockaddr,
417 _In_ socklen_t SockaddrLength,
418 _Out_writes_opt_(NodeBufferSize) PWCHAR pNodeBuffer,
419 _In_ DWORD NodeBufferSize,
420 _Out_writes_opt_(ServiceBufferSize) PWCHAR pServiceBuffer,
421 _In_ DWORD ServiceBufferSize,
422 _In_ INT Flags);
423
424#define LPFN_GETNAMEINFOA LPFN_GETNAMEINFO
425
426#ifdef UNICODE
427#define LPFN_GETNAMEINFOT LPFN_GETNAMEINFOW
428#else
429#define LPFN_GETNAMEINFOT LPFN_GETNAMEINFOA
430#endif
431#endif
432
433#if (NTDDI_VERSION >= NTDDI_VISTA)
434
436INT
437WSAAPI
440 _In_ PCSTR pszAddrString,
441 _Out_writes_bytes_(sizeof(IN6_ADDR)) PVOID pAddrBuf);
442
443INT
444WSAAPI
447 _In_ PCWSTR pszAddrString,
448 _Out_writes_bytes_(sizeof(IN6_ADDR)) PVOID pAddrBuf);
449
450PCSTR
451WSAAPI
454 _In_ const VOID *pAddr,
455 _Out_writes_(StringBufSize) PSTR pStringBuf,
456 _In_ size_t StringBufSize);
457
458PCWSTR
459WSAAPI
462 _In_ const VOID *pAddr,
463 _Out_writes_(StringBufSize) PWSTR pStringBuf,
464 _In_ size_t StringBufSize);
465
466#define InetPtonA inet_pton
467#define InetNtopA inet_ntop
468
469#ifdef UNICODE
470#define InetPton InetPtonW
471#define InetNtop InetNtopW
472#else
473#define InetPton InetPtonA
474#define InetNtop InetNtopA
475#endif
476
477#if INCL_WINSOCK_API_TYPEDEFS
478
479typedef INT
480(WSAAPI *LPFN_INET_PTONA)(
482 _In_ PCSTR pszAddrString,
483 _Out_writes_bytes_(sizeof(IN6_ADDR)) PVOID pAddrBuf);
484
485typedef INT
486(WSAAPI *LPFN_INET_PTONW)(
488 _In_ PCWSTR pszAddrString,
489 _Out_writes_bytes_(sizeof(IN6_ADDR)) PVOID pAddrBuf);
490
491typedef PCSTR
492(WSAAPI *LPFN_INET_NTOPA)(
495 _Out_writes_(StringBufSize) PSTR pStringBuf,
496 _In_ size_t StringBufSize);
497
498typedef PCWSTR
499(WSAAPI *LPFN_INET_NTOPW)(
502 _Out_writes_(StringBufSize) PWSTR pStringBuf,
503 _In_ size_t StringBufSize);
504
505#ifdef UNICODE
506#define LPFN_INET_PTON LPFN_INET_PTONW
507#define LPFN_INET_NTOP LPFN_INET_NTOPW
508#else
509#define LPFN_INET_PTON LPFN_INET_PTONA
510#define LPFN_INET_NTOP LPFN_INET_NTOPA
511#endif
512
513#endif /* TYPEDEFS */
514#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
515
516#if INCL_WINSOCK_API_PROTOTYPES
517
518#ifdef UNICODE
519#define gai_strerror gai_strerrorW
520#else
521#define gai_strerror gai_strerrorA
522#endif
523
524#define GAI_STRERROR_BUFFER_SIZE 1024
525
526static __inline
527char *
528gai_strerrorA(
529 _In_ int ecode)
530{
531 static char buff[GAI_STRERROR_BUFFER_SIZE + 1];
532
536 NULL,
537 ecode,
539 (LPSTR)buff,
540 GAI_STRERROR_BUFFER_SIZE,
541 NULL);
542
543 return buff;
544}
545
546static __inline
547WCHAR *
548gai_strerrorW(
549 _In_ int ecode)
550{
551 static WCHAR buff[GAI_STRERROR_BUFFER_SIZE + 1];
552
556 NULL,
557 ecode,
559 (LPWSTR)buff,
560 GAI_STRERROR_BUFFER_SIZE,
561 NULL);
562
563 return buff;
564}
565
566#endif /* INCL_WINSOCK_API_PROTOTYPES */
567
569int
571 _In_ SOCKET Socket,
577{
578 int Error;
581
582 if (SourceCount >
583 (((ULONG) (ULONG_MAX - sizeof(*Filter))) / sizeof(*SourceList))) {
585 return SOCKET_ERROR;
586 }
587
590 if (Filter == NULL) {
592 return SOCKET_ERROR;
593 }
594
599 if (SourceCount > 0) {
601 SourceCount * sizeof(*SourceList));
602 }
603
605 &Returned, NULL, NULL);
606
608
609 return Error;
610}
611
612_Success_(return == 0)
614int
615getipv4sourcefilter(
616 _In_ SOCKET Socket,
622{
623 int Error;
626
628 (((ULONG) (ULONG_MAX - sizeof(*Filter))) / sizeof(*SourceList))) {
630 return SOCKET_ERROR;
631 }
632
635 if (Filter == NULL) {
637 return SOCKET_ERROR;
638 }
639
643
645 &Returned, NULL, NULL);
646
647 if (Error == 0) {
648 if (*SourceCount > 0) {
650 *SourceCount * sizeof(*SourceList));
652 }
654 }
655
657
658 return Error;
659}
660
661#if (NTDDI_VERSION >= NTDDI_WINXP)
662
664int
666 _In_ SOCKET Socket,
669 _In_ int GroupLength,
672 _In_reads_(SourceCount) CONST SOCKADDR_STORAGE *SourceList)
673{
674 int Error;
677
678 if (SourceCount >= (((ULONG) (ULONG_MAX - sizeof(*Filter))) / sizeof(*SourceList))) {
680 return SOCKET_ERROR;
681 }
682
685 if (Filter == NULL) {
687 return SOCKET_ERROR;
688 }
689
690 Filter->gf_interface = Interface;
691 ZeroMemory(&Filter->gf_group, sizeof(Filter->gf_group));
692 CopyMemory(&Filter->gf_group, Group, GroupLength);
693 Filter->gf_fmode = FilterMode;
694 Filter->gf_numsrc = SourceCount;
695 if (SourceCount > 0) {
696 CopyMemory(Filter->gf_slist, SourceList, SourceCount * sizeof(*SourceList));
697 }
698
701
702 return Error;
703}
704
705_Success_(return == 0)
707int
708getsourcefilter(
709 _In_ SOCKET Socket,
715 _Out_writes_(*SourceCount) SOCKADDR_STORAGE *SourceList)
716{
717 int Error;
720
721 if (*SourceCount > (((ULONG) (ULONG_MAX - sizeof(*Filter))) / sizeof(*SourceList))) {
723 return SOCKET_ERROR;
724 }
725
728 if (Filter == NULL) {
730 return SOCKET_ERROR;
731 }
732
733 Filter->gf_interface = Interface;
734 ZeroMemory(&Filter->gf_group, sizeof(Filter->gf_group));
735 CopyMemory(&Filter->gf_group, Group, GroupLength);
736 Filter->gf_numsrc = *SourceCount;
737
739 if (Error == 0) {
740 if (*SourceCount > 0) {
741 CopyMemory(SourceList, Filter->gf_slist, *SourceCount * sizeof(*SourceList));
742 *SourceCount = Filter->gf_numsrc;
743 }
744 *FilterMode = Filter->gf_fmode;
745 }
746
748
749 return Error;
750}
751#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
752
753#ifdef IDEAL_SEND_BACKLOG_IOCTLS
754
756int
757idealsendbacklogquery(
758 _In_ SOCKET s,
759 _Out_ ULONG *pISB)
760{
761 DWORD bytes;
762
764 NULL, 0, pISB, sizeof(*pISB), &bytes, NULL, NULL);
765}
766
768int
769idealsendbacklognotify(
770 _In_ SOCKET s,
773{
774 DWORD bytes;
775
777 NULL, 0, NULL, 0, &bytes,
778 lpOverlapped, lpCompletionRoutine);
779}
780
781#endif /* IDEAL_SEND_BACKLOG_IOCTLS */
782
783#if (_WIN32_WINNT >= 0x0600)
784
785#ifdef _SECURE_SOCKET_TYPES_DEFINED_
786
788INT
789WSAAPI
790WSASetSocketSecurity(
791 _In_ SOCKET Socket,
792 _In_reads_bytes_opt_(SecuritySettingsLen) const SOCKET_SECURITY_SETTINGS *SecuritySettings,
793 _In_ ULONG SecuritySettingsLen,
794 _In_opt_ LPWSAOVERLAPPED Overlapped,
796
798INT
799WSAAPI
800WSAQuerySocketSecurity(
801 _In_ SOCKET Socket,
802 _In_reads_bytes_opt_(SecurityQueryTemplateLen) const SOCKET_SECURITY_QUERY_TEMPLATE *SecurityQueryTemplate,
803 _In_ ULONG SecurityQueryTemplateLen,
804 _Out_writes_bytes_to_opt_(*SecurityQueryInfoLen, *SecurityQueryInfoLen) SOCKET_SECURITY_QUERY_INFO* SecurityQueryInfo,
805 _Inout_ ULONG *SecurityQueryInfoLen,
806 _In_opt_ LPWSAOVERLAPPED Overlapped,
808
810INT
811WSAAPI
812WSASetSocketPeerTargetName(
813 _In_ SOCKET Socket,
814 _In_reads_bytes_(PeerTargetNameLen) const SOCKET_PEER_TARGET_NAME *PeerTargetName,
815 _In_ ULONG PeerTargetNameLen,
816 _In_opt_ LPWSAOVERLAPPED Overlapped,
818
820INT
821WSAAPI
822WSADeleteSocketPeerTargetName(
823 _In_ SOCKET Socket,
824 _In_reads_bytes_(PeerAddrLen) const struct sockaddr *PeerAddr,
825 _In_ ULONG PeerAddrLen,
826 _In_opt_ LPWSAOVERLAPPED Overlapped,
828
830INT
831WSAAPI
832WSAImpersonateSocketPeer(
833 _In_ SOCKET Socket,
834 _In_reads_bytes_opt_(PeerAddrLen) const struct sockaddr *PeerAddr,
835 _In_ ULONG PeerAddrLen);
836
838INT
839WSAAPI
840WSARevertImpersonation(VOID);
841
842#endif /* _SECURE_SOCKET_TYPES_DEFINED_ */
843#endif /* (_WIN32_WINNT >= 0x0600) */
844
845#if !defined(_WIN32_WINNT) || (_WIN32_WINNT <= 0x0500)
846#include <wspiapi.h>
847#endif
848
849#ifdef __cplusplus
850}
851#endif
#define VOID
Definition: acefi.h:82
#define FreeAddrInfoW(a)
Definition: addrinfo.c:21
static unsigned char bytes[4]
Definition: adnsresfilter.c:74
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define FAR
Definition: zlib.h:34
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
DWORD WINAPI FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:483
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define WINSOCK_API_LINKAGE
Definition: ws2_32.h:17
VOID WSAAPI WSASetLastError(IN INT iError)
Definition: dllmain.c:123
INT WSAAPI WSAIoctl(IN SOCKET s, IN DWORD dwIoControlCode, IN LPVOID lpvInBuffer, IN DWORD cbInBuffer, OUT LPVOID lpvOutBuffer, IN DWORD cbOutBuffer, OUT LPDWORD lpcbBytesReturned, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
Definition: ioctl.c:46
static unsigned char buff[32768]
Definition: fatten.c:17
unsigned long DWORD
Definition: ntddk_ex.h:95
PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER pAddr
GLdouble s
Definition: gl.h:2039
#define ULONG_MAX
Definition: intsafe.h:155
int socklen_t
Definition: tcp.c:35
static LPSTR pName
Definition: security.c:75
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
Definition: mswsock.h:93
enum _tagppResult ppResult
#define _In_reads_bytes_(s)
Definition: no_sal2.h:170
#define _In_reads_(s)
Definition: no_sal2.h:168
#define _Out_opt_
Definition: no_sal2.h:214
#define _Inout_
Definition: no_sal2.h:162
#define _Success_(c)
Definition: no_sal2.h:84
#define _Out_writes_opt_(s)
Definition: no_sal2.h:226
#define _Outptr_
Definition: no_sal2.h:262
#define _Out_writes_(s)
Definition: no_sal2.h:176
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define _Out_writes_bytes_to_opt_(s, c)
Definition: no_sal2.h:240
#define _Out_writes_bytes_(s)
Definition: no_sal2.h:178
#define _In_reads_bytes_opt_(s)
Definition: no_sal2.h:224
#define CONST
Definition: pedump.c:81
static int Family
Definition: ping.c:62
#define INT
Definition: polytest.cpp:20
#define LANG_NEUTRAL
Definition: nls.h:22
#define MAKELANGID(p, s)
Definition: nls.h:15
#define SUBLANG_DEFAULT
Definition: nls.h:168
namespace GUID const ADDRINFOEXW * hints
Definition: sock.c:80
Definition: nspapi.h:57
Definition: inet.h:67
Definition: tcpip.h:126
ULONG imsf_numsrc
Definition: ws2ipdef.h:541
IN_ADDR imsf_multiaddr
Definition: ws2ipdef.h:538
MULTICAST_MODE_TYPE imsf_fmode
Definition: ws2ipdef.h:540
IN_ADDR imsf_interface
Definition: ws2ipdef.h:539
IN_ADDR imsf_slist[1]
Definition: ws2ipdef.h:542
Definition: dhcpd.h:245
uint16_t * PWSTR
Definition: typedefs.h:56
char * PSTR
Definition: typedefs.h:51
const uint16_t * PCWSTR
Definition: typedefs.h:57
int32_t INT
Definition: typedefs.h:58
const char * PCSTR
Definition: typedefs.h:52
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine
Definition: wdfrequest.h:895
#define ZeroMemory
Definition: winbase.h:1737
#define FORMAT_MESSAGE_MAX_WIDTH_MASK
Definition: winbase.h:451
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:446
#define CopyMemory
Definition: winbase.h:1735
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:449
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define WSAENOBUFS
Definition: winerror.h:1968
void(CALLBACK * LPWSAOVERLAPPED_COMPLETION_ROUTINE)(IN DWORD dwError, IN DWORD cbTransferred, IN LPWSAOVERLAPPED lpOverlapped, IN DWORD dwFlags)
Definition: winsock2.h:722
#define WSAAPI
Definition: winsock2.h:605
UINT_PTR SOCKET
Definition: winsock.h:47
#define SOCKET_ERROR
Definition: winsock.h:333
#define SIOCSIPMSFILTER
Definition: ws2ipdef.h:66
#define SIOCGMSFILTER
Definition: ws2ipdef.h:70
struct group_filter * PGROUP_FILTER
struct ip_msfilter * PIP_MSFILTER
enum _MULTICAST_MODE_TYPE MULTICAST_MODE_TYPE
#define SIOCSMSFILTER
Definition: ws2ipdef.h:69
#define SIOCGIPMSFILTER
Definition: ws2ipdef.h:67
#define SIO_IDEAL_SEND_BACKLOG_CHANGE
Definition: ws2ipdef.h:77
#define IP_MSFILTER_SIZE(NumSources)
Definition: ws2ipdef.h:88
#define GROUP_FILTER_SIZE(numsrc)
Definition: ws2ipdef.h:571
#define SIO_IDEAL_SEND_BACKLOG_QUERY
Definition: ws2ipdef.h:76
#define WS2TCPIP_INLINE
Definition: ws2tcpip.h:27
DWORD Size
Definition: ws2tcpip.h:624
PIP_MSFILTER Filter
Definition: ws2tcpip.h:625
Error
Definition: ws2tcpip.h:644
_In_ IN_ADDR _In_ IN_ADDR _Out_ MULTICAST_MODE_TYPE * FilterMode
Definition: ws2tcpip.h:619
WINSOCK_API_LINKAGE INT WSAAPI GetNameInfoW(_In_reads_bytes_(SockaddrLength) const SOCKADDR *pSockaddr, _In_ socklen_t SockaddrLength, _Out_writes_opt_(NodeBufferSize) PWCHAR pNodeBuffer, _In_ DWORD NodeBufferSize, _Out_writes_opt_(ServiceBufferSize) PWCHAR pServiceBuffer, _In_ DWORD ServiceBufferSize, _In_ INT Flags)
_In_ IN_ADDR Interface
Definition: ws2tcpip.h:617
DWORD Returned
Definition: ws2tcpip.h:624
PCSTR WSAAPI inet_ntop(_In_ INT Family, _In_ const VOID *pAddr, _Out_writes_(StringBufSize) PSTR pStringBuf, _In_ size_t StringBufSize)
Definition: inet_ntop.c:54
int socklen_t
Definition: ws2tcpip.h:364
PCWSTR WSAAPI InetNtopW(_In_ INT Family, _In_ const VOID *pAddr, _Out_writes_(StringBufSize) PWSTR pStringBuf, _In_ size_t StringBufSize)
Definition: addrconv.c:530
ADDRINFOA ADDRINFO
Definition: ws2tcpip.h:49
WS2TCPIP_INLINE int setsourcefilter(_In_ SOCKET Socket, _In_ ULONG Interface, _In_ CONST SOCKADDR *Group, _In_ int GroupLength, _In_ MULTICAST_MODE_TYPE FilterMode, _In_ ULONG SourceCount, _In_reads_(SourceCount) CONST SOCKADDR_STORAGE *SourceList)
Definition: ws2tcpip.h:665
_In_ ULONG _In_ CONST SOCKADDR _In_ int GroupLength
Definition: ws2tcpip.h:712
WINSOCK_API_LINKAGE INT WSAAPI GetAddrInfoW(_In_opt_ PCWSTR pNodeName, _In_opt_ PCWSTR pServiceName, _In_opt_ const ADDRINFOW *pHints, _Outptr_ PADDRINFOW *ppResult)
_In_ IN_ADDR _In_ IN_ADDR _Out_ MULTICAST_MODE_TYPE _Inout_ ULONG _Out_writes_ SourceCount IN_ADDR * SourceList
Definition: ws2tcpip.h:622
INT WSAAPI InetPtonW(_In_ INT Family, _In_ PCWSTR pszAddrString, _Out_writes_bytes_(sizeof(IN6_ADDR)) PVOID pAddrBuf)
WINSOCK_API_LINKAGE INT WSAAPI inet_pton(_In_ INT Family, _In_ PCSTR pszAddrString, _Out_writes_bytes_(sizeof(IN6_ADDR)) PVOID pAddrBuf)
ADDRINFOA * PADDRINFOT
Definition: ws2tcpip.h:46
_In_ IN_ADDR _In_ IN_ADDR Group
Definition: ws2tcpip.h:618
ADDRINFOA FAR * LPADDRINFO
Definition: ws2tcpip.h:49
ADDRINFOA ADDRINFOT
Definition: ws2tcpip.h:46
WS2TCPIP_INLINE int setipv4sourcefilter(_In_ SOCKET Socket, _In_ IN_ADDR Interface, _In_ IN_ADDR Group, _In_ MULTICAST_MODE_TYPE FilterMode, _In_ ULONG SourceCount, _In_reads_(SourceCount) CONST IN_ADDR *SourceList)
Definition: ws2tcpip.h:570
_In_ IN_ADDR _In_ IN_ADDR _Out_ MULTICAST_MODE_TYPE _Inout_ ULONG * SourceCount
Definition: ws2tcpip.h:620
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define getaddrinfo
Definition: wspiapi.h:44
#define getnameinfo
Definition: wspiapi.h:45
#define freeaddrinfo
Definition: wspiapi.h:46
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184