ReactOS  0.4.14-dev-606-g14ebc0b
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
18 extern "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
54 typedef ADDRINFOEXW ADDRINFOEX, *PADDRINFOEX;
55 #else
56 typedef ADDRINFOEXA ADDRINFOEX, *PADDRINFOEX;
57 #endif
58 
59 #endif /* (_WIN32_WINNT >= 0x0600) */
60 
62 INT
63 WSAAPI
65  _In_opt_ PCSTR pNodeName,
66  _In_opt_ PCSTR pServiceName,
67  _In_opt_ const ADDRINFOA *pHints,
68  _Outptr_ PADDRINFOA *ppResult);
69 
70 #if (NTDDI_VERSION >= NTDDI_WINXPSP2) || (_WIN32_WINNT >= 0x0502)
71 
73 INT
74 WSAAPI
76  _In_opt_ PCWSTR pNodeName,
77  _In_opt_ PCWSTR pServiceName,
78  _In_opt_ const ADDRINFOW *pHints,
79  _Outptr_ PADDRINFOW *ppResult);
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 
93 typedef INT
94 (WSAAPI *LPFN_GETADDRINFO)(
95  _In_opt_ PCSTR pNodeName,
96  _In_opt_ PCSTR pServiceName,
97  _In_opt_ const ADDRINFOA *pHints,
98  _Outptr_ PADDRINFOA *ppResult);
99 
100 typedef INT
101 (WSAAPI *LPFN_GETADDRINFOW)(
102  _In_opt_ PCWSTR pNodeName,
103  _In_opt_ PCWSTR pServiceName,
104  _In_opt_ const ADDRINFOW *pHints,
105  _Outptr_ PADDRINFOW *ppResult);
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 
119 typedef void
120 (CALLBACK *LPLOOKUPSERVICE_COMPLETION_ROUTINE)(
121  _In_ DWORD dwError,
122  _In_ DWORD dwBytes,
124 
126 INT
127 WSAAPI
128 GetAddrInfoExA(
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 
141 INT
142 WSAAPI
143 GetAddrInfoExW(
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 
163 typedef INT
164 (WSAAPI *LPFN_GETADDRINFOEXA)(
165  _In_ PCSTR pName,
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 
176 typedef INT
177 (WSAAPI *LPFN_GETADDRINFOEXW)(
178  _In_ PCWSTR pName,
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 
201 INT
202 WSAAPI
203 SetAddrInfoExA(
204  _In_ PCSTR pName,
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 
218 INT
219 WSAAPI
220 SetAddrInfoExW(
221  _In_ PCWSTR pName,
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 
242 typedef INT
243 (WSAAPI *LPFN_SETADDRINFOEXA)(
244  _In_ PCSTR pName,
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 
257 typedef INT
258 (WSAAPI *LPFN_SETADDRINFOEXW)(
259  _In_ PCWSTR pName,
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 
282 VOID
283 WSAAPI
285  _In_opt_ PADDRINFOA pAddrInfo);
286 
287 #if (NTDDI_VERSION >= NTDDI_WINXPSP2) || (_WIN32_WINNT >= 0x0502)
288 
290 VOID
291 WSAAPI
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 
306 typedef VOID
307 (WSAAPI *LPFN_FREEADDRINFO)(
308  _In_opt_ PADDRINFOA pAddrInfo);
309 
310 typedef 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 
327 void
328 WSAAPI
329 FreeAddrInfoEx(
330  _In_opt_ PADDRINFOEXA pAddrInfoEx);
331 
333 void
334 WSAAPI
335 FreeAddrInfoExW(
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 
346 typedef void
347 (WSAAPI *LPFN_FREEADDRINFOEXA)(
348  _In_ PADDRINFOEXA pAddrInfoEx);
349 
350 typedef 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 
364 typedef int socklen_t;
365 
367 INT
368 WSAAPI
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 
381 INT
382 WSAAPI
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 
404 typedef 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 
414 typedef 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 
436 INT
437 WSAAPI
438 inet_pton(
439  _In_ INT Family,
440  _In_ PCSTR pszAddrString,
441  _Out_writes_bytes_(sizeof(IN6_ADDR)) PVOID pAddrBuf);
442 
443 INT
444 WSAAPI
445 InetPtonW(
446  _In_ INT Family,
447  _In_ PCWSTR pszAddrString,
448  _Out_writes_bytes_(sizeof(IN6_ADDR)) PVOID pAddrBuf);
449 
450 PCSTR
451 WSAAPI
452 inet_ntop(
453  _In_ INT Family,
454  _In_ PVOID pAddr,
455  _Out_writes_(StringBufSize) PSTR pStringBuf,
456  _In_ size_t StringBufSize);
457 
458 PCWSTR
459 WSAAPI
460 InetNtopW(
461  _In_ INT Family,
462  _In_ PVOID 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 
479 typedef INT
480 (WSAAPI *LPFN_INET_PTONA)(
481  _In_ INT Family,
482  _In_ PCSTR pszAddrString,
483  _Out_writes_bytes_(sizeof(IN6_ADDR)) PVOID pAddrBuf);
484 
485 typedef INT
486 (WSAAPI *LPFN_INET_PTONW)(
487  _In_ INT Family,
488  _In_ PCWSTR pszAddrString,
489  _Out_writes_bytes_(sizeof(IN6_ADDR)) PVOID pAddrBuf);
490 
491 typedef PCSTR
492 (WSAAPI *LPFN_INET_NTOPA)(
493  _In_ INT Family,
494  _In_ PVOID pAddr,
495  _Out_writes_(StringBufSize) PSTR pStringBuf,
496  _In_ size_t StringBufSize);
497 
498 typedef PCWSTR
499 (WSAAPI *LPFN_INET_NTOPW)(
500  _In_ INT Family,
501  _In_ PVOID pAddr,
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 
526 static __inline
527 char *
529  _In_ int ecode)
530 {
531  static char buff[GAI_STRERROR_BUFFER_SIZE + 1];
532 
536  NULL,
537  ecode,
539  (LPSTR)buff,
541  NULL);
542 
543  return buff;
544 }
545 
546 static __inline
547 WCHAR *
549  _In_ int ecode)
550 {
551  static WCHAR buff[GAI_STRERROR_BUFFER_SIZE + 1];
552 
556  NULL,
557  ecode,
559  (LPWSTR)buff,
561  NULL);
562 
563  return buff;
564 }
565 
566 #endif /* INCL_WINSOCK_API_PROTOTYPES */
567 
569 int
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 
604  Error = WSAIoctl(Socket, SIOCSIPMSFILTER, Filter, Size, NULL, 0,
605  &Returned, NULL, NULL);
606 
608 
609  return Error;
610 }
611 
612 _Success_(return == 0)
614 int
615 getipv4sourcefilter(
616  _In_ SOCKET Socket,
622 {
623  int Error;
626 
627  if (*SourceCount >
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 
664 int
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)
707 int
708 getsourcefilter(
709  _In_ SOCKET Socket,
712  _In_ int GroupLength,
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 
756 int
758  _In_ SOCKET s,
759  _Out_ ULONG *pISB)
760 {
761  DWORD bytes;
762 
764  NULL, 0, pISB, sizeof(*pISB), &bytes, NULL, NULL);
765 }
766 
768 int
770  _In_ SOCKET s,
772  _In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
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 
788 INT
789 WSAAPI
790 WSASetSocketSecurity(
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 
798 INT
799 WSAAPI
800 WSAQuerySocketSecurity(
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 
810 INT
811 WSAAPI
812 WSASetSocketPeerTargetName(
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 
820 INT
821 WSAAPI
822 WSADeleteSocketPeerTargetName(
823  _In_ SOCKET Socket,
824  _In_reads_bytes_(PeerAddrLen) const struct sockaddr *PeerAddr,
825  _In_ ULONG PeerAddrLen,
826  _In_opt_ LPWSAOVERLAPPED Overlapped,
828 
830 INT
831 WSAAPI
832 WSAImpersonateSocketPeer(
833  _In_ SOCKET Socket,
834  _In_reads_bytes_opt_(PeerAddrLen) const struct sockaddr *PeerAddr,
835  _In_ ULONG PeerAddrLen);
836 
838 INT
839 WSAAPI
840 WSARevertImpersonation(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
signed char * PCHAR
Definition: retypes.h:7
namespace GUID const ADDRINFOEXW * hints
Definition: sock.c:80
#define SOCKET_ERROR
Definition: winsock.h:333
#define SIO_IDEAL_SEND_BACKLOG_QUERY
Definition: ws2ipdef.h:76
#define IP_MSFILTER_SIZE(NumSources)
Definition: ws2ipdef.h:88
const uint16_t * PCWSTR
Definition: typedefs.h:55
enum _MULTICAST_MODE_TYPE MULTICAST_MODE_TYPE
#define FORMAT_MESSAGE_MAX_WIDTH_MASK
Definition: winbase.h:406
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define _Out_writes_bytes_to_opt_(size, count)
Definition: no_sal2.h:375
_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)
uint16_t * PWSTR
Definition: typedefs.h:54
#define LANG_NEUTRAL
Definition: nls.h:22
DWORD WINAPI FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:483
#define _In_reads_(size)
Definition: no_sal2.h:228
#define _In_reads_bytes_opt_(size)
Definition: no_sal2.h:230
#define SUBLANG_DEFAULT
Definition: nls.h:168
#define INT
Definition: polytest.cpp:20
#define CALLBACK
Definition: compat.h:27
#define _Outptr_
Definition: no_sal2.h:396
#define WINSOCK_API_LINKAGE
Definition: ws2_32.h:17
#define ZeroMemory
Definition: winbase.h:1642
_Success_(return==0) WS2TCPIP_INLINE int getipv4sourcefilter(_In_ SOCKET Socket
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
Definition: dhcpd.h:245
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
uint16_t * PWCHAR
Definition: typedefs.h:54
Definition: nspapi.h:57
char * LPSTR
Definition: xmlstorage.h:182
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 Size
Definition: ws2tcpip.h:624
int32_t INT
Definition: typedefs.h:56
GLbitfield GLuint64 timeout
Definition: glext.h:7164
#define _In_opt_
Definition: no_sal2.h:213
ADDRINFOA FAR * LPADDRINFO
Definition: ws2tcpip.h:49
#define _Out_writes_(size)
Definition: no_sal2.h:367
#define SIOCGIPMSFILTER
Definition: ws2ipdef.h:67
_In_ IN_ADDR _In_ IN_ADDR _Out_ MULTICAST_MODE_TYPE * FilterMode
Definition: ws2tcpip.h:617
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)
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
static unsigned char bytes[4]
Definition: adnsresfilter.c:74
static int Family
Definition: ping.c:62
WS2TCPIP_INLINE int idealsendbacklogquery(_In_ SOCKET s, _Out_ ULONG *pISB)
Definition: ws2tcpip.h:757
static __inline WCHAR * gai_strerrorW(_In_ int ecode)
Definition: ws2tcpip.h:548
IN_ADDR imsf_multiaddr
Definition: ws2ipdef.h:538
IN_ADDR imsf_slist[1]
Definition: ws2ipdef.h:542
_In_ IN_ADDR Interface
Definition: ws2tcpip.h:617
#define FAR
Definition: guiddef.h:36
IN_ADDR imsf_interface
Definition: ws2ipdef.h:539
smooth NULL
Definition: ftsmooth.c:416
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
#define _Out_writes_bytes_(size)
Definition: no_sal2.h:370
#define _Out_
Definition: no_sal2.h:323
#define WS2TCPIP_INLINE
Definition: ws2tcpip.h:27
VOID WSAAPI WSASetLastError(IN INT iError)
Definition: dllmain.c:123
ADDRINFOA ADDRINFOT
Definition: ws2tcpip.h:46
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
_In_ IN_ADDR _In_ IN_ADDR _Out_ MULTICAST_MODE_TYPE _Inout_ ULONG * SourceCount
Definition: ws2tcpip.h:617
int socklen_t
Definition: ws2tcpip.h:364
WS2TCPIP_INLINE int idealsendbacklognotify(_In_ SOCKET s, _In_opt_ LPWSAOVERLAPPED lpOverlapped, _In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
Definition: ws2tcpip.h:769
#define _Out_opt_
Definition: no_sal2.h:339
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
static LPSTR pName
Definition: security.c:75
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
Definition: tcpip.h:125
#define CopyMemory
Definition: winbase.h:1640
DWORD Returned
Definition: ws2tcpip.h:624
unsigned long DWORD
Definition: ntddk_ex.h:95
int socklen_t
Definition: tcp.c:35
static __inline char * gai_strerrorA(_In_ int ecode)
Definition: ws2tcpip.h:528
#define _Inout_
Definition: no_sal2.h:244
WINSOCK_API_LINKAGE INT WSAAPI getaddrinfo(_In_opt_ PCSTR pNodeName, _In_opt_ PCSTR pServiceName, _In_opt_ const ADDRINFOA *pHints, _Outptr_ PADDRINFOA *ppResult)
#define GROUP_FILTER_SIZE(numsrc)
Definition: ws2ipdef.h:571
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define VOID
Definition: acefi.h:82
GLdouble s
Definition: gl.h:2039
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
_In_ IN_ADDR _In_ IN_ADDR Group
Definition: ws2tcpip.h:617
ADDRINFOA * PADDRINFOT
Definition: ws2tcpip.h:46
#define _In_reads_bytes_(size)
Definition: no_sal2.h:229
#define SIOCGMSFILTER
Definition: ws2ipdef.h:70
ULONG imsf_numsrc
Definition: ws2ipdef.h:541
#define _In_
Definition: no_sal2.h:204
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:401
WINSOCK_API_LINKAGE INT WSAAPI getnameinfo(_In_reads_bytes_(SockaddrLength) const SOCKADDR *pSockaddr, _In_ socklen_t SockaddrLength, _Out_writes_opt_(NodeBufferSize) PCHAR pNodeBuffer, _In_ DWORD NodeBufferSize, _Out_writes_opt_(ServiceBufferSize) PCHAR pServiceBuffer, _In_ DWORD ServiceBufferSize, _In_ INT Flags)
#define SIOCSMSFILTER
Definition: ws2ipdef.h:69
HeapFree(GetProcessHeap(), 0, Filter)
PCSTR WSAAPI inet_ntop(_In_ INT Family, _In_ PVOID pAddr, _Out_writes_(StringBufSize) PSTR pStringBuf, _In_ size_t StringBufSize)
#define SIO_IDEAL_SEND_BACKLOG_CHANGE
Definition: ws2ipdef.h:77
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
Definition: mswsock.h:90
_In_ UINT _Out_writes_opt_(cch) LPSTR lpszFile
struct group_filter * PGROUP_FILTER
#define GAI_STRERROR_BUFFER_SIZE
Definition: ws2tcpip.h:524
#define WSAAPI
Definition: winsock2.h:584
signed char * PSTR
Definition: retypes.h:7
ADDRINFOA ADDRINFO
Definition: ws2tcpip.h:49
WINSOCK_API_LINKAGE VOID WSAAPI freeaddrinfo(_In_opt_ PADDRINFOA pAddrInfo)
PCWSTR WSAAPI InetNtopW(_In_ INT Family, _In_ PVOID pAddr, _Out_writes_(StringBufSize) PWSTR pStringBuf, _In_ size_t StringBufSize)
WINSOCK_API_LINKAGE VOID WSAAPI FreeAddrInfoW(_In_opt_ PADDRINFOW pAddrInfo)
MULTICAST_MODE_TYPE imsf_fmode
Definition: ws2ipdef.h:540
WINSOCK_API_LINKAGE INT WSAAPI inet_pton(_In_ INT Family, _In_ PCSTR pszAddrString, _Out_writes_bytes_(sizeof(IN6_ADDR)) PVOID pAddrBuf)
void(CALLBACK * LPWSAOVERLAPPED_COMPLETION_ROUTINE)(IN DWORD dwError, IN DWORD cbTransferred, IN LPWSAOVERLAPPED lpOverlapped, IN DWORD dwFlags)
Definition: winsock2.h:722
_In_ PIRP _In_opt_ PVOID _In_opt_ POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine
Definition: fsrtlfuncs.h:673
unsigned int ULONG
Definition: retypes.h:1
#define MAKELANGID(p, s)
Definition: nls.h:15
UINT_PTR SOCKET
Definition: winsock.h:47
const char * PCSTR
Definition: typedefs.h:51
_In_ ULONG _In_ CONST SOCKADDR _In_ int GroupLength
Definition: ws2tcpip.h:710
PIP_MSFILTER Filter
Definition: ws2tcpip.h:625
WCHAR * LPWSTR
Definition: xmlstorage.h:184
Error
Definition: ws2tcpip.h:644
#define SIOCSIPMSFILTER
Definition: ws2ipdef.h:66
struct ip_msfilter * PIP_MSFILTER
WINSOCK_API_LINKAGE INT WSAAPI GetAddrInfoW(_In_opt_ PCWSTR pNodeName, _In_opt_ PCWSTR pServiceName, _In_opt_ const ADDRINFOW *pHints, _Outptr_ PADDRINFOW *ppResult)
static unsigned char buff[32768]
Definition: fatten.c:17
#define WSAENOBUFS
Definition: winerror.h:1968
#define CONST
Definition: pedump.c:81
#define ULONG_MAX
Definition: limits.h:44
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31