Skip to content

pal: Migrate delayload to windows-sys from winapi - #2774

Merged
Daman Mulye (damanm24) merged 9 commits into
microsoft:mainfrom
damanm24:delayload
Feb 24, 2026
Merged

Daman Mulye (damanm24) merged 9 commits into
microsoft:mainfrom
damanm24:delayload

Conversation

@damanm24

Copy link
Copy Markdown
Contributor

Addressing a follow-up item from: #2633, to fixup pal to move away from winapi usage as it's no longer supported.

Copilot AI review requested due to automatic review settings February 9, 2026 20:16
@github-actions github-actions Bot added the unsafe Related to unsafe code label Feb 9, 2026
@github-actions

github-actions Bot commented Feb 9, 2026

Copy link
Copy Markdown

⚠️ 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 continues the repo’s migration away from winapi by updating pal’s delay-load helper and removing winapi usage from the Windows DNS resolver bindings in consomme.

Changes:

  • Remove winapi “keepalive” usage from consomme’s Windows DNS API bindings and drop the winapi dependency from that crate.
  • Update pal::delayload! to use windows-sys (and introduce windows-result) instead of winapi.
  • Add unit tests for pal::delayload! behavior (present/missing functions and DLLs).

Reviewed changes

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

Show a summary per file
File Description
vm/devices/net/net_consomme/consomme/src/dns_resolver/windows/api.rs Removes the winapi keepalive import; continues using pal::delayload! with windows-sys DNS types.
vm/devices/net/net_consomme/consomme/Cargo.toml Drops winapi from Windows-only dependencies.
support/pal/src/windows.rs Migrates delayload! internals away from winapi, updates Win32 error/HRESULT conversion, and adds tests.
support/pal/Cargo.toml Adds windows-result and a windows-sys dependency block for pal.
Cargo.toml Adds workspace dependency entry for windows-result.
Cargo.lock Updates lockfile for dependency graph changes.

Comment thread support/pal/src/windows.rs Resolved
Comment thread support/pal/src/windows.rs Resolved
Comment thread support/pal/src/windows.rs Resolved
Comment thread support/pal/Cargo.toml Resolved
Comment thread support/pal/src/windows.rs Resolved
Comment thread support/pal/src/lib.rs Resolved
@damanm24 Daman Mulye (damanm24) changed the title pal: Migrate delayload to window-sys from winapi pal: Migrate delayload to windows-sys from winapi Feb 9, 2026

@benhillis Ben Hillis (benhillis) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good to me, Brian or John might want to take a quick look though.

@damanm24
Daman Mulye (damanm24) merged commit c2a8e65 into microsoft:main Feb 24, 2026
56 checks passed
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.

5 participants