Skip to content

Conversation

@svc-secops
Copy link
Contributor

@svc-secops svc-secops commented Feb 5, 2025

This PR contains the following updates:

Package Type Update Change
wmi dependencies minor 0.14.0 -> 0.18.0

Release Notes

ohadravid/wmi-rs (wmi)

v0.18.0

Compare Source

What's Changed

  • Remove COMLibrary and let WMIConnection initialize COM if needed by @​ohadravid in https://github.com/ohadravid/wmi-rs/pull/137
    You can now call WMIConnection::new() and let the crate handle the initialization internally.
    Note: COM will NOT be uninitialized when the connection is dropped (similar to <=0.17 versions, which didn't uninitialize COM on drop since #​53).
    If this is not what you want, then you must initialize COM yourself before creating the connection. See the docs for more.
  • Update the crate to Rust 2024 edition

Full Changelog: ohadravid/wmi-rs@v0.17.3...v0.18.0

v0.17.3

Compare Source

What's Changed

Full Changelog: ohadravid/wmi-rs@v0.17.2...v0.17.3

v0.17.2

Compare Source

What's Changed

New Contributors

Full Changelog: ohadravid/wmi-rs@v0.17.1...v0.17.2

v0.17.1

Compare Source

What's Changed

Full Changelog: ohadravid/wmi-rs@v0.17.0...v0.17.1

v0.17.0

Compare Source

What's Changed

Breaking Changes

New Contributors

Full Changelog: ohadravid/wmi-rs@v0.16.0...v0.17.0

v0.16.0

Compare Source

This version adds support for more serialization inputs (nested structures, array), and changes the public API to be more cohesive.

New Features

Nested structrure can be serialized when provided as method parameters (#​120):

let in_params = CreateInput {
    CommandLine: "explorer.exe".to_string(),
    ProcessStartupInformation: Win32_ProcessStartup {
        PriorityClass: 128, // High priority.
    },
};
let out: CreateOutput = wmi_con
    .exec_class_method::<Win32_Process, _>("Create", in_params)?;

Arrays can be serialized when provided as method parameters (#​121):

#[derive(Deserialize, Serialize)]
struct SetBinaryValue {
    sSubKeyName: String,
    sValueName: String,
    uValue: Vec<u8>,
}

let test_value = vec![0, 1, 2, 3];

let set_binary_value_params = SetBinaryValue {
    // ..
    uValue: test_value,
};

let value: SetBinaryValueOut = wmi_con
    .exec_class_method::<StdRegProv, _>("SetBinaryValue", &set_binary_value_params)?;

More lower-level API functions are exposed for IWbemClassWrapper:

let in_params = wmi_con
    .get_object("Win32_Process")?
    .get_method("Create")?
    .unwrap() // Can be `None`.
    .spawn_instance()?;

in_params
    .put_property("CommandLine", "explorer.exe".to_string())?;

let out = wmi_con
    .exec_method("Win32_Process", "Create", Some(&in_params))?;

Breaking Changes

  1. Method calling API was changed a little (#​120):
// Before:
let output: CreateOutput = wmi_con.exec_class_method::<Win32_Process, _, _>("Create", input)?;
let output: PrinterOutput = wmi_con.exec_instance_method::<Win32_Printer, _, _>("Pause", &printer.__Path, ())?;
// Now, only the Class and Out generics are named:
let output: CreateOutput = wmi_con.exec_class_method::<Win32_Process, _>("Create", input)?;
let output: PrinterOutput = wmi_con.exec_instance_method::<Win32_Printer, _>(&printer.__Path, "Pause", ())?;
  1. Rename lower-level (_native) methods to match the original names (exec_method_native_wrapper -> exec_method, exec_query_native_wrapper -> exec_query, etc.)
  2. Only expose as pub the needed structures and functions.

What's Changed

Full Changelog: ohadravid/wmi-rs@v0.15.2...v0.16.0

v0.15.2

Compare Source

What's Changed

Full Changelog: ohadravid/wmi-rs@v0.15.1...v0.15.2

v0.15.1

Compare Source

What's Changed

  • Updated windows and windows-core crates to version 0.60

Full Changelog: ohadravid/wmi-rs@v0.15.0...v0.15.1

v0.15.0

Compare Source

What's Changed

Example for newtype structs:

#[derive(Deserialize, Debug)]
struct Win32_OperatingSystem(pub HashMap<String, Variant>);

let system = wmi_con.query::<Win32_OperatingSystem>().unwrap();

Example for serde flatten:

#[derive(Deserialize, Debug)]
struct Win32_OperatingSystem {
    Caption: String,
    Name: String,

    #[serde(flatten)]
    extra: HashMap<String, Variant>,
}

#[derive(Deserialize, Debug)]

#[serde(rename = "Win32_OperatingSystem")]
struct Win32_OperatingSystemWrapper(pub Win32_OperatingSystem);
let system = wmi_con.query::<Win32_OperatingSystemWrapper>().unwrap();

Breaking Changes:

  • The struct_name_and_fields function now returns an Option for the struct's fields (which is None in case of a newtype struct).

Full Changelog: ohadravid/wmi-rs@v0.14.5...v0.15.0

v0.14.5

Compare Source

What's Changed

Full Changelog: ohadravid/wmi-rs@v0.14.4...v0.14.5

v0.14.4

Compare Source

What's Changed

Full Changelog: ohadravid/wmi-rs@v0.14.3...v0.14.4

v0.14.3

Compare Source

What's Changed

Example:

let in_params = CreateParams {
    CommandLine: "calc.exe".to_string(),
};
let out = wmi_con
    .exec_class_method::<Win32_Process, CreateParams, CreateOutput>("Create", in_params)
    .unwrap();

assert_eq!(out.ReturnValue, 0);

New Contributors

Full Changelog: ohadravid/wmi-rs@v0.14.2...v0.14.3

v0.14.2

Compare Source

What's Changed

Full Changelog: ohadravid/wmi-rs@v0.14.1...v0.14.2

v0.14.1

Compare Source

What's Changed

New Contributors

Full Changelog: ohadravid/wmi-rs@v0.14.0...v0.14.1


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - "after 8am and before 4pm on tuesday" in timezone Etc/UTC.

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


This PR has been generated by Renovate Bot.

@svc-secops svc-secops requested a review from a team as a code owner February 5, 2025 14:23
@svc-secops svc-secops changed the title fix(deps): update rust crate wmi to 0.15.0 fix(deps): update rust crate wmi to 0.16.0 Apr 18, 2025
@apollo-bot2
Copy link

Detected SAST Vulnerabilities

@svc-secops svc-secops changed the title fix(deps): update rust crate wmi to 0.16.0 fix(deps): update rust crate wmi to 0.17.0 Apr 22, 2025
@svc-secops svc-secops changed the title fix(deps): update rust crate wmi to 0.17.0 fix(deps): update rust crate wmi to 0.18.0 Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants