windows-drivers-rs
AGENTS.md1.9k starsChanged 8 months agoApache-2.0View on GitHub
Rust crates for developing Windows Drivers (WDM, KMDF, UMDF). The workspace only includes the library crates under crates/; examples and tests are excluded from the root workspace because each requires a different WDK configuration (only one WDK config per Cargo build graph is supported). Crate layering (bottom → top): Key design patterns: Requires an eWDK developer prompt and LLVM 17 on PATH for bindgen. cargo-expand v1.0.85 is required for macrotest/trybuild-based tests. Switching between stable/nightly toolchains requires deleting cached test artifacts…
Trending
Quiet since July.about the whole repository
Who's talking about microsoft/windows-drivers-rs
- A Hacker News story“Platform that enables Windows driver development in Rust”Hacker News · Sep 24, 2023 · 339 points
- @elias.sh“I wish github.com/microsoft/wi... had a clear roadmap for considering it production ready”Bluesky · May 19, 2026 · 5 likes
- A Hacker News story“Microsoft GitHub repo for writing Windows drivers in Rust”Hacker News · Sep 22, 2023 · 4 points
- dependabot/dependabot-core“`failed to find a workspace root` errors when multiple `cargo` workspaces exist in a single git repo”GitHub · Mar 20, 2025 · 2 reactions
- @hacker-news-jp.bsky.social“Platform that enables Windows driver development in Rust RustでWindowsドライバを開発できるプラットフォーム 🔺 300 💬 5 🔗 HN …”Bluesky · Sep 24, 2023 · 2 likes
The biggest 5 of 34 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 34
Talked about on GitHub, Bluesky and Hacker News (34 times).
On GitHub · 26
- Mar 20, 2025`failed to find a workspace root` errors when multiple `cargo` workspaces exist in a single git repo — dependabot/dependabot-core2 reactions · 1 comment
- Sep 14, 2023Ongoing: Official Rust WDK support — MolotovCherry/virtual-display-rs2 reactions
- Apr 15, 2025chore: use cargo-wdk to build & package samples on the CI pipeline — microsoft/Windows-rust-driver-samples1 reaction · 1 comment
- Jul 25, 2024Add an EtwDriverProvider for Windows kernel-mode support. — microsoft/rust_win_etw1 reaction · 2 comments
- Jul 16, 2026Implement a first-class Windows UMDF virtual serial transport — treitforge/cathub0 reactions
21 more on GitHub
- Mar 4, 2026PSGallery repository intermittently not registered on windows-2025 runners — actions/runner-images0 reactions · 9 comments
- Dec 27, 2025Feature Request: Allow Authenticated Github API Requests — microsoft/winget-cli0 reactions
- Dec 23, 2025ci: install winget via Repair-WinGetPackageManager — microsoft/Windows-rust-driver-samples0 reactions · 1 comment
- Nov 14, 2025[cargo] Bump wdk-build from 0.4.0 to 0.5.1 — Serious-senpai/logging-driver0 reactions
- Nov 14, 2025[cargo] Bump wdk-panic from 0.3.1 to 0.4.1 — Serious-senpai/logging-driver0 reactions
- Nov 11, 2025[cargo] Bump wdk-build from 0.4.0 to 0.5.0 — Serious-senpai/logging-driver0 reactions · 1 comment
- Nov 11, 2025[cargo] Bump wdk-panic from 0.3.1 to 0.4.0 — Serious-senpai/logging-driver0 reactions · 1 comment
- Nov 8, 2025chore: update to nov 2025 windows-drivers-rs release — microsoft/Windows-rust-driver-samples0 reactions
- Sep 22, 2025DMF and Rust? — microsoft/DMF0 reactions · 2 comments
- Aug 20, 2025[Rust] Unused variable False positive — github/codeql0 reactions · 2 comments
- Aug 19, 2025Arm runners for samples repo CI pipeline — microsoft/Windows-rust-driver-samples0 reactions
- May 20, 2025refactor(cli): `cargo-wdk new` command accepts path (as argument) and driver types as flags — svasista-ms/windows-drivers-rs0 reactions · 1 comment
- Aug 26, 2024ci: fix WDK installation in Detect Unused Cargo Dependencies — microsoft/Windows-rust-driver-samples0 reactions
- Jun 15, 2024ci: pin LLVM version in pipelines — microsoft/Windows-rust-driver-samples0 reactions
- May 30, 2024feat: update samples to use 0.3.0 windows-drivers-rs crates — microsoft/Windows-rust-driver-samples0 reactions · 2 comments
- Jan 24, 2024Older Version Installed — taiki-e/install-action0 reactions · 1 comment
- Jan 24, 2024Unexpected token in JSON at position 0 — rustsec/audit-check0 reactions
- Nov 27, 2023rust — Zero-Tang/NoirVisor0 reactions · 4 comments
- Nov 8, 2023feat: fetch rust-driver-makefile.toml from wdk-build — microsoft/Windows-rust-driver-samples0 reactions
- Oct 11, 2023wdk — tinygo-org/tinygo0 reactions · 1 comment
- Sep 22, 2023Annotations for windows rust driver library — owasp-dep-scan/blint0 reactions · 1 comment
On Bluesky · 6
- May 19, 2026I wish github.com/microsoft/wi... had a clear roadmap for considering it production ready — @elias.sh5 likes and reposts
- Sep 24, 2023Platform that enables Windows driver development in Rust RustでWindowsドライバを開発できるプラットフォーム 🔺 300 💬 5 🔗 HN Post | Article — @hacker-news-jp.bsky.social2 likes and reposts · 1 reply
- Sep 24, 2023Mark Russinovich: “Working towards enabling Windows driver development in Rust” (github.com) Main Link | HN Post — @newsycombinator.bsky.social2 likes and reposts
- Jul 22, 2024サポートされる構成: 1. サポートされるドライバタイプ: • WDM (Windows Driver Model) ドライバ • KMDF (Kernel-Mode Driver Framework) ドライバ • UMDF (User-Mode Driver… — @nihonmatsu.bsky.social1 likes and repost
- Sep 23, 2023Working towards enabling Windows driver development in Rust: https://github.com/microsoft/windows-drivers-rs — @markrussinovich.bsky.social1 likes and repost
1 more on Bluesky
- Sep 2, 2025I really would like to use github.com/microsoft/wi... so I could eliminate the C++, but their current recommendation is not to use it in… — @elias.sh0 likes and reposts · 1 reply
On Hacker News · 2
- Sep 24, 2023Platform that enables Windows driver development in Rust339 points · 142 comments
- Sep 22, 2023Microsoft GitHub repo for writing Windows drivers in Rust4 points
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
Files
Copilot Instructions for windows-drivers-rs
Overview
Rust crates for developing Windows Drivers (WDM, KMDF, UMDF). The workspace only includes the library crates under crates/; examples and tests are excluded from the root workspace because each requires a different WDK configuration (only one WDK config per Cargo build graph is supported).
Architecture
Crate layering (bottom → top):
wdk-build— Build-time crate. Configures cargo build scripts for WDK binding generation, linker settings, andcargo-maketask generation. Also contains therust-driver-makefile.tomlthat downstream driver packages extend.wdk-sys(no_std) — Raw FFI bindings auto-generated bybindgen, plus hand-written macro re-implementations where bindgen fails. Uses customcfgflags (driver_model__driver_type,driver_model__kmdf_version_major, etc.) set bywdk-buildto conditionally compile for WDM/KMDF/UMDF.wdk-macros— Proc-macro crate consumed only throughwdk-sysre-exports. Versioned in lockstep withwdk-sys(enforced by CIversion-checks.yaml).wdk— Safe idiomatic Rust wrappers aroundwdk-sys. Conditionallyno_stdfor WDM/KMDF; std-capable for UMDF.wdk-alloc— Global allocator (WdkAllocator) for kernel-mode crates needingalloc.wdk-panic— Default panic handlers for WDK binaries.cargo-wdk— Cargo subcommand for building and packaging driver projects.
Key design patterns:
- Conditional compilation via custom
cfgflags (not Cargo features) distinguishes driver types. These flags are emitted bywdk-buildduring the build script phase. wdk-syshas feature flags for optional WDK subsystem bindings:gpio,hid,spb,storage,usb,parallel-ports.- Some crates expose a
nightlyfeature for functionality gated behind unstable Rust features.
Build, Test, and Lint
Requires an eWDK developer prompt and LLVM 17 on PATH for bindgen.
Build
cargo build --locked --all-featuresTest
# Full suite
cargo test --locked --all-features
# Single test
cargo test --locked --all-features <test_name>
# Nightly-only tests
cargo +nightly test --locked --features nightlycargo-expand v1.0.85 is required for macrotest/trybuild-based tests. Switching between stable/nightly toolchains requires deleting cached test artifacts under target/*/tests/ to avoid stale trybuild/macrotest caches.
Lint
# Clippy (warnings are denied via RUSTFLAGS=-Dwarnings)
cargo clippy --locked --all-features --all-targets -- -D warnings
# Formatting (requires nightly for unstable rustfmt options)
cargo +nightly fmt --all -- --check
# TOML formatting
taplo fmt --check --diff
# Cargo.toml dependency sorting
cargo sort -w -g -n --check
# Spelling
typos
# Security audit
cargo audit --deny warnings
# Unused dependencies
cargo machete --skip-target-dir
# Docs build
cargo doc --locked --all-featuresPre-commit (runs everything)
cargo make wdk-pre-commit-flowCode Conventions
- Unsafe discipline:
unsafe_op_in_unsafe_fnis forbidden at workspace level. Every unsafe block must have exactly one unsafe operation (multiple_unsafe_ops_per_block = "forbid") and a// SAFETY:comment (undocumented_unsafe_blocks = "forbid"). Unnecessary safety docs are also forbidden. - FFI naming: Bindings in
wdk-sysretain their original C names and style (e.g., PascalCase functions). Safe Rust wrappers inwdkfollow Rust naming conventions (RFC 430). - Formatting:
rustfmtuses nightly-only unstable options (seerustfmt.toml). Import grouping isStdExternalCrate, granularity isCrate. - Lints: Clippy
allis deny,pedantic/nursery/cargoare warn. Most workspace members inherit[lints] workspace = true;wdk-sys,wdk-build,wdk-macros, andcargo-wdkdefine their own[lints]tables instead (Cargo currently does not support both inheriting workspace lints and selectively overriding them per crate). - Edition: 2024, MSRV 1.91.0, resolver v3.
- Static CRT: Enabled globally via
.cargo/config.toml(-C target-feature=+crt-static). - Spelling:
typosis configured in.typos.toml; Windows API identifiers are allowlisted rather than using file-level excludes. - TOML:
taplouses CRLF line endings (seetaplo.toml). - Versioning:
wdk-macrosandwdk-sysmust have identical versions (exact=dependency). This is enforced by theversion-checks.yamlCI workflow.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

