Skip to content

Comments

whp, virt_whp: migrate from winapi to windows-sys#2835

Open
justus-camp-microsoft wants to merge 2 commits intomicrosoft:mainfrom
justus-camp-microsoft:whp_winapi_migration
Open

whp, virt_whp: migrate from winapi to windows-sys#2835
justus-camp-microsoft wants to merge 2 commits intomicrosoft:mainfrom
justus-camp-microsoft:whp_winapi_migration

Conversation

@justus-camp-microsoft
Copy link
Contributor

@justus-camp-microsoft justus-camp-microsoft commented Feb 24, 2026

Part of #1061, migrate whp and virt_whp off of winapi

Copilot AI review requested due to automatic review settings February 24, 2026 23:17
@github-actions github-actions bot added the unsafe Related to unsafe code label Feb 24, 2026
@github-actions
Copy link

⚠️ Unsafe Code Detected

This PR modifies files containing unsafe Rust code. Extra scrutiny is required during review.

For more on why we check whole files, instead of just diffs, check out the Rustonomicon

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the whp crate from the deprecated winapi crate to windows-sys as part of the effort to unify Windows API dependencies across the OpenVMM codebase (issue #1061). The migration replaces all winapi imports with their windows-sys equivalents while maintaining the same functionality.

Changes:

  • Removed the winapi dependency from the whp crate
  • Updated all Windows API type imports to use windows-sys with appropriate module paths
  • Configured windows-sys features for both main dependencies and dev dependencies

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
vm/whp/Cargo.toml Removed winapi dependency; added windows-sys with Win32_Foundation and Win32_System_Power features for main deps, plus Win32_System_Memory and Win32_System_Threading for dev deps
vm/whp/src/partition_prop.rs Updated BOOL import from winapi::shared::minwindef to windows_sys::core
vm/whp/src/lib.rs Updated LUID, ERROR_BAD_PATHNAME, and DEVICE_POWER_STATE imports from winapi to windows-sys
vm/whp/src/api.rs Updated HANDLE, DEVICE_POWER_STATE, and HRESULT imports from winapi to windows-sys
vm/whp/src/abi.rs Updated LUID import from winapi::shared::ntdef to windows_sys::Win32::Foundation
vm/whp/benches/primitives.rs Updated memory and threading API imports from winapi to windows-sys
Cargo.lock Reflects the removal of winapi dependency from whp crate

@justus-camp-microsoft justus-camp-microsoft changed the title whp: migrate from winapi to windows-sys whp, virt_whp: migrate from winapi to windows-sys Feb 24, 2026
@github-actions
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

unsafe Related to unsafe code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant