Function minhook::panic::set_handler
[−]
[src]
pub fn set_handler<F>(handler: F) where F: Fn(&DetourPanicInfo) + Sync + Send + 'static
Registers a custom detour panic handler, replacing any that was previously registered.
The panic handler is invoked when an extern detour function panics just before
the code would unwind into foreign code. The default handler prints a message
to standard error and aborts the process to prevent further unwinding, but this behavior
can be customized with the set_handler
and take_handler
functions.
The handler is provided with a DetourPanicInfo
struct which contains information
about the origin of the panic, including the payload passed to panic!
and
the name of the name of the associated hook.
If the handler panics or returns normally, the process will be aborted.
The panic handler is a global resource.