28 breaking releases

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

#102 in Operating systems

Download history 13519/week @ 2024-10-25 13596/week @ 2024-11-01 10345/week @ 2024-11-08 14202/week @ 2024-11-15 11308/week @ 2024-11-22 11363/week @ 2024-11-29 11132/week @ 2024-12-06 12226/week @ 2024-12-13 7759/week @ 2024-12-20 7139/week @ 2024-12-27 13708/week @ 2025-01-03 39913/week @ 2025-01-10 31827/week @ 2025-01-17 36669/week @ 2025-01-24 39659/week @ 2025-01-31 41489/week @ 2025-02-07

158,398 downloads per month
Used in 96 crates (5 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