Move some Marshal functions to shared partition#51045
Merged
jkotas merged 1 commit intodotnet:mainfrom Apr 11, 2021
Merged
Conversation
|
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
jkotas
reviewed
Apr 11, 2021
| @@ -29,14 +29,6 @@ public void AddRef_ValidPointer_Success() | |||
| } | |||
|
|
|||
| [Fact] | |||
Member
There was a problem hiding this comment.
It would be nice to have test coverage for the success cases on Unix as well, but I understand that it is not easy to add it at the moment. It should be easier to add once we have ComWrappers for Unix. I think it is ok to merge this with the missing test coverage and open an issue to add it later.
jkotas
approved these changes
Apr 11, 2021
AaronRobinsonMSFT
approved these changes
Apr 11, 2021
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
There is nothing Windows-specific or CoreCLR specific about these functions, so I moved them to the shared partition and removed the
SupportedOSPlatformAttribute.Testing these on non-Windows platforms is hard, because you can't get an
IUnknown-like object from the operating system or from the runtime. It would be easier if ComWrappers was enabled on all platforms (#36582). If desired, the use ofMarshal.GetIUnknownForObjectcan be replaced with something like a custom struct.