From ed1fec1b1e00804c64b9527410f7da125ebff0bc Mon Sep 17 00:00:00 2001 From: Eugene Date: Mon, 19 Aug 2024 18:28:53 +0200 Subject: [PATCH] expose is_pageant_running --- pageant/Cargo.toml | 2 +- pageant/src/pageant_impl.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pageant/Cargo.toml b/pageant/Cargo.toml index b682f1f2..39b766c7 100644 --- a/pageant/Cargo.toml +++ b/pageant/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/lib.rs"] license = "Apache-2.0" name = "pageant" repository = "https://github.com/warp-tech/russh" -version = "0.0.1-beta.1" +version = "0.0.1-beta.2" rust-version = "1.65" [dependencies] diff --git a/pageant/src/pageant_impl.rs b/pageant/src/pageant_impl.rs index 27e9fc76..a02fe0a1 100644 --- a/pageant/src/pageant_impl.rs +++ b/pageant/src/pageant_impl.rs @@ -205,6 +205,10 @@ fn find_pageant_window() -> Result { const _AGENT_COPYDATA_ID: u64 = 0x804E50BA; const _AGENT_MAX_MSGLEN: usize = 8192; +pub fn is_pageant_running() -> bool { + find_pageant_window().is_ok() +} + /// Send a one-off query to Pageant and return a response. pub fn query_pageant_direct(cookie: String, msg: &[u8]) -> Result, Error> { let hwnd = find_pageant_window()?;