1 unstable release

0.1.3 Aug 4, 2025

#7 in #winpty

Download history 1/week @ 2025-08-13 25/week @ 2025-08-20 71/week @ 2025-08-27 69/week @ 2025-09-03 32/week @ 2025-09-10 25/week @ 2025-09-17 52/week @ 2025-09-24 45/week @ 2025-10-01 7/week @ 2025-10-08 70/week @ 2025-10-15 42/week @ 2025-10-22 27/week @ 2025-11-05 24/week @ 2025-11-12 15/week @ 2025-11-19 19/week @ 2025-11-26

85 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