diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-11-03 17:06:20 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-11-03 18:29:52 +0100 |
commit | 677ba8680f21539460644ffe16a060be22855894 (patch) | |
tree | 5a08b2cf3446f677196ccd23a3971a907d3471d2 /wintun.vcxproj | |
parent | api: move nci.lib generation to custom step (diff) | |
download | wintun-677ba8680f21539460644ffe16a060be22855894.tar.xz wintun-677ba8680f21539460644ffe16a060be22855894.zip |
wintun: extract inf driverver at compile time into C header
This requires us to make some insane conversions between INF date,
JavaScript time, and finally Windows file time. The point is to mimic
SystemTimeToFileTime, which is what SpInf.dll's pSetupStringToDriverDate
does on the YYYY-MM-DD from the INF.
The result is that we no longer have to parse an ancient text format in
C at runtime.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'wintun.vcxproj')
-rw-r--r-- | wintun.vcxproj | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/wintun.vcxproj b/wintun.vcxproj index dbfd824..af0e0c3 100644 --- a/wintun.vcxproj +++ b/wintun.vcxproj @@ -139,6 +139,7 @@ <IntDir>$(ConfigurationName)\$(WintunPlatform)\</IntDir> <OutDir>$(ConfigurationName)\$(WintunPlatform)\</OutDir> <RunCodeAnalysis>true</RunCodeAnalysis> + <CustomBuildAfterTargets>StampInf</CustomBuildAfterTargets> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)'=='Release'"> <CodeAnalysisRuleSet>$(WDKContentRoot)CodeAnalysis\DriverMustFixRules.ruleset</CodeAnalysisRuleSet> @@ -168,6 +169,11 @@ <DriverSign> <FileDigestAlgorithm>sha256</FileDigestAlgorithm> </DriverSign> + <CustomBuildStep> + <Command>cscript.exe /nologo "$(ProjectDir)\extract-driverver.js" < "$(IntDir)wintun.inf" > "$(IntDir)wintun-inf.h"</Command> + <Outputs>$(IntDir)wintun-inf.h</Outputs> + <Inputs>$(IntDir)wintun.inf</Inputs> + </CustomBuildStep> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)'=='Release'"> <Inf> |