fix(hid): enable Win32_System_IO so WriteFile resolves - #466
Closed
Brumaire wants to merge 1 commit into
Closed
Conversation
`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.
Greptile SummaryThis PR fixes the Windows build of
Confidence Score: 5/5The PR appears safe to merge with no actionable issues identified. The added feature is valid for the workspace-resolved windows-sys version and satisfies the existing WriteFile import without changing runtime behavior.
|
| Filename | Overview |
|---|---|
| crates/openlogi-hid/Cargo.toml | Correctly enables the target-specific Windows API feature required by the existing native HID write fallback. |
Reviews (1): Last reviewed commit: "fix(hid): enable Win32_System_IO so Writ..." | Re-trigger Greptile
|
Duplicate of #458. |
Author
|
You are right, #458 has the identical fix and got there two days earlier — I missed it. Closing this in favour of it. |
Author
|
Duplicate of #458. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cargo buildfails on Windows inopenlogi-hid, so the workspace cannot be built from source on that platform:WriteFile's signature referencesSystem::IO::OVERLAPPED, so windows-sys gates it behind theWin32_System_IOfeature:The features list already handles the identical situation for
CreateFileW(gated behindWin32_Securitybecause ofPSECURITY_ATTRIBUTES, with a comment explaining why). This adds the equivalent entry forWriteFile.Changes
openlogi-hid: addWin32_System_IOto thewindows-sysfeatures list, with a comment matching the existingWin32_Securitynote.Testing
Environment: Windows 11 (26200), Rust 1.96.0, windows-sys 0.61.2.
Runtime-tested on hardware: yes — the resulting agent runs and drives a Logitech Lift over Bluetooth.