Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions crates/wdk-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,35 @@ mod macros;
#[no_mangle]
pub static _fltused: () = ();

// FIXME: Is there any way to avoid this stub? See https://github.com/rust-lang/rust/issues/101134
// FIXME: Is there any way to avoid these stubs? See https://github.com/rust-lang/rust/issues/101134
#[cfg(panic = "abort")]
#[allow(missing_docs)]
#[allow(clippy::missing_const_for_fn)] // const extern is not yet supported: https://github.com/rust-lang/rust/issues/64926
#[no_mangle]
pub extern "system" fn __CxxFrameHandler3() -> i32 {
pub const extern "system" fn __CxxFrameHandler3() -> i32 {
0
}

#[cfg(panic = "abort")]
#[allow(missing_docs)]
#[no_mangle]
pub const extern "system" fn __CxxFrameHandler4() -> i32 {
// This is a stub for the C++ exception handling frame handler. It's never
// called but it needs to be distinct from __CxxFrameHandler3 to not confuse
// binary analysis tools. We return a different value to prevent folding.
1
}

#[cfg(panic = "abort")]
#[allow(missing_docs)]
#[no_mangle]
pub const extern "system" fn __GSHandlerCheck_EH4() -> i32 {
// This is a stub for the C++ exception handling frame handler. It's never
// called but it needs to be distinct from __CxxFrameHandler3 and
// __CxxFrameHandler4 to not confuse binary analysis tools. We return a
// different value to prevent folding.
2
}

#[cfg(any(
driver_model__driver_type = "WDM",
driver_model__driver_type = "KMDF",
Expand Down
Loading