Skip to content

Commit

Permalink
add initial version of C-only interface, hvpp.h
Browse files Browse the repository at this point in the history
add example of how to use this interface (hvppdrv_c)
  • Loading branch information
wbenny committed Oct 23, 2018
1 parent 6e182b3 commit eee6513
Show file tree
Hide file tree
Showing 22 changed files with 2,610 additions and 24 deletions.
18 changes: 18 additions & 0 deletions hvpp.sln
Expand Up @@ -14,6 +14,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hvppdrv", "src\hvppdrv\hvpp
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hvppctrl", "src\hvppctrl\hvppctrl.vcxproj", "{A72DAEF5-C739-4E70-B57E-4310ABA03749}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hvpp-entry", "src\hvpp\hvpp-entry.vcxproj", "{D16E66B1-31BC-465F-916E-430803FFDE99}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "hvpp-lib", "hvpp-lib", "{AD8F16CD-1F36-4BF7-91FF-E04713C7EC63}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hvppdrv_c", "src\hvppdrv_c\hvppdrv_c.vcxproj", "{9D8BC3BA-1749-4974-9BEC-00231849A63C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand All @@ -32,10 +38,22 @@ Global
{A72DAEF5-C739-4E70-B57E-4310ABA03749}.Debug|x64.Build.0 = Debug|x64
{A72DAEF5-C739-4E70-B57E-4310ABA03749}.Release|x64.ActiveCfg = Release|x64
{A72DAEF5-C739-4E70-B57E-4310ABA03749}.Release|x64.Build.0 = Release|x64
{D16E66B1-31BC-465F-916E-430803FFDE99}.Debug|x64.ActiveCfg = Debug|x64
{D16E66B1-31BC-465F-916E-430803FFDE99}.Debug|x64.Build.0 = Debug|x64
{D16E66B1-31BC-465F-916E-430803FFDE99}.Release|x64.ActiveCfg = Release|x64
{D16E66B1-31BC-465F-916E-430803FFDE99}.Release|x64.Build.0 = Release|x64
{9D8BC3BA-1749-4974-9BEC-00231849A63C}.Debug|x64.ActiveCfg = Debug|x64
{9D8BC3BA-1749-4974-9BEC-00231849A63C}.Debug|x64.Build.0 = Debug|x64
{9D8BC3BA-1749-4974-9BEC-00231849A63C}.Release|x64.ActiveCfg = Release|x64
{9D8BC3BA-1749-4974-9BEC-00231849A63C}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{2FC6C155-2BDF-4761-B9B5-7DFE9C2BB4F4} = {AD8F16CD-1F36-4BF7-91FF-E04713C7EC63}
{D16E66B1-31BC-465F-916E-430803FFDE99} = {AD8F16CD-1F36-4BF7-91FF-E04713C7EC63}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B2F42D07-8CF5-40C5-924F-6EAB82D9ABF0}
EndGlobalSection
Expand Down
111 changes: 111 additions & 0 deletions src/hvpp/hvpp-entry.vcxproj
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{D16E66B1-31BC-465F-916E-430803FFDE99}</ProjectGuid>
<TemplateGuid>{1bc93793-694f-48fe-9372-81e2b05556fd}</TemplateGuid>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
<Configuration>Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
<RootNamespace>hvpp-entry</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>StaticLibrary</ConfigurationType>
<DriverType>WDM</DriverType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>StaticLibrary</ConfigurationType>
<DriverType>WDM</DriverType>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<IncludePath>$(ProjectDir);$(VC_IncludePath);$(IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH)</IncludePath>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)bin\obj\$(PlatformShortName)\$(Configuration)\$(ProjectName)\</IntDir>
<EnableInf2cat>false</EnableInf2cat>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<IncludePath>$(ProjectDir);$(VC_IncludePath);$(IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH)</IncludePath>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)bin\obj\$(PlatformShortName)\$(Configuration)\$(ProjectName)\</IntDir>
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
<EnableInf2cat>false</EnableInf2cat>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<DisableSpecificWarnings>4201;4748;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<LanguageStandard>stdcpplatest</LanguageStandard>
<ObjectFileName>$(IntDir)%(RelativeDir)%(Filename)%(Extension).obj</ObjectFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<SupportJustMyCode>false</SupportJustMyCode>
</ClCompile>
<Inf />
<MASM />
<Link>
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
</Link>
<PostBuildEvent />
<Lib />
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<DisableSpecificWarnings>4201;4603;4627;4986;4987;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<LanguageStandard>stdcpplatest</LanguageStandard>
<ObjectFileName>$(IntDir)%(RelativeDir)%(Filename)%(Extension).obj</ObjectFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<WholeProgramOptimization>true</WholeProgramOptimization>
</ClCompile>
<Inf />
<MASM />
<Link>
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
<PostBuildEvent />
<Lib>
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<FilesToPackage Include="$(TargetPath)" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="hvpp\lib\win32\driver.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="hvpp.vcxproj">
<Project>{2fc6c155-2bdf-4761-b9b5-7dfe9c2bb4f4}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
31 changes: 31 additions & 0 deletions src/hvpp/hvpp-entry.vcxproj.filters
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Source Files\hvpp">
<UniqueIdentifier>{6e4d9600-74cd-4df7-a644-8958c9188801}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\hvpp\lib">
<UniqueIdentifier>{621e920d-d9e9-47e9-a5de-aa77f6d02d7c}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\hvpp\lib\win32">
<UniqueIdentifier>{9672ddae-e529-45ac-bb8b-049cf5f33c1b}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="hvpp\lib\win32\driver.cpp">
<Filter>Source Files\hvpp\lib\win32</Filter>
</ClCompile>
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions src/hvpp/hvpp-entry.vcxproj.user
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
5 changes: 4 additions & 1 deletion src/hvpp/hvpp.vcxproj
Expand Up @@ -99,12 +99,14 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="hvpp\ept.cpp" />
<ClCompile Include="hvpp\hvpp.cpp" />
<ClCompile Include="hvpp\hypervisor.cpp" />
<ClCompile Include="hvpp\vcpu.cpp" />
<ClCompile Include="hvpp\vmexit.cpp">
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)/$(RelativeDir)/%(Filename)%(Extension).obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)/$(RelativeDir)/%(Filename)%(Extension).obj</ObjectFileName>
</ClCompile>
<ClCompile Include="hvpp\vmexit\vmexit_c_wrapper.cpp" />
<ClCompile Include="hvpp\vmexit\vmexit_dbgbreak.cpp" />
<ClCompile Include="hvpp\vmexit\vmexit_passthrough.cpp" />
<ClCompile Include="hvpp\vmexit\vmexit_stats.cpp" />
Expand All @@ -117,13 +119,13 @@
<ClCompile Include="hvpp\lib\win32\cr3_guard.cpp" />
<ClCompile Include="hvpp\lib\win32\debugger.cpp" />
<ClCompile Include="hvpp\lib\win32\device.cpp" />
<ClCompile Include="hvpp\lib\win32\driver.cpp" />
<ClCompile Include="hvpp\lib\win32\log.cpp" />
<ClCompile Include="hvpp\lib\win32\mm.cpp" />
<ClCompile Include="hvpp\lib\win32\mp.cpp" />
<ClCompile Include="hvpp\lib\win32\tracelog.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="hvpp\hvpp.h" />
<ClInclude Include="hvpp\lib\debugger.h" />
<ClInclude Include="hvpp\lib\device.h" />
<ClInclude Include="hvpp\lib\ioctl.h" />
Expand All @@ -132,6 +134,7 @@
<ClInclude Include="hvpp\hypervisor.h" />
<ClInclude Include="hvpp\vcpu.h" />
<ClInclude Include="hvpp\vmexit.h" />
<ClInclude Include="hvpp\vmexit\vmexit_c_wrapper.h" />
<ClInclude Include="hvpp\vmexit\vmexit_dbgbreak.h" />
<ClInclude Include="hvpp\vmexit\vmexit_passthrough.h" />
<ClInclude Include="hvpp\vmexit\vmexit_stats.h" />
Expand Down
15 changes: 12 additions & 3 deletions src/hvpp/hvpp.vcxproj.filters
Expand Up @@ -108,9 +108,6 @@
<ClCompile Include="hvpp\lib\win32\mm.cpp">
<Filter>Source Files\hvpp\lib\win32</Filter>
</ClCompile>
<ClCompile Include="hvpp\lib\win32\driver.cpp">
<Filter>Source Files\hvpp\lib\win32</Filter>
</ClCompile>
<ClCompile Include="hvpp\lib\driver.cpp">
<Filter>Source Files\hvpp\lib</Filter>
</ClCompile>
Expand All @@ -132,6 +129,12 @@
<ClCompile Include="hvpp\lib\win32\device.cpp">
<Filter>Source Files\hvpp\lib\win32</Filter>
</ClCompile>
<ClCompile Include="hvpp\hvpp.cpp">
<Filter>Source Files\hvpp</Filter>
</ClCompile>
<ClCompile Include="hvpp\vmexit\vmexit_c_wrapper.cpp">
<Filter>Source Files\hvpp\vmexit</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="hvpp\lib\bitmap.h">
Expand Down Expand Up @@ -290,6 +293,12 @@
<ClInclude Include="hvpp\lib\ioctl.h">
<Filter>Header Files\hvpp\lib</Filter>
</ClInclude>
<ClInclude Include="hvpp\hvpp.h">
<Filter>Header Files\hvpp</Filter>
</ClInclude>
<ClInclude Include="hvpp\vmexit\vmexit_c_wrapper.h">
<Filter>Header Files\hvpp\vmexit</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<MASM Include="hvpp\ia32\context.asm">
Expand Down

0 comments on commit eee6513

Please sign in to comment.