' ########################################################################################
' Microsoft Windows
' File: MSWSockDef.inc
' Contents: Microsoft-specific extensions to the Windows Sockets API
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_MSWSockDef_PBI)
#DEFINE PBX_MSWSockDef_PBI
%EQUATE `MSWSOCKDEF_INC = 1
'#if(_WIN32_WINNT >= 0x0600)
'#ifdef _WS2DEF_
'extern CONST UCHAR sockaddr_size[AF_MAX];
'MSWSOCKDEF_INLINE
'UCHAR
'SOCKADDR_SIZE(__in ADDRESS_FAMILY af)
'{
' return (UCHAR)((af < AF_MAX) ? sockaddr_size[af]
' : sockaddr_size[AF_UNSPEC]);
'}
'MSWSOCKDEF_INLINE
'SCOPE_LEVEL
'ScopeLevel(
' )
'{
' //
' // We can't declare the Level field of type SCOPE_LEVEL directly,
' // since it gets sign extended to be negative. We can, however,
' // safely cast.
' //
' return (SCOPE_LEVEL)ScopeId.Level;
'}
'#endif // _WS2DEF_
%EQUATE `SIO_SET_COMPATIBILITY_MODE = &H9800012C ' _WSAIOW(IOC_VENDOR,300)
' enum WSA_COMPATIBILITY_BEHAVIOR_ID
%EQUATE `WsaBehaviorAll = 0
%EQUATE `WsaBehaviorReceiveBuffering = 1
%EQUATE `WsaBehaviorAutoTuning = 2
' // Size = 8 bytes
TYPE WSA_COMPATIBILITY_MODE DWORD
 BehaviorId AS DWORD ' WSA_COMPATIBILITY_BEHAVIOR_ID
 TargetOsVersion AS DWORD ' ULONG
END TYPE
'#endif //(_WIN32_WINNT>=0x0600)
#ENDIF
