1 unstable release

0.1.3 Aug 4, 2025

#525 in Windows APIs

Download history 18/week @ 2025-12-18 17/week @ 2025-12-25 16/week @ 2026-01-01 24/week @ 2026-01-22 20/week @ 2026-01-29 11/week @ 2026-02-05 30/week @ 2026-02-19 7/week @ 2026-02-26 8/week @ 2026-03-05 21/week @ 2026-03-12 16/week @ 2026-03-19 9/week @ 2026-03-26 15/week @ 2026-04-02

62 downloads per month
Used in 12 crates (11 directly)

MIT/Apache

7KB

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);
}

No runtime deps