Generate SafeHandle when freeing method accepts additional reserved parameters#1603
Merged
jevansaks merged 6 commits intomicrosoft:mainfrom Jan 12, 2026
Merged
Conversation
Contributor
Author
|
@jevansaks PTAL |
jevansaks
reviewed
Jan 8, 2026
Member
|
/azp run |
Member
|
@DoctorKrolic Does the whole solution build for you? When I checked this out and built locally, I got build breaks that SysFreeStringSafeHandle is no longer generated. Seems like this might have broken generation of some other SafeHandles. |
Member
|
/azp run |
jevansaks
reviewed
Jan 9, 2026
Member
|
/azp run |
Contributor
Author
|
It seems that CI failure is not real |
Member
|
I'll try to re-run. We may need to scale back on some of the tests we run in the lab because of memory constraints. We're always just on the edge and some changes seem to cause the agents to blow up. @AArnott any thoughts on how to request different agents with more memory for running the tests? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #1078
We already handle out handle parameters annotated with
[RAIIFree]. However, in this particular caseWlanCloseHandlefunction accepts 2 parameters, which usually blocks us from turning raw handle into aSafeHandle. But the second parameter ofWlanCloseHandleis a[Reserved]one, so we don't actually need to pass a value to it. So the fix is to recognize such cases and handle still allowSafeHandleto be used