From 91eb6262c64190bfa5157e3ea7cdce3a92c2fbb0 Mon Sep 17 00:00:00 2001 From: denevrove Date: Sun, 26 Jul 2026 22:30:19 +0800 Subject: [PATCH] fix(hid): enable Win32_System_IO so WriteFile resolves MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `cargo build` fails on Windows in `openlogi-hid`: error[E0432]: unresolved import `windows_sys::Win32::Storage::FileSystem::WriteFile` --> crates\openlogi-hid\src\windows_hid.rs:19:9 `WriteFile`'s signature references `System::IO::OVERLAPPED`, so windows-sys gates it behind the `Win32_System_IO` feature: #[cfg(feature = "Win32_System_IO")] windows_link::link!("kernel32.dll" "system" fn WriteFile(...)); The features list already handles the same situation for `CreateFileW` (gated behind `Win32_Security` because of `PSECURITY_ATTRIBUTES`, with a comment explaining why) — this adds the equivalent entry for `WriteFile`. Verified: `cargo build -p openlogi-agent` succeeds after the change, both in debug and release, on Windows 11 with Rust 1.96. --- crates/openlogi-hid/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/openlogi-hid/Cargo.toml b/crates/openlogi-hid/Cargo.toml index 59b2b70b..d237ca1d 100644 --- a/crates/openlogi-hid/Cargo.toml +++ b/crates/openlogi-hid/Cargo.toml @@ -34,6 +34,9 @@ windows-sys = { workspace = true, features = [ # exposed when Win32_Security is also enabled. "Win32_Security", "Win32_Storage_FileSystem", + # WriteFile's signature references OVERLAPPED, so it is only exposed when + # Win32_System_IO is also enabled. + "Win32_System_IO", ] } [lints]