<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!-- Predefined versioning constants -->
  <PropertyGroup>

    <!-- Current KitOS property -->
    <CurrentKitOS>winv10.0</CurrentKitOS>

    <!-- Latest Target Version property -->
    <LatestTargetVersion>Windows10</LatestTargetVersion>

    <!-- Older TargetPlatformVersion properties -->
    <TargetPlatformVersion_TH1>10.0.10240.0</TargetPlatformVersion_TH1>
    <TargetPlatformVersion_TH2>10.0.10586.0</TargetPlatformVersion_TH2>
    <TargetPlatformVersion_RS1>10.0.14393.0</TargetPlatformVersion_RS1>
    <TargetPlatformVersion_RS2>10.0.15063.0</TargetPlatformVersion_RS2>
    <TargetPlatformVersion_RS3>10.0.16299.0</TargetPlatformVersion_RS3>
    <TargetPlatformVersion_RS4>10.0.17134.0</TargetPlatformVersion_RS4>
    <TargetPlatformVersion_RS5>10.0.17763.0</TargetPlatformVersion_RS5>
    <TargetPlatformVersion_19H1>10.0.18362.0</TargetPlatformVersion_19H1>
    <TargetPlatformVersion_VB>10.0.19041.0</TargetPlatformVersion_VB>
    <TargetPlatformVersion_MN>10.0.19553.0</TargetPlatformVersion_MN>
    <TargetPlatformVersion_FE>10.0.20348.0</TargetPlatformVersion_FE>
    <TargetPlatformVersion_CO>10.0.22000.0</TargetPlatformVersion_CO>
    <TargetPlatformVersion_NI>10.0.22621.0</TargetPlatformVersion_NI>
    <TargetPlatformVersion_GE>10.0.22621.0</TargetPlatformVersion_GE>

    <TargetVersion Condition="'$(TargetVersion)' == ''">$(LatestTargetVersion)</TargetVersion>

    <LatestTargetPlatformVersion>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))</LatestTargetPlatformVersion>
    <LatestWdkPlatformVersion>10.0.26100.0</LatestWdkPlatformVersion>
    <LatestTargetPlatformVersion Condition="'$(LatestTargetPlatformVersion)' != '' and '$(LatestTargetPlatformVersion)' &gt; '$(LatestWdkPlatformVersion)'">$(LatestWdkPlatformVersion)</LatestTargetPlatformVersion>
    <WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == ''">$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
    <TargetPlatformVersion>$(WindowsTargetPlatformVersion)</TargetPlatformVersion>
    <OverrideCfgV1 Condition="'$(OverrideCfgV1)' == '' and '$(WindowsTargetPlatformVersion)' &lt;= '10.0.14250.0'">true</OverrideCfgV1>
    <MatchingWdkPresent Condition="Exists('$(WDKContentRoot)\Include\$(TargetPlatformVersion)\km\ntddk.h')">true</MatchingWdkPresent>

  </PropertyGroup>

  <PropertyGroup Condition="'$(VisualStudioVersion)' != '' and '$(VisualStudioVersion)' &lt;= '14.0'">
    <WDKBinRoot Condition="'$(WDKBinRoot)' == ''">$(WdkContentRoot)bin</WDKBinRoot>
  </PropertyGroup>
  <PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &gt; '14.0'">
    <WDKBinRoot Condition="'$(WDKBinRoot)' == ''">$(WdkContentRoot)bin\$(TargetPlatformVersion)</WDKBinRoot>
  </PropertyGroup>  

  <PropertyGroup>
    <WDKBinRoot_x86>$(WDKBinRoot)\x86</WDKBinRoot_x86>
    <WDKBinRoot_x64>$(WDKBinRoot)\x64</WDKBinRoot_x64>
    <WDKBinRoot_arm64>$(WDKBinRoot)\arm64</WDKBinRoot_arm64>
  </PropertyGroup>

  <PropertyGroup>
    <_NT_TARGET_VERSION_LATEST>0xA000010</_NT_TARGET_VERSION_LATEST>
    <LATEST_WIN32_WINNT_VERSION>0x0A00</LATEST_WIN32_WINNT_VERSION>
    <LATEST_SUBSYSTEM_VERSION>10.00</LATEST_SUBSYSTEM_VERSION>
    <LATEST_NTDDI_VERSION>0x0A000010</LATEST_NTDDI_VERSION>
  </PropertyGroup>

  <ItemDefinitionGroup>
    <ClCompile>
      <AdditionalOptions Condition="'$(EnableKasan)' !='' AND '$(EnableKasan)' != 'false' AND '$(PlatformToolset)' == 'WindowsKernelModeDriver10.0'">%(ClCompile.AdditionalOptions) /fsanitize=kernel-address</AdditionalOptions>
    </ClCompile>
  </ItemDefinitionGroup>

  <Import Condition="Exists('$(WDKContentRoot)build\$(WDKBuildFolder)\WindowsDriver.OSTargets.props')" Project="$(WDKContentRoot)build\$(WDKBuildFolder)\WindowsDriver.OSTargets.props"/>

  <!-- Predefined versioning constants -->
  <PropertyGroup>
    <MIDL_TARGET_VISTA>NT60</MIDL_TARGET_VISTA>
    <MIDL_TARGET_WIN7>NT61</MIDL_TARGET_WIN7>
    <MIDL_TARGET_WIN8>NT62</MIDL_TARGET_WIN8>
    <MIDL_TARGET_WINV63>NT63</MIDL_TARGET_WINV63>
    <MIDL_TARGET_WIN10>NT64</MIDL_TARGET_WIN10>

  </PropertyGroup>

  <Choose>
    <When Condition="('$(TargetVersion)'=='' OR '$(TargetVersion)'=='Windows10')">
      <PropertyGroup>
        <LegacyTargetVersion>false</LegacyTargetVersion>
        <UnknownTargetPlatformVersion Condition="'$(TargetPlatformVersion)' == ''">true</UnknownTargetPlatformVersion>
      </PropertyGroup>
    </When>
    <Otherwise>
      <PropertyGroup>
        <LegacyTargetVersion>true</LegacyTargetVersion>
      </PropertyGroup>
      <Choose>
        <When Condition="('$(TargetVersion)'=='WindowsV6.3')">
          <PropertyGroup>
            <DDKSpec>winv6.3</DDKSpec>
          </PropertyGroup>
        </When>
        <When Condition="('$(TargetVersion)'=='Windows8')">
          <PropertyGroup>
            <DDKSpec>win8</DDKSpec>
          </PropertyGroup>
        </When>
        <When Condition="('$(TargetVersion)'=='Windows7')">
          <PropertyGroup>
            <DDKSpec>win7</DDKSpec>
          </PropertyGroup>
        </When>
        <Otherwise>
          <PropertyGroup>
            <UnknownTargetVersion>true</UnknownTargetVersion>
          </PropertyGroup>
        </Otherwise>
      </Choose>
    </Otherwise>
  </Choose>

  <PropertyGroup Condition="'$(DriverTargetPlatform)' == ''">
    <DriverTargetPlatform Condition="$(BuildWindowsPhone) == '' or $(BuildWindowsPhone) == 'false'">Desktop</DriverTargetPlatform>
    <DriverTargetPlatform Condition="$(BuildWindowsPhone) == 'true'">Mobile</DriverTargetPlatform>
  </PropertyGroup>

  <!-- Default driver deployment properties -->
  <PropertyGroup>
    <!-- Remove previous version of driver before deployment -->
    <RemoveDriver Condition="'$(RemoveDriver)' == ''">True</RemoveDriver>
  </PropertyGroup>
</Project>

