OSRLogo
OSRLogoOSRLogoOSRLogo x Seminar Ad
OSRLogo
x

Everything Windows Driver Development

x
x
x
GoToHomePage xLoginx
 
 

    Thu, 14 Mar 2019     118020 members

   Login
   Join


 
 
Contents
  Online Dump Analyzer
OSR Dev Blog
The NT Insider
The Basics
File Systems
Downloads
ListServer / Forum
  Express Links
  · The NT Insider Digital Edition - May-June 2016 Now Available!
  · Windows 8.1 Update: VS Express Now Supported
  · HCK Client install on Windows N versions
  · There's a WDFSTRING?
  · When CAN You Call WdfIoQueueP...ously

Getting DbgPrint Output To Appear In Vista and Later

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\CCS\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 the Debugging Tools For Windows documentation (Appendix A) on DbgPrintEx.

Related Articles
Enabling Debugging on the Local Machine for Windows XP®
More on Kernel Debugging - KMODE_EXCEPTION_NOT_HANDLED
Making WinDbg Your Friend - Creating Debugger Extensions
Life Support for WinDbg - New Windows NT Support Tools
Special Win2K PnP Tracing and Checks
Choose Your Weapon: Kernel Mode Debuggers - a Choice at Last
Wild Speculation -- Debugging Another Crash Dump
Resolving Symbol Problems in WinDBG
New Verifier Pool Checks In LH
I Hooked Up The Debugger Using 1394, and NOW...

User Comments
Rate this article and give us feedback. Do you find anything missing? Share your opinion with the community!
Post Your Comment

"Tool support for DbgPrint"
If you are doing local debugging, Dbgview or TraceView Plus can display DbgPrint output without any configuration.

24-Feb-16, Robert Augstein


"dbgprint"
Yes this tip was very useful, but for local kernel debugging, we must use !dbgprint command in windbg to see the buffer that was sent from the driver.

will be great if the dbgprint can automatically send messages to windbg for local kernel debugging.

Rating:
29-Jan-15, anand sunku


"Enable output of DbgPrint/KdPrint messages by default"
Suggestion is to indicate that this registry key needs to be set on the target device, not the device running windbg.

06-Nov-13, Sharon Drasnin


"Not getting kdprint on remote debugger ."
Getting the same problem in Windows 7 as well , please update this document for Win7 .

29-May-12, anupam shukla


"DebugPrint on Windows 7"
Hi -

How does this procedure change for Windows 7 debugging?

I tried creating the above mentioned registry key (HKLM\SYSTEM\CCS\Control\Session Manager\Debug Print Filter) and it seemed to have no effect.

Thanks.

Rating:
19-Jul-09, Robert Cohn


"No KdPrint text in WinDbg on Vista SP1"
I've tried manually setting the registry keys. I've also used SetDbgPrintFiltering... but it's still not working.

I'm trying to see the KdPrint messages in WinDbg from /winddk/src/kmdf/fakemodem.sys.

I started the WinDbg, started Kernel Debug (Local) then connected my cell phone in order to initiate fakemodem.sys installation (I've changed the inf file to respond to my phone's hardware ID).

Still, where are all the trace messages?

The fakemodem.sys gets installed without problems, but I see no KdPrint messages. KdBreakpoint() works and effectively hangs the system :)

It was build using the checked environment...

Thank you.

24-Jun-08, Damir Colak


"Vista Debug Traces"
Hector -

The first method (Enable output of DbgPrint/KdPrint messages by default) still works on Vista Beta 2. Thanks for the tip.

((&->

Rating:
09-Jun-06, Bill Alexander


"Same thing happened on XP with SP2?"
After installed SP2 for XP, the traces can not be shown in the viewer, is that the same problem? Didn't try and was not sure about it.

Rating:
12-May-04, Fei Huang


Post Your Comments.
Print this article.
Email this article.
bottom nav links