openvmm_entry: migrate from winapi to windows-sys#2787
Conversation
| "consoleapi", | ||
| "handleapi", | ||
| "memoryapi", | ||
| "namedpipeapi", | ||
| "processenv", | ||
| "realtimeapiset", | ||
| "synchapi", | ||
| "winbase", | ||
| "wincon", | ||
| "winnls", | ||
| "winnt", | ||
| "winsock2", |
There was a problem hiding this comment.
As far as I can tell, these were unneeded features besides the winnt feature.
There was a problem hiding this comment.
Very possible, we don't have a solution for finding unused features today.
There was a problem hiding this comment.
Pull request overview
Migrates the openvmm_entry crate’s Windows API usage from winapi to windows-sys, aligning with the repo’s ongoing effort to consolidate Windows dependency usage (Issue #1061).
Changes:
- Replaced
winapiaccess mask constants withwindows-sysequivalents in Windows named-pipe serial binding. - Swapped the Windows-only dependency from
winapitowindows-sys(enablingWin32_Foundation). - Updated
Cargo.lockto reflect the dependency change.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| openvmm/openvmm_entry/src/serial_io.rs | Uses windows-sys constants for pipe access flags instead of winapi. |
| openvmm/openvmm_entry/Cargo.toml | Replaces the Windows-only winapi dependency with windows-sys and updates enabled features. |
| Cargo.lock | Updates the lock entry to remove winapi from openvmm_entry and include windows-sys. |
| let pipe = pal::windows::pipe::new_named_pipe( | ||
| path, | ||
| winapi::um::winnt::GENERIC_READ | winapi::um::winnt::GENERIC_WRITE, | ||
| windows_sys::Win32::Foundation::GENERIC_READ | ||
| | windows_sys::Win32::Foundation::GENERIC_WRITE, |
There was a problem hiding this comment.
The access mask constants are referenced via long fully-qualified paths twice. Consider importing GENERIC_READ/GENERIC_WRITE (e.g., with a use inside this #[cfg(windows)] block) to reduce verbosity and make future refactors easier.
Part of #1061, migrate openvmm_entry off of winapi