Windows System Software -- Consulting, Training, Development -- Engineering Excellent, Every Time.

Where Are My DbgPrints?

Originally published by the OSR Staff on 11 May 2004, Reviewed and Updated 4 May 2020

The problem: Your DbgPrint or KdPrint messages don’t appear in WinDbg (or KD) when you run your driver.

How do you fix this?

The quickest way is with the WinDbg command (entered at the WinDbg command line):

ed Kd_DEFAULT_MASK 0xF

If your symbol settings in WinDbg are not correct, this command will not work.  Consider this a good opportunity to get your symbols set up correctly.  As soon as you resume your target system after successfully issuing this command, you will start seeing DbgPrint output from your driver. Note you’ll have to issue this command EVERY TIME your reboot your Target system to enable output from DbgPrint.

If you don’t want to enter a command every time your reboot your Target system set the following value in the Registry:

PathHKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Debug Print Filter
NameDEFAULT
TypeREG_DWORD
Value0xF

Yes, there is one space between the words “Debug”, “Print”, and “Filter” in the Registry path. You will almost certainly need to create the “Debug Print Filter” key, because it’s not created by default by Windows. Note that the value name must be DEFAULT – This is not the same as the “(default)” value for the key that’s created automatically in the Registry.

Setting the “Debug Print Filter” in the Registry to get DbgPrint to Appear

If you choose to set the Registry value, you will have to reboot the Target for the change to take effect, but this setting will remain in effect for each reboot.  In other words, if you make the Registry change, you will NOT have to manually enable DbgPrint output each time you reboot your system.

Search for the WDK page “Reading and Filtering Debugging Messages” for the complete details on the use of DbgPrintEx/KdPrintEx.