28 breaking releases

new 0.59.0 Jan 7, 2025
0.58.0 Jul 3, 2024
0.57.0 Jun 7, 2024
0.55.0 Mar 6, 2024
0.0.0 Oct 18, 2021

#105 in Operating systems

Download history 17381/week @ 2024-09-18 21760/week @ 2024-09-25 19699/week @ 2024-10-02 14971/week @ 2024-10-09 15558/week @ 2024-10-16 15720/week @ 2024-10-23 13798/week @ 2024-10-30 11775/week @ 2024-11-06 14202/week @ 2024-11-13 11170/week @ 2024-11-20 11185/week @ 2024-11-27 10396/week @ 2024-12-04 12349/week @ 2024-12-11 10450/week @ 2024-12-18 6535/week @ 2024-12-25 9257/week @ 2025-01-01

40,238 downloads per month
Used in 102 crates (6 directly)

MIT/Apache

8.5MB
9K SLoC

Contains (DOS exe, 24MB) default/Windows.Win32.winmd, (Windows exe, 7.5MB) default/Windows.winmd, (DOS exe, 1MB) default/Windows.Wdk.winmd

Code generator for Windows metadata

The windows-bindgen crate automatically generates Rust bindings from Windows metadata.

Start by adding the following to your Cargo.toml file:

[dependencies.windows-targets]
version = "0.53"

[dev-dependencies.windows-bindgen]
version = "0.59"

Generate Rust bindings in a build script as follows:

fn main() {
    let args = [
        "--out",
        "src/bindings.rs",
        "--flat",
        "--filter",
        "GetTickCount",
    ];

    windows_bindgen::bindgen(args);
}

And then use the bindings as follows:

mod bindings;

fn main() {
    unsafe {
        println!("{}", bindings::GetTickCount());
    }
}

Dependencies