Previous Next

User-Mode Debugging Routines

User-mode drivers that include the windows.h header can use the debugging routines described below. For complete documentation of user-mode routines useful for debugging, see the Platform SDK.

Sending Output to the Debugger

OutputDebugString sends a null-terminated string to the debugger of the calling process. In a user-mode driver, OutputDebugString displays the string in the Debugger Command window. If a debugger is not running, this routine has no effect. OutputDebugString does not support the variable arguments of a printf formatted string.

The prototype for this routine is as follows:

VOID OutputDebugString(
   LPCTSTR lpOutputString
   );

Breaking Into the Debugger

A break routine causes an exception to occur in the current process, so that the calling thread can signal the debugger associated with the calling process. If no debugger is running, this usually results in the termination of the calling process.

When a user-mode program breaks into the debugger, execution pauses and the debugger is alerted.

To break into a debugger from a user-mode program, use the DebugBreak routine. Its prototype is as follows:

VOID DebugBreak(VOID);