wmi

Macro wmi 

Source
macro_rules! wmi {
    (
        $(#[$attr:meta])*
        $query: ident, $path: expr
    ) => { ... };
}
Expand description

Our main macro to build queries.

The first argument takes documentation followed by WMI class name and it is followed by Namespace or where it is located.

§Building your own class queries

You can use the provided wmi macro to make your own queries:

#![allow(non_snake_case)]

use query_wmi::wmi;
use query_wmi::Query;
use paste::paste;
use std::collections::HashMap;
use query_wmi::COMLibrary;
use query_wmi::{Variant, WMIConnection};

// this creates the function `get_CLASS_NAME()`
wmi!{
/// documentation
CLASS_NAME, r"path_to_namespace"
}

// calling it
let com_con = COMLibrary::new()?;
dbg!(get_CLASS_NAME(com_con)?);

§Building your own queries

You can also replace CLASS_NAME with a query like CLASS_NAME where SOME_CONDITION=VALUE

See WQL Operators