Skip to content

Enhance variant use in firewall#1477

Merged
SteveL-MSFT merged 2 commits intoPowerShell:mainfrom
SteveL-MSFT:copilot-fixes
Apr 10, 2026
Merged

Enhance variant use in firewall#1477
SteveL-MSFT merged 2 commits intoPowerShell:mainfrom
SteveL-MSFT:copilot-fixes

Conversation

@SteveL-MSFT
Copy link
Copy Markdown
Member

PR Summary

Enhance VARIANT wrapper based on copilot feedback

Copilot AI review requested due to automatic review settings April 10, 2026 14:51
Copy link
Copy Markdown
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 refines the Windows Firewall COM enumeration code by improving how VARIANT is wrapped/handed to IEnumVARIANT::Next, and by making HRESULT logging more consistent.

Changes:

  • Added a SafeVariant::as_mut() helper to return &mut VARIANT.
  • Simplified IEnumVARIANT::Next call to use std::slice::from_mut(...) instead of from_raw_parts_mut.
  • Adjusted VariantClear failure logging to format the HRESULT as u32 hex.

@SteveL-MSFT SteveL-MSFT added this to the 3.2-Consider milestone Apr 10, 2026
@SteveL-MSFT SteveL-MSFT merged commit 8406ca5 into PowerShell:main Apr 10, 2026
36 of 37 checks passed
@SteveL-MSFT SteveL-MSFT deleted the copilot-fixes branch April 10, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants