#com #winapi #query #wmi

bin+lib windows-snapshot

Find out windows state asynchronously and more

2 releases

0.1.1 May 24, 2023
0.1.0 May 22, 2023

#999 in Filesystem

AGPL-3.0-only

325KB
1.5K SLoC

windows-snapshot

Rust Crates.io docs.rs

The aim is to provide a snapshot of Windows system asynchronously. It achieves this by using WMI.

Our global state is windows_snapshot::state::Windows which stores the states of Windows machine at any given instance. Each state member can be updated synchronously or asynchronously, alone or alongside other states.

Example:

use windows_snapshot::COMLibrary;

#[tokio::main]
async fn main() {
    let _com_con = COMLibrary::new().unwrap(); // initialise security context

    let mut k = windows_snapshot::state::Windows::default();

    k.async_update().await;
    //k.update(); // for synchronous update

    println!("{k:#?}");
}

Dependencies

~0–25MB
~347K SLoC