Brief introduction
DBG_PRINTEXCEPTION_C, codes 0x40010006; DBG_PRINTEXCEPTION_WIDE_C, the code 0x4001000A; abnormality information print / debugging information in the console window the debugger. Ntstatus.h it is defined in the header file, as follows:
//
// MessageId: DBG_PRINTEXCEPTION_C
//
// MessageText:
//
// Debugger printed exception on control C.
//
#define DBG_PRINTEXCEPTION_C ((NTSTATUS)0x40010006L) // winnt
//
// MessageId: DBG_PRINTEXCEPTION_WIDE_C
//
// MessageText:
//
// Debugger printed exception on control C.
//
#define DBG_PRINTEXCEPTION_WIDE_C ((NTSTATUS)0x4001000AL) // winnt
They only difference is, DBG_PRINTEXCEPTION_C is multi-byte version, DBG_PRINTEXCEPTION_WIDE_C is Unicode version.
Triggering conditions
OutputDebugString and other similar functions effectively lead to an exception caused by Windows (DBG_PRINTEXCEPTION_C or DBG_PRINTEXCEPTION_WIDE_C). After attach the debugger, Windows will receive the abnormal and notifies the debugger. If you do not attach a debugger, it will pass the exception to the program (as a continuation error). If the program is not an exception handler for processing, then continue to live. If the program is executed, the exception handler is invoked. , Because usually there is no reason OutputDebugString when no debugger to be printed, the program handles the event.
Abnormal structure filled
ExceptionAddress: 0xXXXXXXXX
the ExceptionCode: 40,010,006 / 4001000A // Error code
ExceptionFlags: 00000001
NumberParameters: 2 the number of additional parameters //, typically two,
the Parameter [0]: // string length information of
the Parameter [. 1]: // String Pointer