1 unstable release

0.62.1 Aug 4, 2025

#154 in FFI

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.winpty-rs-windows-link]
version = "0.1"

[build-dependencies.winpty-rs-windows-bindgen]
version = "0.62"

Generate Rust bindings in a build script as follows:

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

    winpty_rs_windows_bindgen::bindgen(args).unwrap();
}

And then use the bindings as follows:

mod bindings;

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

Dependencies