Sunbeam Studios

Our open-source projects, here for you!

windows-targets (0.53.5)

Published 2026-03-26 11:06:32 +00:00 by siennathesane

Installation

[registry]
default = "gitea"

[registries.gitea]
index = "sparse+" # Sparse index
# index = "" # Git

[net]
git-fetch-with-cli = true
cargo add windows-targets@0.53.5

About this package

Import libs for Windows

Import libs for Windows

The windows-targets crate includes import libs, supports semantic versioning, and optional support for raw-dylib.

Note: As of Rust 1.71, the windows-link crate should be preferred.

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

[dependencies.windows-targets]
version = "0.53"

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

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

unsafe {
    SetLastError(1234);
    assert_eq!(GetLastError(), 1234);
}

Dependencies

ID Version
windows_aarch64_gnullvm ^0.53.0
windows_x86_64_msvc ^0.53.0
windows_aarch64_msvc ^0.53.0
windows_i686_gnu ^0.53.0
windows_i686_msvc ^0.53.0
windows_x86_64_gnu ^0.53.0
windows-link ^0.2.1
windows_i686_gnullvm ^0.53.0
windows_x86_64_gnullvm ^0.53.0
Details
Cargo
2026-03-26 11:06:32 +00:00
0
MIT OR Apache-2.0
6.8 KiB
Assets (1)
Versions (3) View all
0.52.6 2026-03-26
0.48.5 2026-03-26
0.53.5 2026-03-26