使用VsCode开发Windows驱动

使用VsCode开发Windows驱动

xmake.lua

1
2
3
4
5
6
7
8
9
10
11
add_rules("mode.debug", "mode.release")

target("xmake_wdm_test")
do
add_rules("wdk.driver", "wdk.env.wdm")
add_values("wdk.tracewpp.flags", "-func:TracePrint((LEVEL,FLAGS,MSG,...))")
add_files("/src/*.cpp", { rule = "wdk.tracewpp" })
add_files("*.rc", "*.inf")
add_files("*.mof|msdsm.mof")
add_files("msdsm.mof", { values = { wdk_mof_header = "msdsmwmi.h" } })
end

c_cpp_properties.json

1
2
3
{
"compileCommands": "${workspaceFolder}/.vscode/compile_commands.json"
}

main.cpp

1
2
3
4
5
6
7
8
9
10
11
12
13
#include <ntddk.h>

VOID DriverUnload(PDRIVER_OBJECT pDriverObject)
{
KdPrint(("Driver Unload\n"));
}

extern "C" NTSTATUS DriverEntry(IN PDRIVER_OBJECT pDriverObject, IN PUNICODE_STRING pRegistryPath)
{
pDriverObject->DriverUnload = DriverUnload;
KdPrint(("Driver Entry\n"));
return STATUS_SUCCESS;
}

使用VsCode开发Windows驱动
https://simonkimi.githubio.io/2024/08/12/使用VsCode开发Windows驱动/
作者
simonkimi
发布于
2024年8月12日
许可协议