Skip to content

Commit 12ceed1

Browse files
Vendor UMDF header and update CI workflows
Added Windows Driver Frameworks UMDF header (wudfwdm.h) under ThirdParty to ensure CI builds work on runners missing Windows Kits/WDK. Removed PowerShell logic from CI workflows that attempted to locate or install UMDF headers, and updated MSBuild invocations to no longer depend on custom environment variables for SDK paths.
1 parent ea8c879 commit 12ceed1

File tree

6 files changed

+1690
-246
lines changed

6 files changed

+1690
-246
lines changed

.github/workflows/build-and-sign-sequential.yml

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -39,102 +39,6 @@ jobs:
3939
# Setup build environment
4040
- name: Setup MSBuild
4141
uses: microsoft/setup-msbuild@v2
42-
43-
- name: Ensure UMDF headers (wudfwdm.h) are available
44-
shell: pwsh
45-
run: |
46-
$ErrorActionPreference = "Stop"
47-
48-
function Get-KitsRoot10 {
49-
try {
50-
return (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots" -Name "KitsRoot10" -ErrorAction Stop).KitsRoot10
51-
} catch {
52-
return (Join-Path ${env:ProgramFiles(x86)} "Windows Kits\10\")
53-
}
54-
}
55-
56-
function Find-UmdfHeader([string]$kitsRoot) {
57-
$includeRoot = Join-Path $kitsRoot "Include"
58-
if (-not (Test-Path $includeRoot)) { return $null }
59-
60-
# Some runners lay WDK headers out as:
61-
# Include\wdf\umdf\wudfwdm.h
62-
# Others as:
63-
# Include\<version>\wdf\umdf\wudfwdm.h
64-
$flatHeader = Join-Path $includeRoot "wdf\umdf\wudfwdm.h"
65-
66-
$versionDirs =
67-
Get-ChildItem -Path $includeRoot -Directory -ErrorAction SilentlyContinue |
68-
Where-Object { $_.Name -match '^\d+\.\d+\.\d+\.\d+$' } |
69-
Sort-Object -Property Name -Descending
70-
71-
$bestVersion = $versionDirs | Select-Object -First 1
72-
$bestWithHeader =
73-
$versionDirs |
74-
Where-Object { Test-Path (Join-Path $_.FullName "wdf\umdf\wudfwdm.h") } |
75-
Select-Object -First 1
76-
77-
if (Test-Path $flatHeader) {
78-
return [PSCustomObject]@{
79-
WindowsSdkDir = $kitsRoot
80-
WindowsTargetPlatformVersion = $bestVersion.Name
81-
HeaderPath = $flatHeader
82-
}
83-
}
84-
85-
if (-not $bestWithHeader) { return $null }
86-
87-
return [PSCustomObject]@{
88-
WindowsSdkDir = $kitsRoot
89-
WindowsTargetPlatformVersion = $bestWithHeader.Name
90-
HeaderPath = (Join-Path $bestWithHeader.FullName "wdf\umdf\wudfwdm.h")
91-
}
92-
}
93-
94-
$kitsRoot = Get-KitsRoot10
95-
Write-Output "KitsRoot10: $kitsRoot"
96-
97-
$found = Find-UmdfHeader -kitsRoot $kitsRoot
98-
if (-not $found) {
99-
Write-Output "UMDF header not found; installing SDK + WDK via winget..."
100-
101-
if (-not (Get-Command winget -ErrorAction SilentlyContinue)) {
102-
throw "winget is not available on this runner, and UMDF headers are missing."
103-
}
104-
105-
winget --version
106-
107-
$ids = @(
108-
"Microsoft.WindowsSDK.10.0.26100",
109-
"Microsoft.WindowsWDK.10.0.26100"
110-
)
111-
112-
foreach ($id in $ids) {
113-
Write-Output "Installing $id ..."
114-
winget install --source winget --exact --id $id --accept-package-agreements --accept-source-agreements --silent --disable-interactivity
115-
if ($LASTEXITCODE -ne 0) {
116-
throw "winget install failed for $id (exit code $LASTEXITCODE)"
117-
}
118-
}
119-
120-
$found = Find-UmdfHeader -kitsRoot $kitsRoot
121-
}
122-
123-
if (-not $found) {
124-
$includeRoot = Join-Path $kitsRoot "Include"
125-
Write-Output "Still missing UMDF header. Include root contents:"
126-
if (Test-Path $includeRoot) {
127-
Get-ChildItem -Path $includeRoot -Directory -ErrorAction SilentlyContinue | ForEach-Object { Write-Output ("- " + $_.Name) }
128-
}
129-
throw "Could not find wdf\\umdf\\wudfwdm.h under: $includeRoot"
130-
}
131-
132-
Write-Output "Found UMDF header at: $($found.HeaderPath)"
133-
Write-Output "Using WindowsTargetPlatformVersion: $($found.WindowsTargetPlatformVersion)"
134-
Write-Output "Using WindowsSdkDir: $($found.WindowsSdkDir)"
135-
136-
"WINDOWS_TARGET_PLATFORM_VERSION=$($found.WindowsTargetPlatformVersion)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
137-
"WINDOWS_SDK_DIR=$($found.WindowsSdkDir)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
13842

13943
- name: Setup .NET
14044
uses: actions/setup-dotnet@v4

.github/workflows/ci-validation.yml

Lines changed: 2 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -27,102 +27,6 @@ jobs:
2727
- name: Setup MSBuild
2828
uses: microsoft/setup-msbuild@v2
2929

30-
- name: Ensure UMDF headers (wudfwdm.h) are available
31-
shell: pwsh
32-
run: |
33-
$ErrorActionPreference = "Stop"
34-
35-
function Get-KitsRoot10 {
36-
try {
37-
return (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots" -Name "KitsRoot10" -ErrorAction Stop).KitsRoot10
38-
} catch {
39-
return (Join-Path ${env:ProgramFiles(x86)} "Windows Kits\10\")
40-
}
41-
}
42-
43-
function Find-UmdfHeader([string]$kitsRoot) {
44-
$includeRoot = Join-Path $kitsRoot "Include"
45-
if (-not (Test-Path $includeRoot)) { return $null }
46-
47-
# Some runners lay WDK headers out as:
48-
# Include\wdf\umdf\wudfwdm.h
49-
# Others as:
50-
# Include\<version>\wdf\umdf\wudfwdm.h
51-
$flatHeader = Join-Path $includeRoot "wdf\umdf\wudfwdm.h"
52-
53-
$versionDirs =
54-
Get-ChildItem -Path $includeRoot -Directory -ErrorAction SilentlyContinue |
55-
Where-Object { $_.Name -match '^\d+\.\d+\.\d+\.\d+$' } |
56-
Sort-Object -Property Name -Descending
57-
58-
$bestVersion = $versionDirs | Select-Object -First 1
59-
$bestWithHeader =
60-
$versionDirs |
61-
Where-Object { Test-Path (Join-Path $_.FullName "wdf\umdf\wudfwdm.h") } |
62-
Select-Object -First 1
63-
64-
if (Test-Path $flatHeader) {
65-
return [PSCustomObject]@{
66-
WindowsSdkDir = $kitsRoot
67-
WindowsTargetPlatformVersion = $bestVersion.Name
68-
HeaderPath = $flatHeader
69-
}
70-
}
71-
72-
if (-not $bestWithHeader) { return $null }
73-
74-
return [PSCustomObject]@{
75-
WindowsSdkDir = $kitsRoot
76-
WindowsTargetPlatformVersion = $bestWithHeader.Name
77-
HeaderPath = (Join-Path $bestWithHeader.FullName "wdf\umdf\wudfwdm.h")
78-
}
79-
}
80-
81-
$kitsRoot = Get-KitsRoot10
82-
Write-Output "KitsRoot10: $kitsRoot"
83-
84-
$found = Find-UmdfHeader -kitsRoot $kitsRoot
85-
if (-not $found) {
86-
Write-Output "UMDF header not found; installing SDK + WDK via winget..."
87-
88-
if (-not (Get-Command winget -ErrorAction SilentlyContinue)) {
89-
throw "winget is not available on this runner, and UMDF headers are missing."
90-
}
91-
92-
winget --version
93-
94-
$ids = @(
95-
"Microsoft.WindowsSDK.10.0.26100",
96-
"Microsoft.WindowsWDK.10.0.26100"
97-
)
98-
99-
foreach ($id in $ids) {
100-
Write-Output "Installing $id ..."
101-
winget install --source winget --exact --id $id --accept-package-agreements --accept-source-agreements --silent --disable-interactivity
102-
if ($LASTEXITCODE -ne 0) {
103-
throw "winget install failed for $id (exit code $LASTEXITCODE)"
104-
}
105-
}
106-
107-
$found = Find-UmdfHeader -kitsRoot $kitsRoot
108-
}
109-
110-
if (-not $found) {
111-
$includeRoot = Join-Path $kitsRoot "Include"
112-
Write-Output "Still missing UMDF header. Include root contents:"
113-
if (Test-Path $includeRoot) {
114-
Get-ChildItem -Path $includeRoot -Directory -ErrorAction SilentlyContinue | ForEach-Object { Write-Output ("- " + $_.Name) }
115-
}
116-
throw "Could not find wdf\\umdf\\wudfwdm.h under: $includeRoot"
117-
}
118-
119-
Write-Output "Found UMDF header at: $($found.HeaderPath)"
120-
Write-Output "Using WindowsTargetPlatformVersion: $($found.WindowsTargetPlatformVersion)"
121-
Write-Output "Using WindowsSdkDir: $($found.WindowsSdkDir)"
122-
123-
"WINDOWS_TARGET_PLATFORM_VERSION=$($found.WindowsTargetPlatformVersion)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
124-
"WINDOWS_SDK_DIR=$($found.WindowsSdkDir)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
125-
12630
- name: Setup Node.js
12731
uses: actions/setup-node@v4
12832
with:
@@ -140,7 +44,7 @@ jobs:
14044
Write-Output "Performing quick VDD compilation check..."
14145
$vddSln = "Virtual Display Driver (HDR)/MTTVDD.sln"
14246
if (-not (Test-Path $vddSln)) { throw "VDD solution file not found at: $vddSln" }
143-
msbuild $vddSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:WindowsSdkDir=$env:WINDOWS_SDK_DIR /p:WindowsTargetPlatformVersion=$env:WINDOWS_TARGET_PLATFORM_VERSION /verbosity:minimal /target:Build
47+
msbuild $vddSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /verbosity:minimal /target:Build
14448
14549
- name: Quick VAD Compilation Check
14650
shell: pwsh
@@ -149,51 +53,5 @@ jobs:
14953
Write-Output "Performing quick VAD compilation check..."
15054
$vadSln = "Virtual-Audio-Driver (Latest Stable)/VirtualAudioDriver.sln"
15155
if (-not (Test-Path $vadSln)) { throw "VAD solution file not found at: $vadSln" }
152-
msbuild $vadSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:WindowsSdkDir=$env:WINDOWS_SDK_DIR /p:WindowsTargetPlatformVersion=$env:WINDOWS_TARGET_PLATFORM_VERSION /verbosity:minimal /target:Build
153-
154-
- name: Checkout Virtual Driver Control Repository
155-
uses: actions/checkout@v4
156-
with:
157-
repository: 'VirtualDrivers/Virtual-Driver-Control'
158-
path: 'control-app-repo'
159-
token: ${{ secrets.GITHUB_TOKEN }}
160-
continue-on-error: true
161-
162-
- name: Control App Dependencies and Lint Check
163-
shell: pwsh
164-
run: |
165-
$ErrorActionPreference = "Stop"
166-
$controlAppPath = ""
167-
168-
if (Test-Path "control-app-repo/VirtualDriverControl/package.json") {
169-
$controlAppPath = "control-app-repo/VirtualDriverControl"
170-
Write-Output "Found control app in separate repository"
171-
}
172-
173-
if ($controlAppPath -eq "") {
174-
Write-Output "⚠️ Control App not found - skipping validation"
175-
exit 0
176-
}
177-
178-
Push-Location $controlAppPath
179-
npm ci
180-
181-
$packageJson = Get-Content "package.json" | ConvertFrom-Json
182-
if ($packageJson.scripts.lint) {
183-
npm run lint
184-
} else {
185-
Write-Output "No lint script found, skipping lint check"
186-
}
187-
188-
Pop-Location
189-
190-
- name: CI Validation Summary
191-
if: always()
192-
shell: pwsh
193-
run: |
194-
Write-Output "=== Fast CI Validation Summary ==="
195-
Write-Output "Configuration: $env:BUILD_CONFIGURATION"
196-
Write-Output "Event: ${{ github.event_name }}"
197-
Write-Output "Branch: ${{ github.ref }}"
198-
Write-Output "Commit: ${{ github.sha }}"
56+
msbuild $vadSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /verbosity:minimal /target:Build
19957
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 Microsoft
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Windows Driver Frameworks (WDF) vendored headers
2+
3+
This folder vendors a small subset of headers from Microsoft’s **Windows Driver Frameworks** repository, to keep CI builds working on runners where the Windows Kits / WDK installation is incomplete.
4+
5+
- **Upstream repo**: `https://github.com/microsoft/Windows-Driver-Frameworks`
6+
- **License**: MIT (see `LICENSE` in this folder)
7+
8+
### Included files
9+
10+
- `src/publicinc/wdf/umdf/2.15/wudfwdm.h`
11+
- Used to satisfy `#include <wudfwdm.h>` in the UMDF driver build when the header is not present in the runner’s Windows Kits install.
12+

0 commit comments

Comments
 (0)