' ########################################################################################
' Microsoft Windows
' File: sdkddkver.inc
' Contents: Master include file for versioning windows SDK/DDK
' 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.
' ########################################################################################
'#ifndef _INC_SDKDDKVER
'#define _INC_SDKDDKVER
#IF NOT %DEF(PBX_sdkddkver_PBI)
#DEFINE PBX_sdkddkver_PBI
%EQUATE `SDKDDKVER_INC = 1
'#if (_MSC_VER >= 800)
'#if (_MSC_VER >= 1200)
'#pragma warning(push)
'#endif
'#pragma warning(disable:4001) /* nonstandard extension : single line comment */
'#endif
'#pragma once
'//
'// _WIN32_WINNT version constants
'//
%EQUATE `WIN32_WINNT_NT4 = &H0400
%EQUATE `WIN32_WINNT_WIN2K = &H0500
%EQUATE `WIN32_WINNT_WINXP = &H0501
%EQUATE `WIN32_WINNT_WS03 = &H0502
%EQUATE `WIN32_WINNT_WIN6 = &H0600
%EQUATE `WIN32_WINNT_VISTA = &H0600
%EQUATE `WIN32_WINNT_WS08 = &H0600
%EQUATE `WIN32_WINNT_LONGHORN = &H0600
%EQUATE `WIN32_WINNT_WIN7 = &H0601
'//
'// _WIN32_IE_ version constants
'//
%EQUATE `WIN32_IE_IE20 = &H0200
%EQUATE `WIN32_IE_IE30 = &H0300
%EQUATE `WIN32_IE_IE302 = &H0302
%EQUATE `WIN32_IE_IE40 = &H0400
%EQUATE `WIN32_IE_IE401 = &H0401
%EQUATE `WIN32_IE_IE50 = &H0500
%EQUATE `WIN32_IE_IE501 = &H0501
%EQUATE `WIN32_IE_IE55 = &H0550
%EQUATE `WIN32_IE_IE60 = &H0600
%EQUATE `WIN32_IE_IE60SP1 = &H0601
%EQUATE `WIN32_IE_IE60SP2 = &H0603
%EQUATE `WIN32_IE_IE70 = &H0700
%EQUATE `WIN32_IE_IE80 = &H0800
'//
'// IE <-> OS version mapping
'//
'// NT4 supports IE versions 2.0 -> 6.0 SP1
%EQUATE `WIN32_IE_NT4 = %WIN32_IE_IE20
%EQUATE `WIN32_IE_NT4SP1 = %WIN32_IE_IE20
%EQUATE `WIN32_IE_NT4SP2 = %WIN32_IE_IE20
%EQUATE `WIN32_IE_NT4SP3 = %WIN32_IE_IE302
%EQUATE `WIN32_IE_NT4SP4 = %WIN32_IE_IE401
%EQUATE `WIN32_IE_NT4SP5 = %WIN32_IE_IE401
%EQUATE `WIN32_IE_NT4SP6 = %WIN32_IE_IE50
'// Win98 supports IE versions 4.01 -> 6.0 SP1
%EQUATE `WIN32_IE_WIN98 = %WIN32_IE_IE401
'// Win98SE supports IE versions 5.0 -> 6.0 SP1
%EQUATE `WIN32_IE_WIN98SE = %WIN32_IE_IE50
'// WinME supports IE versions 5.5 -> 6.0 SP1
%EQUATE `WIN32_IE_WINME = %WIN32_IE_IE55
'// Win2k supports IE versions 5.01 -> 6.0 SP1
%EQUATE `WIN32_IE_WIN2K = %WIN32_IE_IE501
%EQUATE `WIN32_IE_WIN2KSP1 = %WIN32_IE_IE501
%EQUATE `WIN32_IE_WIN2KSP2 = %WIN32_IE_IE501
%EQUATE `WIN32_IE_WIN2KSP3 = %WIN32_IE_IE501
%EQUATE `WIN32_IE_WIN2KSP4 = %WIN32_IE_IE501
%EQUATE `WIN32_IE_XP = %WIN32_IE_IE60
%EQUATE `WIN32_IE_XPSP1 = %WIN32_IE_IE60SP1
%EQUATE `WIN32_IE_XPSP2 = %WIN32_IE_IE60SP2
%EQUATE `WIN32_IE_WS03 = &H0602
%EQUATE `WIN32_IE_WS03SP1 = %WIN32_IE_IE60SP2
%EQUATE `WIN32_IE_WIN6 = %WIN32_IE_IE70
%EQUATE `WIN32_IE_LONGHORN = %WIN32_IE_IE70
%EQUATE `WIN32_IE_WIN7 = %WIN32_IE_IE80
'//
'// NTDDI version constants
'//
%EQUATE `NTDDI_WIN2K = &H05000000
%EQUATE `NTDDI_WIN2KSP1 = &H05000100
%EQUATE `NTDDI_WIN2KSP2 = &H05000200
%EQUATE `NTDDI_WIN2KSP3 = &H05000300
%EQUATE `NTDDI_WIN2KSP4 = &H05000400
%EQUATE `NTDDI_WINXP = &H05010000
%EQUATE `NTDDI_WINXPSP1 = &H05010100
%EQUATE `NTDDI_WINXPSP2 = &H05010200
%EQUATE `NTDDI_WINXPSP3 = &H05010300
%EQUATE `NTDDI_WINXPSP4 = &H05010400
%EQUATE `NTDDI_WS03 = &H05020000
%EQUATE `NTDDI_WS03SP1 = &H05020100
%EQUATE `NTDDI_WS03SP2 = &H05020200
%EQUATE `NTDDI_WS03SP3 = &H05020300
%EQUATE `NTDDI_WS03SP4 = &H05020400
%EQUATE `NTDDI_WIN6 = &H06000000
%EQUATE `NTDDI_WIN6SP1 = &H06000100
%EQUATE `NTDDI_WIN6SP2 = &H06000200
%EQUATE `NTDDI_WIN6SP3 = &H06000300
%EQUATE `NTDDI_WIN6SP4 = &H06000400
%EQUATE `NTDDI_VISTA = %NTDDI_WIN6
%EQUATE `NTDDI_VISTASP1 = %NTDDI_WIN6SP1
%EQUATE `NTDDI_VISTASP2 = %NTDDI_WIN6SP2
%EQUATE `NTDDI_VISTASP3 = %NTDDI_WIN6SP3
%EQUATE `NTDDI_VISTASP4 = %NTDDI_WIN6SP4
%EQUATE `NTDDI_LONGHORN = %NTDDI_VISTA
%EQUATE `NTDDI_WS08 = %NTDDI_WIN6SP1
%EQUATE `NTDDI_WS08SP2 = %NTDDI_WIN6SP2
%EQUATE `NTDDI_WS08SP3 = %NTDDI_WIN6SP3
%EQUATE `NTDDI_WS08SP4 = %NTDDI_WIN6SP4
%EQUATE `NTDDI_WIN7 = &H06010000
'//
'// masks for version macros
'//
%EQUATE `OSVERSION_MASK = &HFFFF0000
%EQUATE `SPVERSION_MASK = &H0000FF00
%EQUATE `SUBVERSION_MASK = &H000000FF
'//
'// macros to extract various version fields from the NTDDI version
'//
'#define OSVER(Version) ((Version) & OSVERSION_MASK)
'#define SPVER(Version) (((Version) & SPVERSION_MASK) >> 8)
'#define SUBVER(Version) (((Version) & SUBVERSION_MASK) )
MACRO OSVER(Version) =((Version) AND %OSVERSION_MASK)
MACRO SPVER(Version) =(((Version) AND %SPVERSION_MASK) \ 256) ' >> 8
MACRO SUBVER(Version)=(((Version) AND %SUBVERSION_MASK))
#IF NOT %DEF(%NTDDI_VERSION)
 %NTDDI_VERSION = &H06010000
