wdk_panic/
lib.rs

1// Copyright (c) Microsoft Corporation
2// License: MIT OR Apache-2.0
3
4//! Default Panic Handlers for programs built with the WDK (Windows Drivers Kit)
5
6#![no_std]
7
8#[cfg(not(test))]
9use core::panic::PanicInfo;
10
11#[cfg(all(
12    debug_assertions,
13    // Disable inclusion of panic handlers when compiling tests for wdk crate
14    not(test)
15))]
16#[panic_handler]
17const fn panic(_info: &PanicInfo) -> ! {
18    loop {}
19}
20
21#[cfg(all(
22    not(debug_assertions),
23    // Disable inclusion of panic handlers when compiling tests for wdk crate
24    not(test)
25))]
26#[panic_handler]
27const fn panic(_info: &PanicInfo) -> ! {
28    loop {}
29    // FIXME: Should this trigger Bugcheck via KeBugCheckEx?
30}