Click to Rate and Give Feedback
MSDN
MSDN Library
Windows Driver Kit
Reference
 KeBugCheckEx

  Switch on low bandwidth view
Windows Driver Kit: Kernel-Mode Driver Architecture
KeBugCheckEx

The KeBugCheckEx routine brings down the system in a controlled manner when the caller discovers an unrecoverable inconsistency that would corrupt the system if the caller continued to run.

VOID 
  KeBugCheckEx(
    IN ULONG  BugCheckCode,
    IN ULONG_PTR  BugCheckParameter1,
    IN ULONG_PTR  BugCheckParameter2,
    IN ULONG_PTR  BugCheckParameter3,
    IN ULONG_PTR  BugCheckParameter4
    );

Parameters

BugCheckCode
Specifies a value that indicates the reason for the bug check.
BugCheckParameterX
Supply additional information, such as the address and data where a memory-corruption error occurred, depending on the value of BugCheckCode.

Return Value

None

Comments

A bug check is a system-detected error that causes an immediate, controlled shutdown of the system. Various kernel-mode components perform run-time consistency checking. When such a component discovers an unrecoverable inconsistency, it causes a bug check to be generated.

Whenever possible, all kernel-mode components should log an error and continue to run, rather than calling KeBugCheckEx. For example, if a driver is unable to allocate required resources, it should log an error so that the system continues to run; it must not generate a bug check.

A driver or other kernel-mode component should call this routine only in cases of a fatal, unrecoverable error that could corrupt the system itself.

KeBugCheckEx can be useful in the early stages of developing a driver, or while it is undergoing testing. In these circumstances, the BugCheckCode passed to this routine should be distinct from those codes already in use by Windows or its drivers. For a list of these codes, see Bug Check Codes.

However, even during driver development, this routine is of only limited utility, since it results in a complete system shutdown. A more effective debugging method is to attach a kernel debugger to the system and then use routines that send messages to the debugger or break into the debugger. For further information, see Using Debugging Code in a Driver.

Requirements

IRQL: Any level

Headers: Declared in Wdm.h. Include Ntddk.h or Wdm.h.

See Also

IoAllocateErrorLogEntry, IoWriteErrorLogEntry, KeBugCheck, KeRegisterBugCheckCallback, KeRegisterBugCheckReasonCallback


Send feedback on this topic
Built on May 20, 2009
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker