windows-bindgen 0.100.0

Code generator for Windows metadata
Documentation

windows-bindgen

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

Add the generator as a build dependency and the generated code's runtime dependency:

[dependencies.windows-link]
version = "0.100"

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

Generate bindings from build.rs:

let args = [
    "--out",
    "src/bindings.rs",
    "--flat",
    "--sys",
    "--filter",
    "GetTickCount",
];
windows_bindgen::bindgen(args);

And then use the bindings as follows:

mod bindings;

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