本文介绍了DebugView不能捕获KdPrint输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使DbgView.exe在Windows 10 64位v2004虚拟机上正常运行.如果使用KdPrint,该程序不会捕获来自驱动程序的任何内核消息,但可以与DbgPrint一起正常工作.我已经尝试过"bcdedit/debug on",并在其中添加了"Debug Print Filter".在注册表编辑器上并重新启动,从而启用详细的内核输出.我也在主机上尝试过,同样的结果.这是一个非常简单的驱动程序,只能从Windows Kernel Programming一书中复制和卸载.

I cannot make DbgView.exe work properly on my Windows 10 64-bit v2004 Virtual Machine. The program doesn't capture any kernel message from the driver if using KdPrint, but works fine with DbgPrint. I've already tried "bcdedit /debug on", adding "Debug Print Filter" on the registry editor and rebooting, enabling verbose kernel output.I've also tried on my host machine, same outcome.It is a very simple driver, only to be loaded and unloaded, copied from the book Windows Kernel Programming.

这有效

DbgPrint("Driver initialized.\n");

这不是

KdPrint(("Driver initialized.\n"));

任何帮助将不胜感激!

推荐答案

跳转到KdPrint,您将看到预处理魔术:

Jump to KdPrint and you will see a preprocessing magic:

#if DBG

#define KdPrint(_x_) DbgPrint _x_
#define KdPrintEx(_x_) DbgPrintEx _x_
#define vKdPrintEx(_x_) vDbgPrintEx _x_
#define vKdPrintExWithPrefix(_x_) vDbgPrintExWithPrefix _x_
#define KdBreakPoint() DbgBreakPoint()

#define KdBreakPointWithStatus(s) DbgBreakPointWithStatus(s)

#else

#define KdPrint(_x_)
#define KdPrintEx(_x_)
#define vKdPrintEx(_x_)
#define vKdPrintExWithPrefix(_x_)
#define KdBreakPoint()

#define KdBreakPointWithStatus(s)

#endif // DBG wudfwdm

这意味着,如果使用 Release 配置进行编译(不会定义DBG宏),则KdPrint不会发生任何事情.

This means that if you are compiling with Release configuration (DBG macro will not be defined), nothing will happen to KdPrint.

所以这不是DbgView问题.

So it's not a DbgView problem.

这篇关于DebugView不能捕获KdPrint输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-21 21:17