#ENDIF
#IF %DEF(%DECLSPEC_DEPRECATED_DDK)
'// deprecate in 2k or later
#IF (%NTDDI_VERSION >= %NTDDI_WIN2K)
%EQUATE `DECLSPEC_DEPRECATED_DDK_WIN2K = %DECLSPEC_DEPRECATED_DDK
#ELSE
%EQUATE `DECLSPEC_DEPRECATED_DDK_WIN2K = 0
#ENDIF
'// deprecate in XP or later
#IF (%NTDDI_VERSION >= %NTDDI_WINXP)
%EQUATE `DECLSPEC_DEPRECATED_DDK_WINXP = %DECLSPEC_DEPRECATED_DDK
#ELSE
%EQUATE `DECLSPEC_DEPRECATED_DDK_WINXP = 0
#ENDIF
'// deprecate in WS03 or later
#IF (%NTDDI_VERSION >= %NTDDI_WS03)
%EQUATE `DECLSPEC_DEPRECATED_DDK_WIN2003 = %DECLSPEC_DEPRECATED_DDK
#ELSE
%EQUATE `DECLSPEC_DEPRECATED_DDK_WIN2003 = 0
#ENDIF
'// deprecate in WIN6 or later
#IF (%NTDDI_VERSION >= %NTDDI_WIN6)
%EQUATE `DECLSPEC_DEPRECATED_DDK_WIN6 = %DECLSPEC_DEPRECATED_DDK
#ELSE
%EQUATE `DECLSPEC_DEPRECATED_DDK_WIN6 = 0
#ENDIF
%EQUATE `DECLSPEC_DEPRECATED_DDK_LONGHORN = %DECLSPEC_DEPRECATED_DDK_WIN6
#ENDIF ' // defined(DECLSPEC_DEPRECATED_DDK)
'//
'// if versions aren't already defined, default to most current
'//
'#define NTDDI_VERSION_FROM_WIN32_WINNT2(ver) ver##0000
'#define NTDDI_VERSION_FROM_WIN32_WINNT(ver) NTDDI_VERSION_FROM_WIN32_WINNT2(ver)
#IF NOT %DEF(%WIN32_WINNT) AND (NOT %DEF(%NTDDI_VERSION))
#IF NOT %DEF(%PSAPI_VERSION)
%EQUATE `PSAPI_VERSION = 1
#ENDIF
#ENDIF
#IF NOT %DEF(%WIN32_WINNT) AND (NOT %DEF(%CHICAGO))
 %WIN32_WINNT = &H0601
