Fix managed IID_PPV_ARGS overloads for native COM out pointers#1733
Merged
Conversation
Contributor
Author
|
@microsoft-github-policy-service agree |
Member
|
Thanks @littletoxic for the contribution! I'll take a look. |
jevansaks
approved these changes
Jun 16, 2026
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.
Summary
AllowMarshalingis enabled, even when the externppvparameter remains nativevoid**.Tfor both source-generated and built-in COM paths.ID3D12Device.CreateCommittedResource, including build-task generation.Fixes #1608
Notes
CreateCommittedResourcemarksppvResourceas optional, and native callers may passnullptrfor capability testing. This PR intentionally does not add a generic friendly overload that omitsppvResource; it only fixes the existing IID_PPV_ARGS generic overload soAllowMarshaling=trueproducesout T where T : class. Please let me know if you would prefer adding an omitted-output friendly overload as well.This PR was created with assistance from Codex.
Validation
Local targeted validation was run with
NBGV_GitEngine=Disabled. I did not run the full local test suite because the PR CI covers the full Windows/Linux and heavy-test matrix.dotnet build src\CsWin32Generator\CsWin32Generator.csproj --no-restorePrimitiveTypeHandleInfo.csCS9336 warning under local SDK 10.0.301.dotnet test test\Microsoft.Windows.CsWin32.Tests\Microsoft.Windows.CsWin32.Tests.csproj --no-restore --filter "FullyQualifiedName~ComOutPtrGenericOverload"dotnet test test\GenerationSandbox.BuildTask.Tests\GenerationSandbox.BuildTask.Tests.csproj --no-restore --filter "FullyQualifiedName~ID3D12Device_CreateCommittedResource_GenericOverloadsCompile"