Skip to content

Commit fd53c69

Browse files
committed
Remove bundled FindDbgEng module
1 parent 376c370 commit fd53c69

7 files changed

Lines changed: 24 additions & 261 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ jobs:
4343
"cache-hit=${{ steps.wdk7.outputs.cache-hit }}"
4444
"dbgeng-found=${{ steps.wdk7.outputs.dbgeng-found }}"
4545
"toolchain-file=${{ steps.wdk7.outputs.toolchain-file }}"
46-
"finddbgeng-module=${{ steps.wdk7.outputs.finddbgeng-module }}"
4746
"ddkbuild-cmd=${{ steps.wdk7.outputs.ddkbuild-cmd }}"
4847
4948
if ("${{ steps.wdk7.outputs.dbgeng-found }}" -ne "true") {

README.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Then use the resolved root in CMake:
2424
run: |
2525
cmake -S . -B build -G "${{ steps.wdk7.outputs.cmake-generator }}" ^
2626
-DCMAKE_TOOLCHAIN_FILE="${{ steps.wdk7.outputs.toolchain-file }}" ^
27-
-DCMAKE_MODULE_PATH="${{ steps.wdk7.outputs.cmake-module-dir }}" ^
2827
-DWDK7_ARCH=${{ matrix.arch }}
2928
```
3029
@@ -38,7 +37,7 @@ standard CMake commands for exe, dll, and static library targets:
3837

3938
```cmake
4039
add_library(plugin SHARED plugin.c)
41-
target_link_libraries(plugin PRIVATE DbgEng::DbgEng)
40+
target_link_libraries(plugin PRIVATE kernel32)
4241
```
4342

4443
The same model works with `FetchContent` without a WDK-specific wrapper:
@@ -62,13 +61,12 @@ sets kernel compiler defaults; the `.sys` suffix, entry point, and driver linker
6261
flags are still expressed with ordinary `set_target_properties()` and
6362
`target_link_options()`.
6463

65-
The action also bundles `cmake/FindDbgEng.cmake`. For WinDbg extensions or
66-
DbgEng programs, add the module directory to `CMAKE_MODULE_PATH` and use:
67-
68-
```cmake
69-
find_package(DbgEng REQUIRED)
70-
target_link_libraries(my_extension PRIVATE DbgEng::DbgEng)
71-
```
64+
The action prepares the Debugging Tools SDK because many WDK7-era projects need
65+
DbgEng headers and libraries, but it does not bundle a `FindDbgEng.cmake`
66+
module. WinDbg extensions and DbgEng programs should keep their own find module
67+
or target definition in the project repository. The action exposes the prepared
68+
SDK through `WDK7_DBGENG_INCLUDE_DIR`, `WDK7_DBGENG_LIB_I386`, and
69+
`WDK7_DBGENG_LIB_AMD64`.
7270

7371
For legacy WDK build projects, the action also bundles `ddkbuild.cmd` and sets
7472
`W7BASE` after WDK7 is resolved:
@@ -96,7 +94,6 @@ For legacy WDK build projects, the action also bundles `ddkbuild.cmd` and sets
9694
- `cache-hit`: `true` when an existing cached tree was reused.
9795
- `cmake-module-dir`: absolute path to the bundled CMake module directory.
9896
- `toolchain-file`: absolute path to the bundled CMake WDK7 toolchain file.
99-
- `finddbgeng-module`: absolute path to the bundled `FindDbgEng.cmake` module.
10097
- `ddkbuild-cmd`: absolute path to the bundled `ddkbuild.cmd` wrapper.
10198
- `cmake-generator`: recommended generator, currently `NMake Makefiles`.
10299
- `dbgeng-found`: `true` when a usable DbgEng SDK was found or prepared.
@@ -187,8 +184,8 @@ the action bundle, prepares WDK7 through this action, then compiles the static
187184
fixtures under `test/e2e`:
188185

189186
- CMake plus `cmake/wdk7.cmake`: standard `add_executable()`/`add_library()`
190-
user-mode exe, dll, static lib, a FetchContent static lib, and a DbgEng-linked
191-
exe for i386 and amd64.
187+
user-mode exe, dll, static lib, a FetchContent static lib, and a Debugging
188+
Tools-linked exe for i386 and amd64.
192189
- CMake plus `cmake/wdk7.cmake`: standard-command WDM sys for i386 and amd64.
193190
- `ddkbuild.cmd`: WDM sys for i386 and amd64.
194191

@@ -200,7 +197,7 @@ Create the GitHub repository first, then push:
200197
cd D:\code\setup-wdk7
201198
git init
202199
git add .
203-
git commit -m "Initial wdk7 action"
200+
git commit -m "Initial setup-wdk7 action"
204201
git branch -M master
205202
git remote add origin https://github.com/tinysec/setup-wdk7.git
206203
git push -u origin master

action.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ outputs:
2222
description: Absolute path to the bundled CMake module directory.
2323
toolchain-file:
2424
description: Absolute path to the bundled CMake WDK7 toolchain file.
25-
finddbgeng-module:
26-
description: Absolute path to the bundled FindDbgEng.cmake module.
2725
ddkbuild-cmd:
2826
description: Absolute path to the bundled ddkbuild.cmd compatibility wrapper.
2927
cmake-generator:

cmake/FindDbgEng.cmake

Lines changed: 0 additions & 230 deletions
This file was deleted.

dist/index.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67497,16 +67497,12 @@ function cmakeModuleDir() {
6749767497
function toolchainFile() {
6749867498
return path12.join(cmakeModuleDir(), "wdk7.cmake");
6749967499
}
67500-
function findDbgEngModule() {
67501-
return path12.join(cmakeModuleDir(), "FindDbgEng.cmake");
67502-
}
6750367500
function ddkbuildCmd() {
6750467501
return path12.join(actionRoot(), "ddkbuild.cmd");
6750567502
}
6750667503
function publishStaticOutputs() {
6750767504
setOutput("cmake-module-dir", cmakeModuleDir());
6750867505
setOutput("toolchain-file", toolchainFile());
67509-
setOutput("finddbgeng-module", findDbgEngModule());
6751067506
setOutput("ddkbuild-cmd", ddkbuildCmd());
6751167507
setOutput("cmake-generator", cmakeGenerator);
6751267508
}
@@ -68109,7 +68105,6 @@ function publishWdk7(root, source, cacheHit, sdk) {
6810968105
exportVariable("WDK7_HOST_BIN", host);
6811068106
exportVariable("WDK7_CMAKE_MODULE_DIR", cmakeModuleDir());
6811168107
exportVariable("WDK7_CMAKE_TOOLCHAIN_FILE", toolchainFile());
68112-
exportVariable("WDK7_FINDDBGENG_CMAKE", findDbgEngModule());
6811368108
exportVariable("WDK7_DDKBUILD_CMD", ddkbuildCmd());
6811468109
exportVariable("WDK7_CMAKE_GENERATOR", cmakeGenerator);
6811568110
addPath(host);

src/main.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,13 @@ function toolchainFile(): string {
7878
return path.join(cmakeModuleDir(), "wdk7.cmake");
7979
}
8080

81-
function findDbgEngModule(): string {
82-
return path.join(cmakeModuleDir(), "FindDbgEng.cmake");
83-
}
84-
8581
function ddkbuildCmd(): string {
8682
return path.join(actionRoot(), "ddkbuild.cmd");
8783
}
8884

8985
function publishStaticOutputs(): void {
9086
core.setOutput("cmake-module-dir", cmakeModuleDir());
9187
core.setOutput("toolchain-file", toolchainFile());
92-
core.setOutput("finddbgeng-module", findDbgEngModule());
9388
core.setOutput("ddkbuild-cmd", ddkbuildCmd());
9489
core.setOutput("cmake-generator", cmakeGenerator);
9590
}
@@ -836,7 +831,6 @@ function publishWdk7(root: string, source: string, cacheHit: boolean, sdk?: Debu
836831
core.exportVariable("WDK7_HOST_BIN", host);
837832
core.exportVariable("WDK7_CMAKE_MODULE_DIR", cmakeModuleDir());
838833
core.exportVariable("WDK7_CMAKE_TOOLCHAIN_FILE", toolchainFile());
839-
core.exportVariable("WDK7_FINDDBGENG_CMAKE", findDbgEngModule());
840834
core.exportVariable("WDK7_DDKBUILD_CMD", ddkbuildCmd());
841835
core.exportVariable("WDK7_CMAKE_GENERATOR", cmakeGenerator);
842836

test/e2e/cmake/CMakeLists.txt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,24 @@ project(wdk7_e2e C)
33

44
include(FetchContent)
55

6-
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../../cmake")
7-
find_package(DbgEng REQUIRED)
8-
96
add_executable(e2e_cli exe.c)
107
add_library(e2e_dll SHARED dll.c)
118
add_library(e2e_lib STATIC lib.c)
129
add_executable(e2e_dbgeng dbgeng.c)
13-
target_link_libraries(e2e_dbgeng PRIVATE DbgEng::DbgEng)
10+
11+
if (WDK7_ARCH STREQUAL "amd64")
12+
set(_dbgeng_lib "$ENV{WDK7_DBGENG_LIB_AMD64}")
13+
else()
14+
set(_dbgeng_lib "$ENV{WDK7_DBGENG_LIB_I386}")
15+
endif()
16+
17+
if ("$ENV{WDK7_DBGENG_INCLUDE_DIR}" STREQUAL "" OR "${_dbgeng_lib}" STREQUAL "")
18+
message(FATAL_ERROR "DbgEng SDK environment variables are not set.")
19+
endif()
20+
21+
target_include_directories(e2e_dbgeng PRIVATE "$ENV{WDK7_DBGENG_INCLUDE_DIR}")
22+
target_link_directories(e2e_dbgeng PRIVATE "${_dbgeng_lib}")
23+
target_link_libraries(e2e_dbgeng PRIVATE dbgeng dbghelp)
1424

1525
FetchContent_Declare(
1626
e2e_fetch_dep

0 commit comments

Comments
 (0)