30 breaking releases

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

#65 in Procedural macros

Download history 6520/week @ 2024-12-22 7489/week @ 2024-12-29 19631/week @ 2025-01-05 40356/week @ 2025-01-12 31100/week @ 2025-01-19 37133/week @ 2025-01-26 41505/week @ 2025-02-02 41185/week @ 2025-02-09 34758/week @ 2025-02-16 40412/week @ 2025-02-23 35816/week @ 2025-03-02 39653/week @ 2025-03-09 41466/week @ 2025-03-16 42024/week @ 2025-03-23 38687/week @ 2025-03-30 40818/week @ 2025-04-06

164,771 downloads per month
Used in 98 crates (7 directly)

MIT/Apache

8.5MB
10K 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-link]
version = "0.1"

[build-dependencies.windows-bindgen]
version = "0.61"

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