KdPrintEx - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdm.h

void KdPrintEx(
  _x_
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdm-kdprintex)

Description

The KdPrintEx macro sends a string to the kernel debugger if the conditions you specify are met.

A call to KdPrintEx requires double parentheses.

Parameters

_x_

Specifies arguments for the format string, as in printf.

Remarks

KdPrintEx is identical to the DbgPrintEx routine in code that is compiled for a debug configuration. This routine has no effect in code that is compiled for a release build. Only kernel-mode drivers can call the KdPrintEx routine.

KdPrintEx either passes the specified string to the kernel debugger or does nothing at all, depending on the values of _ComponentId_, _Level_, and the corresponding component filter masks. For details, see Reading and Filtering Debugging Messages.

Unless it is absolutely necessary, you should not obtain a string from user input or another process and pass it to KdPrintEx. If you do use a string that you did not create, you must verify that this is a valid format string, and that the format codes match the argument list in type and quantity. The best coding practice is for all _Format_ strings to be static and defined at compile time.

There is no upper limit to the size of the _Format_ string or the number of arguments. However, any single call to KdPrintEx will only transmit 512 bytes of information. There is also a limit to the size of the DbgPrint buffer. See The DbgPrint Buffer and the Debugger for details.

This routine is defined in ntddk.h and ndis.h; component filter IDs are defined in dpfilter.h, ndis.h, and wdm.h. Include ntddk.h or ndis.h.

Here are the arguments:

See also

DbgPrint

DbgPrintEx

KdPrint