Skip to content

Commit

Permalink
Work around analysis warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Thaler <[email protected]>
  • Loading branch information
dthaler committed Aug 10, 2023
1 parent 3f499af commit d6f1445
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 5 deletions.
9 changes: 5 additions & 4 deletions ebpfcore/usersim/EbpfCore_Usersim.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<PreprocessorDefinitions>%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
</ResourceCompile>
<ClCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(WindowsSdkDir)Include\10.0.22621.0\km;$(WindowsSdkDir)Include\wdf\kmdf\1.15;$(SolutionDir)include;$(SolutionDir)libs\platform;$(SolutionDir)libs\platform\kernel;$(SolutionDir)libs\execution_context;$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\kernel;$(SolutionDir)resource</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories);$(WindowsSdkDir)Include\10.0.22621.0\km;$(WindowsSdkDir)Include\wdf\kmdf\1.15;$(SolutionDir)include;$(SolutionDir)libs\platform;$(SolutionDir)libs\platform\kernel;$(SolutionDir)libs\execution_context;$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\kernel;$(SolutionDir)resource</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32_WINNT=0x0a00;%(PreprocessorDefinitions);_AMD64_;BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
<ExceptionHandling>
</ExceptionHandling>
Expand All @@ -141,7 +141,7 @@
<PreprocessorDefinitions>%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
</ResourceCompile>
<ClCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(WindowsSdkDir)Include\10.0.22621.0\km;$(WindowsSdkDir)Include\wdf\kmdf\1.15;$(SolutionDir)include;$(SolutionDir)libs\platform;$(SolutionDir)libs\platform\kernel;$(SolutionDir)libs\execution_context;$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\kernel;$(SolutionDir)resource</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories);$(WindowsSdkDir)Include\10.0.22621.0\km;$(WindowsSdkDir)Include\wdf\kmdf\1.15;$(SolutionDir)include;$(SolutionDir)libs\platform;$(SolutionDir)libs\platform\kernel;$(SolutionDir)libs\execution_context;$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\kernel;$(SolutionDir)resource</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32_WINNT=0x0a00;%(PreprocessorDefinitions);_AMD64_;BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
<ExceptionHandling>
</ExceptionHandling>
Expand All @@ -166,7 +166,7 @@
<PreprocessorDefinitions>%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
</ResourceCompile>
<ClCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(WindowsSdkDir)Include\10.0.22621.0\km;$(WindowsSdkDir)Include\wdf\kmdf\1.15;$(SolutionDir)include;$(SolutionDir)libs\platform;$(SolutionDir)libs\platform\kernel;$(SolutionDir)libs\execution_context;$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\kernel;$(SolutionDir)resource</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories);$(WindowsSdkDir)Include\10.0.22621.0\km;$(WindowsSdkDir)Include\wdf\kmdf\1.15;$(SolutionDir)include;$(SolutionDir)libs\platform;$(SolutionDir)libs\platform\kernel;$(SolutionDir)libs\execution_context;$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\kernel;$(SolutionDir)resource</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32_WINNT=0x0a00;%(PreprocessorDefinitions);_AMD64_;BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
<ExceptionHandling>
</ExceptionHandling>
Expand All @@ -191,7 +191,7 @@
<PreprocessorDefinitions>%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
</ResourceCompile>
<ClCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(WindowsSdkDir)Include\10.0.22621.0\km;$(WindowsSdkDir)Include\wdf\kmdf\1.15;$(SolutionDir)include;$(SolutionDir)libs\platform;$(SolutionDir)libs\platform\kernel;$(SolutionDir)libs\execution_context;$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\kernel;$(SolutionDir)resource</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories);$(WindowsSdkDir)Include\10.0.22621.0\km;$(WindowsSdkDir)Include\wdf\kmdf\1.15;$(SolutionDir)include;$(SolutionDir)libs\platform;$(SolutionDir)libs\platform\kernel;$(SolutionDir)libs\execution_context;$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\kernel;$(SolutionDir)resource</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32_WINNT=0x0a00;%(PreprocessorDefinitions);_AMD64_;BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
<ExceptionHandling>
</ExceptionHandling>
Expand Down Expand Up @@ -240,6 +240,7 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\resource.h" />
<ClInclude Include="ntddk.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\resource\ebpf_resource.rc" />
Expand Down
5 changes: 4 additions & 1 deletion ebpfcore/usersim/EbpfCore_Usersim.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@
<ClInclude Include="..\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ntddk.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\resource\ebpf_resource.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
</Project>
15 changes: 15 additions & 0 deletions ebpfcore/usersim/ntddk.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) Microsoft Corporation
// SPDX-License-Identifier: MIT

// The system headers generate lots of warnings, so disable those around the ntddk.h inclusion.
// TODO(https://github.com/microsoft/usersim/issues/79): move this file to usersim
#pragma warning(push)
#pragma warning(disable : 6387)
#pragma warning(disable : 28160)
#pragma warning(disable : 28230)
#pragma warning(disable : 28252)
#pragma warning(disable : 28253)
#pragma warning(disable : 28285)
#pragma warning(disable : 28301)
#include "../km/ntddk.h"
#pragma warning(pop)
8 changes: 8 additions & 0 deletions installer/ebpf-for-windows.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ SPDX-License-Identifier: MIT
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Include="..\ebpfcore\usersim\EbpfCore_Usersim.vcxproj">
<Name>EbpfCore_Usersim</Name>
<Project>{1fdad2fd-ebd8-462a-b285-ed5174e55079}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Condition="'$(Configuration)' == 'Debug' Or '$(Configuration)' == 'Release'" Include="..\ebpfsvc\eBPFSvc.vcxproj">
<Name>ebpfsvc</Name>
<Project>{ba065b6a-38f8-4197-8f66-87c84afad513}</Project>
Expand Down
3 changes: 3 additions & 0 deletions libs/platform/kernel/framework.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
#include <ntifs.h>
#include <netioddk.h>
#include <ntddk.h>
#pragma warning(push)
#pragma warning(disable : 28196) // Inconsistent annotation for '_umul128'
#include <ntstrsafe.h>
#pragma warning(pop)
#include <stdint.h>
#include <wdm.h>

Expand Down

0 comments on commit d6f1445

Please sign in to comment.