xref: /reactos/sdk/include/psdk/mswsockdef.h (revision 019f21ee)
1 #pragma once
2 
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6 
7 #if(_WIN32_WINNT >= 0x0600)
8 #ifdef _MSC_VER
9 #define MSWSOCKDEF_INLINE __inline
10 #else
11 #define MSWSOCKDEF_INLINE extern inline
12 #endif
13 #endif /* (_WIN32_WINNT>=0x0600) */
14 
15 #ifndef ASSERT
16 #define MSWSOCKDEF_ASSERT_UNDEFINED
17 #define ASSERT(exp) ((VOID) 0)
18 #endif
19 
20 #if(_WIN32_WINNT >= 0x0600)
21 
22 #ifdef _WS2DEF_
23 
24 const UCHAR sockaddr_size[AF_MAX];
25 
26 MSWSOCKDEF_INLINE
27 UCHAR
28 SOCKADDR_SIZE(
29   IN ADDRESS_FAMILY af)
30 {
31   return (UCHAR)((af < AF_MAX) ? sockaddr_size[af]
32                                : sockaddr_size[AF_UNSPEC]);
33 }
34 
35 MSWSOCKDEF_INLINE
36 SCOPE_LEVEL
37 ScopeLevel(
38   IN SCOPE_ID ScopeId)
39 {
40   return (SCOPE_LEVEL)ScopeId.Level;
41 }
42 
43 #endif /* _WS2DEF_ */
44 
45 #define SIO_SET_COMPATIBILITY_MODE _WSAIOW(IOC_VENDOR,300)
46 
47 typedef enum _WSA_COMPATIBILITY_BEHAVIOR_ID {
48   WsaBehaviorAll = 0,
49   WsaBehaviorReceiveBuffering,
50   WsaBehaviorAutoTuning
51 } WSA_COMPATIBILITY_BEHAVIOR_ID, *PWSA_COMPATIBILITY_BEHAVIOR_ID;
52 
53 typedef struct _WSA_COMPATIBILITY_MODE {
54   WSA_COMPATIBILITY_BEHAVIOR_ID BehaviorId;
55   ULONG TargetOsVersion;
56 } WSA_COMPATIBILITY_MODE, *PWSA_COMPATIBILITY_MODE;
57 
58 #endif /* (_WIN32_WINNT>=0x0600) */
59 
60 #ifdef MSWSOCKDEF_ASSERT_UNDEFINED
61 #undef ASSERT
62 #endif
63 
64 #ifdef __cplusplus
65 }
66 #endif
67