]> xenbits.xensource.com Git - pvdrivers/win/xenvif.git/commitdiff
Fix build with later WDKs
authorOwen Smith <owen.smith@citrix.com>
Thu, 12 Aug 2021 12:44:25 +0000 (13:44 +0100)
committerPaul Durrant <pdurrant@amazon.com>
Mon, 6 Sep 2021 11:58:07 +0000 (12:58 +0100)
- Adds alias for GetProjectInfoForReference target to version.vcxproj
    Later kits seemed to have renamed the build target, and will fail without
    this alias target.
- Adds "/fd sha256" to signtool command line
    WDK 20344 and later require binaries signed with a SHA256 file digest, or
    the build outputs are deleted
- Disables warning 4061 - switch statement on enum types need to have a case
    for all values of the enumeration

Signed-off-by: Owen Smith <owen.smith@citrix.com>
- Cast enum types used as array indices to avoid bounds check complaint

Signed-off-by: Paul Durrant <paul@xen.org>
src/xenvif/frontend.c
src/xenvif/mac.c
vs2019/package/package.vcxproj
vs2019/version/version.vcxproj
vs2019/xenvif/xenvif.vcxproj
vs2019/xenvif_coinst/xenvif_coinst.vcxproj

index 72f448db0c055972a5a17678521a76c3a1787cba..e38d2bfcd4320c3a02fc866b021bc2358f79c1ab 100644 (file)
@@ -1618,14 +1618,14 @@ __FrontendQueryStatistic(
 {
     ULONG                       Index;
 
-    ASSERT(Name < XENVIF_VIF_STATISTIC_COUNT);
+    ASSERT3U(Name, <, XENVIF_VIF_STATISTIC_COUNT);
 
     *Value = 0;
     for (Index = 0; Index < Frontend->StatisticsCount; Index++) {
         PXENVIF_FRONTEND_STATISTICS Statistics;
 
         Statistics = &Frontend->Statistics[Index];
-        *Value += Statistics->Value[Name];
+        *Value += Statistics->Value[(ULONG)Name];
     }
 }
 
@@ -1650,7 +1650,7 @@ FrontendIncrementStatistic(
     PXENVIF_FRONTEND_STATISTICS Statistics;
     KIRQL                       Irql;
 
-    ASSERT(Name < XENVIF_VIF_STATISTIC_COUNT);
+    ASSERT3U(Name, <, XENVIF_VIF_STATISTIC_COUNT);
 
     KeRaiseIrql(DISPATCH_LEVEL, &Irql);
 
@@ -1659,7 +1659,7 @@ FrontendIncrementStatistic(
     ASSERT3U(Index, <, Frontend->StatisticsCount);
     Statistics = &Frontend->Statistics[Index];
 
-    Statistics->Value[Name] += Delta;
+    Statistics->Value[(ULONG)Name] += Delta;
 
     KeLowerIrql(Irql);
 }
index a89904b0f72a6b92322eb7be30f8f7fd075ede14..82632714e5498350d7bcd2c9d519307ebde8eb8b 100644 (file)
@@ -1000,7 +1000,7 @@ MacSetFilterLevel(
     NTSTATUS                    status;
 
     status = STATUS_INVALID_PARAMETER;
-    if (Type >= ETHERNET_ADDRESS_TYPE_COUNT)
+    if ((ULONG)Type >= ETHERNET_ADDRESS_TYPE_COUNT)
         goto fail1;
 
     KeRaiseIrql(DISPATCH_LEVEL, &Irql);
@@ -1010,7 +1010,7 @@ MacSetFilterLevel(
     if (Level > XENVIF_MAC_FILTER_ALL || Level < XENVIF_MAC_FILTER_NONE)
         goto fail2;
 
-    Mac->FilterLevel[Type] = Level;
+    Mac->FilterLevel[(ULONG)Type] = Level;
 
     __MacReleaseLockExclusive(Mac);
     KeLowerIrql(Irql);
@@ -1040,13 +1040,13 @@ MacQueryFilterLevel(
     NTSTATUS                        status;
 
     status = STATUS_INVALID_PARAMETER;
-    if (Type >= ETHERNET_ADDRESS_TYPE_COUNT)
+    if ((ULONG)Type >= ETHERNET_ADDRESS_TYPE_COUNT)
         goto fail1;
 
     KeRaiseIrql(DISPATCH_LEVEL, &Irql);
     __MacAcquireLockShared(Mac);
 
-    *Level = Mac->FilterLevel[Type];
+    *Level = Mac->FilterLevel[(ULONG)Type];
 
     __MacReleaseLockShared(Mac);
     KeLowerIrql(Irql);
index 3aec237e9ec434989c9428350c7d01d2ee55ca5a..76f940c696083519340b0c11957ecb1be1ae20da 100644 (file)
     <IntDir>..\$(ProjectName)\$(ConfigurationName)\$(Platform)\</IntDir>
     <OutDir>..\$(ConfigurationName)\$(Platform)\</OutDir>
   </PropertyGroup>
+  <ItemDefinitionGroup>
+    <DriverSign>
+      <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
+    </DriverSign>
+  </ItemDefinitionGroup>
   <PropertyGroup Condition="'$(Platform)'=='Win32'">
     <ArchiveDir>..\..\$(SolutionName)\x86</ArchiveDir>
   </PropertyGroup>
index 9d149d0f10ddc29c5972308a6f2e0b2d1f1bacd2..b6ec6f3ecb0c85d51274e66bc8bff49e096e5d42 100644 (file)
   <Target Name="Build">
     <Exec Command="powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File $(Script) $(Platform) $(SolutionDir) $(IncludeDir) $(SourceDir)" />
   </Target>
+  <Target Name="GetProjectInfoForReference"
+          Returns="@(ProjectInfoForReference)">
+    <ItemGroup>
+      <ProjectInfoForReference Include="@(LibFullPath)" />
+    </ItemGroup>
+  </Target>
 </Project>
index 9aa14b2339fcb59c3a21a28beca7ea7ac416d4a5..c28271407ded7e43fce852b2ea289da91611fe8f 100644 (file)
@@ -24,7 +24,7 @@
       <PreprocessorDefinitions>PROJECT=$(ProjectName);POOL_NX_OPTIN=1;NT_PROCESSOR_GROUPS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <WarningLevel>EnableAllWarnings</WarningLevel>
-      <DisableSpecificWarnings>4464;4711;4770;4548;4820;4668;4255;5045;6001;6054;26451;28196;30030;30029;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      <DisableSpecificWarnings>4061;4464;4711;4770;4548;4820;4668;4255;5045;6001;6054;26451;28196;30030;30029;%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <EnablePREfast>true</EnablePREfast>
     </ClCompile>
@@ -36,6 +36,9 @@
       <AdditionalDependencies>$(DDK_LIB_PATH)/Rtlver.lib;$(DDK_LIB_PATH)/libcntpr.lib;$(DDK_LIB_PATH)/aux_klib.lib;$(DDK_LIB_PATH)/ksecdd.lib;$(DDK_LIB_PATH)/procgrp.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
     </Link>
+    <DriverSign>
+      <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
+    </DriverSign>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
     <ClCompile>
index 6957ad88c3a92fd0634bfdf8c47dce01906262c5..ccf41359316d61b37376f9846c3274a7be056511 100644 (file)
@@ -24,7 +24,7 @@
     <ClCompile>
       <PreprocessorDefinitions>PROJECT=$(ProjectName);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <WarningLevel>EnableAllWarnings</WarningLevel>
-      <DisableSpecificWarnings>4127;4548;4711;4820;4668;4255;5045;6001;6054;28196;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      <DisableSpecificWarnings>4127;4548;4711;4820;4668;4255;5045;6001;6054;26052;28196;%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <EnablePREfast>true</EnablePREfast>
       <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary>
@@ -34,6 +34,9 @@
       <ModuleDefinitionFile>../../src/coinst/xenvif_coinst.def</ModuleDefinitionFile>
       <AdditionalDependencies>setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
+    <DriverSign>
+      <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
+    </DriverSign>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
     <ClCompile>