Skip to content

CasualX/wineh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Structured Exception Handling

Shitty attempt to get SEH working in Rust on Windows.

This works by handling the SEH code in C++ and calling that from Rust, I'm sure this is in violation of various standards but it works!

Probably don't want to mix this with panics. Nasal demons and all that.

use wineh::unsafe_seh;

#[inline(never)]
fn crash(a: i32, b: i32) -> i32 { a / b }

fn main() {
	unsafe_seh! {
		__try {
			println!("__try");
			let i = crash(0, 0);
			println!("{}", i);
		}
		__except(1) {
			println!("__except");
		}
	}
}

About

Windows SEH for Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages