winpty-rs-windows-link

Crates.iowinpty-rs-windows-link
lib.rswinpty-rs-windows-link
version0.1.3
created_at2025-08-04 18:35:39.104709+00
updated_at2025-08-04 18:35:39.104709+00
descriptionLinking for Windows
homepage
repositoryhttps://github.com/microsoft/windows-rs
max_upload_size
id1781026
size16,327
Edgar Andrés Margffoy Tuay (andfoy)

documentation

README

Linking for Windows

The windows-link crate provides the link macro that simplifies linking. The link macro is much the same as the one provided by windows-targets but uses raw-dylib and thus does not require import lib files.

Start by adding the following to your Cargo.toml file:

[dependencies.winpty-rs-windows-link]
version = "0.1"

Use the link macro to define the external functions you wish to call:

 winpty_rs_windows_link::link!("kernel32.dll" "system" fn SetLastError(code: u32));
 winpty_rs_windows_link::link!("kernel32.dll" "system" fn GetLastError() -> u32);

unsafe {
    SetLastError(1234);
    assert_eq!(GetLastError(), 1234);
}
Commit count: 1734

cargo fmt