4.3.2.2 Breakpoint Functions

There are several ways to insert a breakpoint into the source code of a driver. The DbgBreakPoint function works in user-mode or kernel-mode code, while the DebugBreak function works only in user-mode code.

The function prototypes for DbgBreakPoint and DebugBreak are as follows:

VOID DbgBreakPoint(VOID);
VOID DebugBreak(VOID);
 

Each of these breakpoint functions breaks into the debugger associated with the calling process.

Calling a breakpoint function on a system that is not connected to a debugger hangs the machine. You can, however, connect WinDbg to a hung target machine that has kernel debugging enabled. Refer to Section 4.1.9, Connecting to a Running Target, for details.