Move #define NDIS... to ClCompile/PreprocessorDefinitions
These constants must be defined in the project file in order for Static Driver Verifier to work correctly. Otherwise, SDV returns error MSB3073: The command "staticdv /check:*" exited with code -1. Since the ClCompile/PreprocessorDefinitions management became cumbersome, all platform and configuration independent MSVC settings were rearranged in a single <ItemDefinitionGroup>, while platform independent but configuration dependent were rearranged to a conditional <ItemDefinitionGroup>(s). Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
4eb3c1f7c0
commit
50a09cad71
4
wintun.c
4
wintun.c
@ -3,10 +3,6 @@
|
|||||||
* Copyright (C) 2018-2019 WireGuard LLC. All Rights Reserved.
|
* Copyright (C) 2018-2019 WireGuard LLC. All Rights Reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDIS_MINIPORT_DRIVER 1
|
|
||||||
#define NDIS630_MINIPORT 1
|
|
||||||
#define NDIS_WDM 1
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <wdm.h>
|
#include <wdm.h>
|
||||||
|
@ -98,84 +98,43 @@
|
|||||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup>
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_REV=$(WintunVersionRev);WINTUN_VERSION_BUILD=$(WintunVersionBuild);WINTUN_VERSION_STR="$(WintunVersionStr)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_REV=$(WintunVersionRev);WINTUN_VERSION_BUILD=$(WintunVersionBuild);WINTUN_VERSION_STR="$(WintunVersionStr)";NDIS_MINIPORT_DRIVER=1;NDIS630_MINIPORT=1;NDIS_WDM=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<WarningLevel>Level4</WarningLevel>
|
<WarningLevel>Level4</WarningLevel>
|
||||||
<EnablePREfast>true</EnablePREfast>
|
<EnablePREfast>true</EnablePREfast>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_REV=$(WintunVersionRev);WINTUN_VERSION_BUILD=$(WintunVersionBuild);WINTUN_VERSION_STR="$(WintunVersionStr)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_REV=$(WintunVersionRev);WINTUN_VERSION_BUILD=$(WintunVersionBuild);WINTUN_VERSION_STR="$(WintunVersionStr)";NDIS_MINIPORT_DRIVER=1;NDIS630_MINIPORT=1;NDIS_WDM=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ResourceCompile>
|
</ResourceCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<AdditionalDependencies>ndis.lib;wdmsec.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>ndis.lib;wdmsec.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
|
<DriverSign>
|
||||||
|
<FileDigestAlgorithm>sha256</FileDigestAlgorithm>
|
||||||
|
</DriverSign>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
|
||||||
<Inf>
|
<Inf>
|
||||||
<TimeStamp>$(WintunVersionMaj).$(WintunVersionMin).$(WintunVersionRev).$(WintunVersionBuild)</TimeStamp>
|
<TimeStamp>$(WintunVersionMaj).$(WintunVersionMin).$(WintunVersionRev).$(WintunVersionBuild)</TimeStamp>
|
||||||
</Inf>
|
</Inf>
|
||||||
<DriverSign>
|
|
||||||
<FileDigestAlgorithm>sha256</FileDigestAlgorithm>
|
|
||||||
</DriverSign>
|
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_REV=$(WintunVersionRev);WINTUN_VERSION_BUILD=$(WintunVersionBuild);WINTUN_VERSION_STR="$(WintunVersionStr)";DBG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>DBG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<WarningLevel>Level4</WarningLevel>
|
|
||||||
<EnablePREfast>true</EnablePREfast>
|
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_REV=$(WintunVersionRev);WINTUN_VERSION_BUILD=$(WintunVersionBuild);WINTUN_VERSION_STR="$(WintunVersionStr)";DBG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>DBG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ResourceCompile>
|
</ResourceCompile>
|
||||||
<Link>
|
|
||||||
<AdditionalDependencies>ndis.lib;wdmsec.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
</Link>
|
|
||||||
<Inf>
|
<Inf>
|
||||||
<TimeStamp>*</TimeStamp>
|
<TimeStamp>*</TimeStamp>
|
||||||
</Inf>
|
</Inf>
|
||||||
<DriverSign>
|
|
||||||
<FileDigestAlgorithm>sha256</FileDigestAlgorithm>
|
|
||||||
</DriverSign>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_REV=$(WintunVersionRev);WINTUN_VERSION_BUILD=$(WintunVersionBuild);WINTUN_VERSION_STR="$(WintunVersionStr)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<WarningLevel>Level4</WarningLevel>
|
|
||||||
<EnablePREfast>true</EnablePREfast>
|
|
||||||
</ClCompile>
|
|
||||||
<ResourceCompile>
|
|
||||||
<PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_REV=$(WintunVersionRev);WINTUN_VERSION_BUILD=$(WintunVersionBuild);WINTUN_VERSION_STR="$(WintunVersionStr)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ResourceCompile>
|
|
||||||
<Link>
|
|
||||||
<AdditionalDependencies>ndis.lib;wdmsec.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
</Link>
|
|
||||||
<Inf>
|
|
||||||
<TimeStamp>$(WintunVersionMaj).$(WintunVersionMin).$(WintunVersionRev).$(WintunVersionBuild)</TimeStamp>
|
|
||||||
</Inf>
|
|
||||||
<DriverSign>
|
|
||||||
<FileDigestAlgorithm>sha256</FileDigestAlgorithm>
|
|
||||||
</DriverSign>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_REV=$(WintunVersionRev);WINTUN_VERSION_BUILD=$(WintunVersionBuild);WINTUN_VERSION_STR="$(WintunVersionStr)";DBG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<WarningLevel>Level4</WarningLevel>
|
|
||||||
<EnablePREfast>true</EnablePREfast>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
</ClCompile>
|
|
||||||
<ResourceCompile>
|
|
||||||
<PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_REV=$(WintunVersionRev);WINTUN_VERSION_BUILD=$(WintunVersionBuild);WINTUN_VERSION_STR="$(WintunVersionStr)";DBG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ResourceCompile>
|
|
||||||
<Link>
|
|
||||||
<AdditionalDependencies>ndis.lib;wdmsec.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
</Link>
|
|
||||||
<Inf>
|
|
||||||
<TimeStamp>*</TimeStamp>
|
|
||||||
</Inf>
|
|
||||||
<DriverSign>
|
|
||||||
<FileDigestAlgorithm>sha256</FileDigestAlgorithm>
|
|
||||||
</DriverSign>
|
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="wintun.c" />
|
<ClCompile Include="wintun.c" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
Loading…
Reference in New Issue
Block a user