From 7688bb5b925774bcc557cf95caf18522640de3c1 Mon Sep 17 00:00:00 2001 From: IChooseYou Date: Sat, 14 Mar 2026 05:40:24 -0600 Subject: [PATCH] ci: add SDK include paths for WDK NuGet driver build NuGet splits WDK and SDK into separate packages. specstrings.h lives in the SDK shared headers. Add SDK_INC_ROOT for shared/ucrt. --- .github/workflows/build.yml | 6 ++++++ plugins/KernelMemory/driver/build_driver.bat | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d76111b..b617450 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,6 +60,12 @@ jobs: $libRoot = Split-Path (Split-Path $ntos.DirectoryName -Parent) -Parent Write-Host "WDK lib root: $libRoot" echo "WDK_LIB_ROOT=$libRoot" >> $env:GITHUB_ENV + $specstr = Get-ChildItem wdk_pkg -Recurse -Filter "specstrings.h" | + Select-Object -First 1 + if (!$specstr) { throw "specstrings.h not found in SDK NuGet package" } + $sdkIncRoot = Split-Path $specstr.DirectoryName -Parent + Write-Host "SDK include root: $sdkIncRoot" + echo "SDK_INC_ROOT=$sdkIncRoot" >> $env:GITHUB_ENV - name: Build kernel driver shell: cmd diff --git a/plugins/KernelMemory/driver/build_driver.bat b/plugins/KernelMemory/driver/build_driver.bat index e6f322f..9416910 100644 --- a/plugins/KernelMemory/driver/build_driver.bat +++ b/plugins/KernelMemory/driver/build_driver.bat @@ -18,6 +18,8 @@ if not defined MSVC ( ) :: ── Auto-detect WDK (override with WDK_INC_ROOT and WDK_LIB_ROOT env vars) ── +:: SDK_INC_ROOT is optional; when WDK is installed traditionally, SDK shared +:: headers live alongside WDK headers. NuGet splits them into a separate package. if not defined WDK_INC_ROOT ( set "WDK=C:\Program Files (x86)\Windows Kits\10" set WDKVER= @@ -33,10 +35,15 @@ if not defined WDK_INC_ROOT ( ) set "WDK_INC_ROOT=!WDK!\Include\!WDKVER!" set "WDK_LIB_ROOT=!WDK!\Lib\!WDKVER!" + set "SDK_INC_ROOT=!WDK!\Include\!WDKVER!" ) +:: If SDK_INC_ROOT not set, default to WDK_INC_ROOT (traditional install has both) +if not defined SDK_INC_ROOT set "SDK_INC_ROOT=%WDK_INC_ROOT%" + echo Using MSVC: %MSVC% echo Using WDK inc: %WDK_INC_ROOT% +echo Using SDK inc: %SDK_INC_ROOT% echo Using WDK lib: %WDK_LIB_ROOT% set "CL_EXE=%MSVC%\bin\Hostx64\x64\cl.exe" @@ -54,6 +61,8 @@ echo === Compiling rcxdrv.c === /I "%WDK_INC_ROOT%\km" ^ /I "%WDK_INC_ROOT%\km\crt" ^ /I "%WDK_INC_ROOT%\shared" ^ + /I "%SDK_INC_ROOT%\shared" ^ + /I "%SDK_INC_ROOT%\ucrt" ^ /kernel ^ /Fo"%OUTDIR%\rcxdrv.obj" ^ "%SRCDIR%rcxdrv.c"