Getting DbgPrint Output To Appear In Vista and Later
2014-04-07 13:12
531 查看
原文链接:http://www.osronline.com/article.cfm?article=295
The problem: Your DbgPrint or KdPrint messages don't appear in WinDbg (or KD) when you run your driver on Windows Vista, Windows 7, or Windows 8.
The reason? Versions of Windows starting with Vista automatically map DbgPrint and friends to DbgPrintEx. Now, you may recall that DbgPrintEx allows you to control the conditions under which messages will
be sent to the kernel debugger by filtering messages via a component name and level in the function call and an associated filter mask in either the registry or in memory.
DbgPrint and KdPrint are mapped to component "DPFLTR_DEFAULT_ID" and level "DPFLTR_INFO_LEVEL". Of course xxx_INFO_LEVEL output is disabled by default. So, by default, your DbgPrint/KdPrint doesn't get sent
to the kernel debugger.
How to fix it? Two choices:
Enable output of DbgPrint/KdPrint messages by default -- Open (or add, if it's not already there) the key "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Debug Print Filter". Under
this key, create a value with the name "DEFAULT" Set the value of this key equal to the DWORD value 8 to enable xxx_INFO_LEVEL output as well as xxx_ERROR_LEVEL output. Or try setting the mask to 0xF so you get all output. You must reboot for these changes
to take effect. Note... Don't set the value named "(default)" -- You actually have to create a new value with the name "DEFAULT" and set that to whatever value you want (0xF, for example).
Specifically change the component filter mast for DPFLTR. Starting with Windows Vista you need to set the mask value for the DWORD at Kd_DEFAULT_MASK ("ed Kd_DEFAULT_MASK"). You can specify
8 to enable DPFLTR_INFO_LEVEL output in addition to DPFLTR_ERROR_LEVEL output, or 0xF to get all levels of output.
See the WDK documentation for
Reading and Filtering Debugging Messages (follow the path: Driver Development Tools\Tools for Debugging Drivers\Using Debugging Code in a Driver\Debugging Code Overview) for the complete details on the use of DbgPrintEx/KdPrintEx. Or look at theDebugging
Tools For Windows documentation (Appendix A) on DbgPrintEx.
The problem: Your DbgPrint or KdPrint messages don't appear in WinDbg (or KD) when you run your driver on Windows Vista, Windows 7, or Windows 8.
The reason? Versions of Windows starting with Vista automatically map DbgPrint and friends to DbgPrintEx. Now, you may recall that DbgPrintEx allows you to control the conditions under which messages will
be sent to the kernel debugger by filtering messages via a component name and level in the function call and an associated filter mask in either the registry or in memory.
DbgPrint and KdPrint are mapped to component "DPFLTR_DEFAULT_ID" and level "DPFLTR_INFO_LEVEL". Of course xxx_INFO_LEVEL output is disabled by default. So, by default, your DbgPrint/KdPrint doesn't get sent
to the kernel debugger.
How to fix it? Two choices:
Enable output of DbgPrint/KdPrint messages by default -- Open (or add, if it's not already there) the key "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Debug Print Filter". Under
this key, create a value with the name "DEFAULT" Set the value of this key equal to the DWORD value 8 to enable xxx_INFO_LEVEL output as well as xxx_ERROR_LEVEL output. Or try setting the mask to 0xF so you get all output. You must reboot for these changes
to take effect. Note... Don't set the value named "(default)" -- You actually have to create a new value with the name "DEFAULT" and set that to whatever value you want (0xF, for example).
Specifically change the component filter mast for DPFLTR. Starting with Windows Vista you need to set the mask value for the DWORD at Kd_DEFAULT_MASK ("ed Kd_DEFAULT_MASK"). You can specify
8 to enable DPFLTR_INFO_LEVEL output in addition to DPFLTR_ERROR_LEVEL output, or 0xF to get all levels of output.
See the WDK documentation for
Reading and Filtering Debugging Messages (follow the path: Driver Development Tools\Tools for Debugging Drivers\Using Debugging Code in a Driver\Debugging Code Overview) for the complete details on the use of DbgPrintEx/KdPrintEx. Or look at theDebugging
Tools For Windows documentation (Appendix A) on DbgPrintEx.
相关文章推荐
- unity3D游戏开发六之创建基本游戏场景三
- android拨号器
- 对android的android:taskAffinity初识
- Android开发之Service与IntentService的区别与使用场景(源代码剖析)
- [Unity3D]Unity3D 游戏开发之碰撞检测
- 无线连接手机进行Android测试
- Android AES算法示例
- IOS 解决键盘挡住输入框的问题
- Android之BroadcastReceiver1
- Android手机需要安装任务管理软件吗?
- iOS多线程编程之NSThread的使用
- android的自定义camera竖屏时,摄像头自动旋转90度的解决方案
- iOS多线程编程之Grand Central Dispatch(GCD)介绍和使用
- iOS应用程序生命周期(前后台切换,应用的各种状态)详解
- Cocoa 框架 For iOS(二)对象的分配初始化、内省、单例
- Object C学习笔记24-关键字总结
- Cocoa框架是iOS应用程序的基础,了解Cocoa框架,对开发iOS应用有很大的帮助。 1、Cocoa是什么? Cocoa是OS X和 iOS操作系统的程序的运行环境。 是什么因素使一个程序成为Co
- Windows XP 系统创建 Objective-C 开发环境
- 使用Xcode和Instruments调试解决iOS内存泄露
- Core Animation之多种动画效果