aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-06-15 13:50:51 +0200
committerEgor Tensin <egor@tensin.name>2026-06-15 13:53:14 +0200
commitba493fec0bad1353ee42ab8a9783e4879cac1598 (patch)
tree12ffa1dc498058723664ced5f553d02c610b96a3
parentum: remove cmake-common (diff)
downloadwindows7-drivers-ba493fec0bad1353ee42ab8a9783e4879cac1598.tar.gz
windows7-drivers-ba493fec0bad1353ee42ab8a9783e4879cac1598.zip
km: add wdk10 build files & GitHub windows-2022 pipeline
-rw-r--r--.appveyor.yml11
-rw-r--r--.github/workflows/ci.yml54
-rw-r--r--km/build/wdk10/minimal/minimal.sln35
-rw-r--r--km/build/wdk10/minimal/minimal.vcxproj106
-rw-r--r--km/build/wdk10/nt_namespace/nt_namespace.sln35
-rw-r--r--km/build/wdk10/nt_namespace/nt_namespace.vcxproj129
-rw-r--r--km/build/wdk10/simple/simple.sln35
-rw-r--r--km/build/wdk10/simple/simple.vcxproj110
-rw-r--r--km/src/nt_namespace/main.c2
-rw-r--r--km/src/nt_namespace/nt2dos.c16
-rw-r--r--km/src/simple/device.c18
11 files changed, 532 insertions, 19 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
index bcfb6f6..8b3141b 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -2,18 +2,17 @@ version: '{build}'
image: Visual Studio 2013
-#environment:
-# APPVEYOR_RDP_PASSWORD: 'FooBar01!'
-
-#on_finish:
-# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
-
environment:
+ global:
+ APPVEYOR_RDP_PASSWORD: 'FooBar01!'
matrix:
- TARGET_OS: Win7
- TARGET_OS: Win8
- TARGET_OS: Win8.1
+#on_finish:
+# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
+
platform:
- Win32
- x64
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..d477b7b
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,54 @@
+name: CI
+
+on:
+ push:
+ workflow_dispatch:
+
+jobs:
+ build:
+ strategy:
+ matrix:
+ # As of June '26, WDK doesn't seem to be included in VS 2026 (windows-2026) images.
+ toolset: [vs2022]
+ platform: [x64]
+ configuration: [Debug, Release]
+ include:
+ - {toolset: vs2022, os: windows-2022}
+ runs-on: '${{ matrix.os }}'
+ name: 'Build: ${{ matrix.toolset }} / ${{ matrix.platform }} / ${{ matrix.configuration }}'
+ defaults:
+ run:
+ shell: pwsh
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+ with:
+ submodules: recursive
+ - name: Set up msbuild
+ uses: microsoft/setup-msbuild@v3
+ - name: Build user-mode code
+ run: |
+ New-Item -Type Directory build\cmake | Out-Null
+ cd build\cmake
+
+ cmake -A '${{ matrix.platform }}' `
+ '-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\build\install' `
+ '${{ github.workspace }}'
+
+ cmake --build . --target install --config '${{ matrix.configuration }}'
+ - name: Build kernel-mode code
+ run: |
+ .\scripts\build.ps1 `
+ -InstallDir build\install `
+ -Configuration '${{ matrix.configuration }}' `
+ -Platform '${{ matrix.platform }}' `
+ -WDK wdk10
+ - name: Run tests
+ run: |
+ .\scripts\test.ps1 -InstallDir build\install
+ - name: Publish artifact
+ uses: actions/upload-artifact@v7
+ with:
+ name: 'windows7-drivers-${{ matrix.platform }}-${{ matrix.configuration }}-Win10'
+ path: ./build/install/
+ if-no-files-found: error
diff --git a/km/build/wdk10/minimal/minimal.sln b/km/build/wdk10/minimal/minimal.sln
new file mode 100644
index 0000000..497300c
--- /dev/null
+++ b/km/build/wdk10/minimal/minimal.sln
@@ -0,0 +1,35 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.14.36623.8 d17.14
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minimal", "minimal.vcxproj", "{FB005505-E2A5-87EB-16C4-01EB3DE7A4EE}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM64 = Debug|ARM64
+ Debug|x64 = Debug|x64
+ Release|ARM64 = Release|ARM64
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {FB005505-E2A5-87EB-16C4-01EB3DE7A4EE}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {FB005505-E2A5-87EB-16C4-01EB3DE7A4EE}.Debug|ARM64.Build.0 = Debug|ARM64
+ {FB005505-E2A5-87EB-16C4-01EB3DE7A4EE}.Debug|ARM64.Deploy.0 = Debug|ARM64
+ {FB005505-E2A5-87EB-16C4-01EB3DE7A4EE}.Debug|x64.ActiveCfg = Debug|x64
+ {FB005505-E2A5-87EB-16C4-01EB3DE7A4EE}.Debug|x64.Build.0 = Debug|x64
+ {FB005505-E2A5-87EB-16C4-01EB3DE7A4EE}.Debug|x64.Deploy.0 = Debug|x64
+ {FB005505-E2A5-87EB-16C4-01EB3DE7A4EE}.Release|ARM64.ActiveCfg = Release|ARM64
+ {FB005505-E2A5-87EB-16C4-01EB3DE7A4EE}.Release|ARM64.Build.0 = Release|ARM64
+ {FB005505-E2A5-87EB-16C4-01EB3DE7A4EE}.Release|ARM64.Deploy.0 = Release|ARM64
+ {FB005505-E2A5-87EB-16C4-01EB3DE7A4EE}.Release|x64.ActiveCfg = Release|x64
+ {FB005505-E2A5-87EB-16C4-01EB3DE7A4EE}.Release|x64.Build.0 = Release|x64
+ {FB005505-E2A5-87EB-16C4-01EB3DE7A4EE}.Release|x64.Deploy.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {144E8B3A-EC28-410C-A9E9-161914DFD3B3}
+ EndGlobalSection
+EndGlobal
diff --git a/km/build/wdk10/minimal/minimal.vcxproj b/km/build/wdk10/minimal/minimal.vcxproj
new file mode 100644
index 0000000..7a693cd
--- /dev/null
+++ b/km/build/wdk10/minimal/minimal.vcxproj
@@ -0,0 +1,106 @@
+<?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>
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{FB005505-E2A5-87EB-16C4-01EB3DE7A4EE}</ProjectGuid>
+ <TemplateGuid>{dd38f7fc-d7bd-488b-9242-7d8754cde80d}</TemplateGuid>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
+ <Configuration>Debug</Configuration>
+ <Platform Condition="'$(Platform)' == ''">x64</Platform>
+ <RootNamespace>minimal</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ <DriverType>WDM</DriverType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ <DriverType>WDM</DriverType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ <DriverType>WDM</DriverType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</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>
+ <OutDir>bin\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</OutDir>
+ <IntDir>obj\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
+ <OutDir>bin\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</OutDir>
+ <IntDir>obj\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
+ <OutDir>bin\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</OutDir>
+ <IntDir>obj\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
+ <OutDir>bin\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</OutDir>
+ <IntDir>obj\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <DriverSign>
+ <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
+ </DriverSign>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <DriverSign>
+ <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
+ </DriverSign>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <FilesToPackage Include="$(TargetPath)" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\src\minimal\main.c" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
diff --git a/km/build/wdk10/nt_namespace/nt_namespace.sln b/km/build/wdk10/nt_namespace/nt_namespace.sln
new file mode 100644
index 0000000..1660617
--- /dev/null
+++ b/km/build/wdk10/nt_namespace/nt_namespace.sln
@@ -0,0 +1,35 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.14.36623.8 d17.14
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nt_namespace", "nt_namespace.vcxproj", "{CEECBBBD-A5A8-440B-9DDB-1EAA9BD485D9}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM64 = Debug|ARM64
+ Debug|x64 = Debug|x64
+ Release|ARM64 = Release|ARM64
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {CEECBBBD-A5A8-440B-9DDB-1EAA9BD485D9}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {CEECBBBD-A5A8-440B-9DDB-1EAA9BD485D9}.Debug|ARM64.Build.0 = Debug|ARM64
+ {CEECBBBD-A5A8-440B-9DDB-1EAA9BD485D9}.Debug|ARM64.Deploy.0 = Debug|ARM64
+ {CEECBBBD-A5A8-440B-9DDB-1EAA9BD485D9}.Debug|x64.ActiveCfg = Debug|x64
+ {CEECBBBD-A5A8-440B-9DDB-1EAA9BD485D9}.Debug|x64.Build.0 = Debug|x64
+ {CEECBBBD-A5A8-440B-9DDB-1EAA9BD485D9}.Debug|x64.Deploy.0 = Debug|x64
+ {CEECBBBD-A5A8-440B-9DDB-1EAA9BD485D9}.Release|ARM64.ActiveCfg = Release|ARM64
+ {CEECBBBD-A5A8-440B-9DDB-1EAA9BD485D9}.Release|ARM64.Build.0 = Release|ARM64
+ {CEECBBBD-A5A8-440B-9DDB-1EAA9BD485D9}.Release|ARM64.Deploy.0 = Release|ARM64
+ {CEECBBBD-A5A8-440B-9DDB-1EAA9BD485D9}.Release|x64.ActiveCfg = Release|x64
+ {CEECBBBD-A5A8-440B-9DDB-1EAA9BD485D9}.Release|x64.Build.0 = Release|x64
+ {CEECBBBD-A5A8-440B-9DDB-1EAA9BD485D9}.Release|x64.Deploy.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {144E8B3A-EC28-410C-A9E9-161914DFD3B3}
+ EndGlobalSection
+EndGlobal
diff --git a/km/build/wdk10/nt_namespace/nt_namespace.vcxproj b/km/build/wdk10/nt_namespace/nt_namespace.vcxproj
new file mode 100644
index 0000000..e760451
--- /dev/null
+++ b/km/build/wdk10/nt_namespace/nt_namespace.vcxproj
@@ -0,0 +1,129 @@
+<?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>
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{CEECBBBD-A5A8-440B-9DDB-1EAA9BD485D9}</ProjectGuid>
+ <TemplateGuid>{dd38f7fc-d7bd-488b-9242-7d8754cde80d}</TemplateGuid>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
+ <Configuration>Debug</Configuration>
+ <Platform Condition="'$(Platform)' == ''">x64</Platform>
+ <RootNamespace>nt_namespace</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ <DriverType>WDM</DriverType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ <DriverType>WDM</DriverType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ <DriverType>WDM</DriverType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</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>
+ <OutDir>bin\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</OutDir>
+ <IntDir>obj\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
+ <OutDir>bin\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</OutDir>
+ <IntDir>obj\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
+ <OutDir>bin\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</OutDir>
+ <IntDir>obj\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
+ <OutDir>bin\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</OutDir>
+ <IntDir>obj\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <DriverSign>
+ <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
+ </DriverSign>
+ <ClCompile>
+ <PreprocessorDefinitions>POOL_ZERO_DOWN_LEVEL_SUPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <DriverSign>
+ <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
+ </DriverSign>
+ <ClCompile>
+ <PreprocessorDefinitions>POOL_ZERO_DOWN_LEVEL_SUPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <ClCompile>
+ <PreprocessorDefinitions>POOL_ZERO_DOWN_LEVEL_SUPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <ClCompile>
+ <PreprocessorDefinitions>POOL_ZERO_DOWN_LEVEL_SUPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <FilesToPackage Include="$(TargetPath)" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\src\nt_namespace\control_codes.h" />
+ <ClInclude Include="..\..\..\src\nt_namespace\device.h" />
+ <ClInclude Include="..\..\..\src\nt_namespace\nt2dos.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\src\nt_namespace\device.c" />
+ <ClCompile Include="..\..\..\src\nt_namespace\main.c" />
+ <ClCompile Include="..\..\..\src\nt_namespace\nt2dos.c" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
diff --git a/km/build/wdk10/simple/simple.sln b/km/build/wdk10/simple/simple.sln
new file mode 100644
index 0000000..004e2f9
--- /dev/null
+++ b/km/build/wdk10/simple/simple.sln
@@ -0,0 +1,35 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.14.36623.8 d17.14
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simple", "simple.vcxproj", "{C6B5FBE6-9E32-4006-873A-8A7091D9D992}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM64 = Debug|ARM64
+ Debug|x64 = Debug|x64
+ Release|ARM64 = Release|ARM64
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {C6B5FBE6-9E32-4006-873A-8A7091D9D992}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {C6B5FBE6-9E32-4006-873A-8A7091D9D992}.Debug|ARM64.Build.0 = Debug|ARM64
+ {C6B5FBE6-9E32-4006-873A-8A7091D9D992}.Debug|ARM64.Deploy.0 = Debug|ARM64
+ {C6B5FBE6-9E32-4006-873A-8A7091D9D992}.Debug|x64.ActiveCfg = Debug|x64
+ {C6B5FBE6-9E32-4006-873A-8A7091D9D992}.Debug|x64.Build.0 = Debug|x64
+ {C6B5FBE6-9E32-4006-873A-8A7091D9D992}.Debug|x64.Deploy.0 = Debug|x64
+ {C6B5FBE6-9E32-4006-873A-8A7091D9D992}.Release|ARM64.ActiveCfg = Release|ARM64
+ {C6B5FBE6-9E32-4006-873A-8A7091D9D992}.Release|ARM64.Build.0 = Release|ARM64
+ {C6B5FBE6-9E32-4006-873A-8A7091D9D992}.Release|ARM64.Deploy.0 = Release|ARM64
+ {C6B5FBE6-9E32-4006-873A-8A7091D9D992}.Release|x64.ActiveCfg = Release|x64
+ {C6B5FBE6-9E32-4006-873A-8A7091D9D992}.Release|x64.Build.0 = Release|x64
+ {C6B5FBE6-9E32-4006-873A-8A7091D9D992}.Release|x64.Deploy.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {144E8B3A-EC28-410C-A9E9-161914DFD3B3}
+ EndGlobalSection
+EndGlobal
diff --git a/km/build/wdk10/simple/simple.vcxproj b/km/build/wdk10/simple/simple.vcxproj
new file mode 100644
index 0000000..bbb6070
--- /dev/null
+++ b/km/build/wdk10/simple/simple.vcxproj
@@ -0,0 +1,110 @@
+<?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>
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{C6B5FBE6-9E32-4006-873A-8A7091D9D992}</ProjectGuid>
+ <TemplateGuid>{dd38f7fc-d7bd-488b-9242-7d8754cde80d}</TemplateGuid>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
+ <Configuration>Debug</Configuration>
+ <Platform Condition="'$(Platform)' == ''">x64</Platform>
+ <RootNamespace>simple</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ <DriverType>WDM</DriverType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ <DriverType>WDM</DriverType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ <DriverType>WDM</DriverType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</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>
+ <OutDir>bin\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</OutDir>
+ <IntDir>obj\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
+ <OutDir>bin\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</OutDir>
+ <IntDir>obj\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
+ <OutDir>bin\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</OutDir>
+ <IntDir>obj\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
+ <OutDir>bin\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</OutDir>
+ <IntDir>obj\$(TargetVersion)\$(PlatformShortName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <DriverSign>
+ <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
+ </DriverSign>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <DriverSign>
+ <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
+ </DriverSign>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <FilesToPackage Include="$(TargetPath)" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\src\simple\device.c" />
+ <ClCompile Include="..\..\..\src\simple\main.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\src\simple\device.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
diff --git a/km/src/nt_namespace/main.c b/km/src/nt_namespace/main.c
index a1c08e8..4c7ef74 100644
--- a/km/src/nt_namespace/main.c
+++ b/km/src/nt_namespace/main.c
@@ -22,6 +22,8 @@ NTSTATUS DriverEntry(
{
UNREFERENCED_PARAMETER(registry_path);
+ ExInitializeDriverRuntime(DrvRtPoolNxOptIn);
+
driver_object->DriverUnload = on_driver_unload;
return set_up_devices(driver_object);
}
diff --git a/km/src/nt_namespace/nt2dos.c b/km/src/nt_namespace/nt2dos.c
index d1bdb3d..be2c2f5 100644
--- a/km/src/nt_namespace/nt2dos.c
+++ b/km/src/nt_namespace/nt2dos.c
@@ -9,6 +9,15 @@
#include "nt2dos.h"
+static PVOID allocate(SIZE_T nb)
+{
+#if !defined(NTDDI_WIN10) || NTDDI_VERSION < NTDDI_WIN10
+ return ExAllocatePoolWithTag(PagedPool, nb, '1l');
+#else
+ return ExAllocatePoolQuotaZero(PagedPool, nb, '1l');
+#endif
+}
+
static NTSTATUS get_object_name_info(
void *object,
OBJECT_NAME_INFORMATION **object_name_info)
@@ -21,7 +30,7 @@ static NTSTATUS get_object_name_info(
if (status != STATUS_INFO_LENGTH_MISMATCH)
return status;
- *object_name_info = ExAllocatePoolWithTag(PagedPool, nbneeded, '1l');
+ *object_name_info = allocate(nbneeded);
if (*object_name_info == NULL)
return STATUS_INSUFFICIENT_RESOURCES;
@@ -92,8 +101,7 @@ NTSTATUS nt2dos(UNICODE_STRING *u_resolved, UNICODE_STRING *u_unresolved)
if (file_object->Vpb == NULL)
{
- u_resolved->Buffer = ExAllocatePoolWithTag(
- PagedPool, file_name_info->Name.Length, '1l');
+ u_resolved->Buffer = allocate(file_name_info->Name.Length);
if (u_resolved->Buffer == NULL)
{
@@ -120,7 +128,7 @@ NTSTATUS nt2dos(UNICODE_STRING *u_resolved, UNICODE_STRING *u_unresolved)
u_resolved_size = file_name_info->Name.Length - volume_name_info->Name.Length + u_dos_name.Length;
- u_resolved->Buffer = ExAllocatePoolWithTag(PagedPool, u_resolved_size, '1l');
+ u_resolved->Buffer = allocate(u_resolved_size);
if (u_resolved->Buffer == NULL)
{
diff --git a/km/src/simple/device.c b/km/src/simple/device.c
index 859ba67..f632a8d 100644
--- a/km/src/simple/device.c
+++ b/km/src/simple/device.c
@@ -43,7 +43,7 @@ static NTSTATUS handle_say_hello(
return STATUS_SUCCESS;
}
-static unsigned int i = 42;
+static unsigned int num = 42;
static NTSTATUS handle_exchange_ints(
void *in_buf,
@@ -52,20 +52,20 @@ static NTSTATUS handle_exchange_ints(
unsigned long out_buf_size,
ULONG_PTR *nbwritten)
{
- unsigned int temp_i;
+ unsigned int temp_num;
- if (in_buf_size != sizeof(temp_i))
+ if (in_buf_size != sizeof(temp_num))
return STATUS_INVALID_BUFFER_SIZE;
- RtlCopyMemory(&temp_i, in_buf, in_buf_size);
- DbgPrint("%08x\n", temp_i);
+ RtlCopyMemory(&temp_num, in_buf, in_buf_size);
+ DbgPrint("%08x\n", temp_num);
- if (out_buf_size < sizeof(i))
+ if (out_buf_size < sizeof(num))
return STATUS_BUFFER_TOO_SMALL;
- RtlCopyMemory(out_buf, &i, sizeof(i));
- *nbwritten += sizeof(i);
- i = temp_i;
+ RtlCopyMemory(out_buf, &num, sizeof(num));
+ *nbwritten += sizeof(num);
+ num = temp_num;
return STATUS_SUCCESS;
}