crosswin
Async-friendly Windows primitives for Rust.
A high-level, ergonomic wrapper around the Windows API that provides async process management, memory monitoring, and system operations without hiding what the OS is actually doing. Built on tokio for async operations and the windows crate for safe Win32 API bindings.
Status
Active development. Version 0.3.0 adds window discovery/manipulation and system information queries on top of the existing process-management surface.
Supported (v0.3.0):
- Process enumeration with rich metadata (PID, name, path, parent, memory, CPU time, threads, priority)
- Process operations (open, terminate, suspend, resume, wait for exit)
- Process filtering and search by name, memory usage, thread count, parent PID
- Memory usage monitoring
- Process priority management
- RAII handle management (automatic cleanup, prevents leaks)
- Window enumeration and basic window operations (stubs on non-Windows builds)
- Basic system information queries (CPU count, page size, uptime stub)
Planned (future):
- Registry operations
- Service management
- Advanced performance counters and metrics
- Event log reading
Features
- Async-first: Built on
tokiofor non-blocking operations - Type-safe: Strong typing for handles, priorities, and access rights
- Resource-safe: RAII handles prevent resource leaks
- Structured errors: Rich error types with operation context
- Zero-cost abstractions: Thin wrappers over Win32 API
- Explicit API: Clear about what Windows APIs are being called
Installation
Add this to your Cargo.toml:
[]
= "0.2"
This crate targets Windows and requires tokio in your dependency tree.
Examples
List Processes with Rich Information
use *;
use list_processes;
async
Find and Terminate a Process
use *;
async
Filter Processes
use *;
async
Monitor Memory Usage
use *;
use Duration;
async
More Examples
Run the bundled examples:
License
Licensed under either of
- Apache License, Version 2.0
- MIT license
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.