#ENDIF
'#ifndef NTDDI_VERSION
'#ifdef _WIN32_WINNT
''// set NTDDI_VERSION based on _WIN32_WINNT
'#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
'#else
'#define NTDDI_VERSION = &H06010000
'#endif
'#endif
#IF NOT %DEF(%WINVER)
 #IF %DEF(%WIN32_WINNT)
 '// set NTDDI_VERSION based on _WIN32_WINNT
 %WINVER = %WIN32_WINNT
 #ELSE
 %WINVER = &H0601
 #ENDIF
#ENDIF
#IF NOT %DEF(%WIN32_IE)
 #IF %DEF(%WIN32_WINNT)
 ' set %WIN32_IE based on %WIN32_WINNT
 #IF (%WIN32_WINNT <= %WIN32_WINNT_NT4)
 %WIN32_IE = %WIN32_IE_IE50
 #ELSEIF (%WIN32_WINNT <= %WIN32_WINNT_WIN2K)
 %WIN32_IE = %WIN32_IE_IE501
 #ELSEIF (%WIN32_WINNT <= %WIN32_WINNT_WINXP)
 %WIN32_IE = %WIN32_IE_IE60
 #ELSEIF (%WIN32_WINNT <= %WIN32_WINNT_WS03)
 %WIN32_IE = &H0602
 #ELSE
 %WIN32_IE = &H0800
 #ENDIF
 #ELSE
 %WIN32_IE = &H0800
 #ENDIF
#ENDIF
'//
'// Sanity check for compatible versions
'//
#IF %DEF(%WIN32_WINNT) AND (NOT %DEF(%MIDL_PASS) AND (NOT %DEF(%RC_INVOKED)))
 #IF (%DEF(%WINVER) AND (%WINVER < &H0400) AND (%WIN32_WINNT > &H0400))
 #DEBUG PRINT "WINVER setting conflicts with %WIN32_WINNT setting"
 END
 #ENDIF
 #IF (((%OSVERSION_MASK AND %NTDDI_VERSION) = %NTDDI_WIN2K) AND (%WIN32_WINNT <> %WIN32_WINNT_WIN2K))
 #DEBUG PRINT "%NTDDI_VERSION setting conflicts with %WIN32_WINNT setting"
 END
 #ENDIF
 #IF (((%OSVERSION_MASK AND %NTDDI_VERSION) = %NTDDI_WINXP) AND (%WIN32_WINNT <> %WIN32_WINNT_WINXP))
 #DEBUG PRINT "%NTDDI_VERSION setting conflicts with %WIN32_WINNT setting"
 END
 #ENDIF
 #IF (((%OSVERSION_MASK AND %NTDDI_VERSION) = %NTDDI_WS03) AND (%WIN32_WINNT <> %WIN32_WINNT_WS03))
 #DEBUG PRINT "%NTDDI_VERSION setting conflicts with %WIN32_WINNT setting"
 END
 #ENDIF
 #IF (((%OSVERSION_MASK AND %NTDDI_VERSION) = %NTDDI_VISTA) AND (%WIN32_WINNT <> %WIN32_WINNT_VISTA))
 #DEBUG PRINT "%NTDDI_VERSION setting conflicts with %WIN32_WINNT setting"
 END
 #ENDIF
 #IF ((%WIN32_WINNT < %WIN32_WINNT_WIN2K) AND (%WIN32_IE > %WIN32_IE_IE60SP1))
 #DEBUG PRINT "%WIN32_WINNT settings conflicts with %WIN32_IE setting"
 END
 #ENDIF
#ENDIF ' %DEF(%WIN32_WINNT) AND NOT %DEF(%MIDL_PASS) AND NOT %DEF(%WINRESRC)
#ENDIF
