Skip to content

[CmdPal] Fix apps using incorrect AsSpan usage after CsWin32 upgrade #40156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2025

Conversation

lei9444
Copy link
Contributor

@lei9444 lei9444 commented Jun 20, 2025

Summary of the Pull Request

Root Cause:
After the CsWin32 upgrade, the code switched from using manually allocated unmanaged buffers (Marshal.AllocHGlobal) to using Span via outBuffer.AsSpan(). However, the Span length passed to SHLoadIndirectString was not correctly calculated.

PR Checklist

  • Closes: #xxx
  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

@lei9444 lei9444 added this to the PowerToys 0.92 milestone Jun 20, 2025
Copy link
Contributor

@moooyo moooyo left a comment

Choose a reason for hiding this comment

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

LGTM

@lei9444 lei9444 merged commit 1e79a98 into main Jun 20, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants