winpty-rs-windows-bindgen

Crates.iowinpty-rs-windows-bindgen
lib.rswinpty-rs-windows-bindgen
version0.62.1
created_at2025-08-04 22:11:35.142675+00
updated_at2025-08-04 22:11:35.142675+00
descriptionCode generator for Windows metadata
homepage
repositoryhttps://github.com/microsoft/windows-rs
max_upload_size
id1781269
size32,763,661
Edgar Andrés Margffoy Tuay (andfoy)

documentation

README

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());
    }
}
Commit count: 1734

cargo fmt