windows-syscall 0.0.12

Windows inline syscalls for Rust
Documentation
windows-syscall-0.0.12 has been yanked.

windows-syscall: Windows syscalls for Rust

windows-syscall GitHub Actions windows-syscall on crates.io windows-syscall on docs.rs

The syscall! macro provides a type-safe way to invoke a Windows system service.

Available Features

Feature Description
windows-syscall-typesafe (default) The macro attempts calling the provided function in a dead branch, ensuring type-safety (enabled by default).
windows-syscall-use-linked The macro directly invokes the provided function instead of performing an inline syscall. This is only useful for testing/debugging and is equivalent to directly calling the function.

Example

extern "C" {
    pub fn NtClose(Handle: HANDLE) -> NTSTATUS;
}

fn main() {
   assert_eq!(syscall!(NtClose(HANDLE::new(0xvalid))), STATUS_SUCCESS);
   assert_eq!(syscall!(NtClose(HANDLE::default())), STATUS_INVALID_HANDLE);
}

Platform Support

Arch
x86_64 (64-bit) :white_check_mark: Yes
x86 (32-bit) :x: No (on request)
AArch64 :x: No (on request)

This crate only implements calls to ntoskrnl services, if you require win32k services or an additional architecture please create an issue and let me know!

crate version: 0.0.x aka work-in-progress.