windbg 不打印显示内核日志具有 kdprint 和其他日志功能

问题描述

我正在开始使用 wdm 学习 Windows 内核驱动程序编程。我写了我的第一个驱动程序,它在启动(进入)和停止(卸载)时打印一些日志。我可以在 debugview (dbgview.exe) 中看到日志,但 windbg 无法获取它们。

我设置了

“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Debug Print Filter”到0xf

然后运行 :> bcdedit /debug local

Windows 版本:2004(构建 1904) WDK10(构建 1904)

为什么windbg无法获取日志(但dbgview显示它们)?? 我还需要做些什么吗?

解决方法

你可以使用DbgPrintEx这个api不需要编辑reg键:

DbgPrintEx(0,"Hello Kernel");

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...