From aecd7938304c615802437fe861787940c2ebd485 Mon Sep 17 00:00:00 2001 From: Pariring Date: Thu, 3 Nov 2022 19:38:37 +0900 Subject: [PATCH] feat: stop hook --- src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index a22dab1..7a7b1bb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -62,4 +62,11 @@ pub extern "C" fn start_hook(callback: extern "C" fn(NativeEvent)) -> *const c_c } #[no_mangle] -pub extern "C" fn stop_hook() {} +pub extern "C" fn stop_hook() -> *const c_char { + if let Err(e) = skyhook::stop() { + let cstr = CString::new(e.message).unwrap(); + return cstr.as_ptr(); + } + + null() +}