Allow IStream to marshal from native to managed#369
Merged
tmat merged 3 commits intodotnet:mainfrom Nov 5, 2025
Merged
Conversation
Member
|
/cc @tmat |
Member
tmat
approved these changes
Nov 4, 2025
Member
|
@asundheimMSFT Is there a way to test this code path in a unit test? |
Contributor
Author
Added a test that manually marshals an |
Member
|
Thanks! |
This was referenced Nov 5, 2025
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.
Overview
A recent change dotnet/symreader-portable#573 fixed marshalling
IStreamwhen the interface typed the parameters asobject, but it turns out there are some APIs that explicitly mark the params asIStreamand thus they flow through theComStreamWrapper.Marshaller, which stubbed outConvertToManagedwithNotSupportedException.Details
Since the debugger does need to call those APIs in EnC scenarios, this change implements
ConvertToManagedwith an identical strategy to the aforementioned PR (wrap the ComWrappers-marshallableIUnsafeComStreamwith something that implementsIStream).UnsafeComStreamWrapperwas copied over fromsymreader-portable.The follow-up change to
symreader-portablethat bumps the dependency will also remove its copy ofUnsafeComStreamWrapperin favor of this project's copy assymreader-portablealready has IVT to this project.Testing
Manually patched debugger with modified
symreaderandsymreader-portable, verified we can marshal theIStreamthrough an API likeISymUnmanagedENCUpdate::UpdateSymbolStore2