-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
Milestone
Description
As a part of enabling support for ComWrappers
on non-Windows platforms, the feature availability across platforms is now different.
Once the contents of #54838 are in place, non-Windows platforms will be allowed to use the IUnknown
interfaces.
Currently, the following are Windows-only:
- Marshalling - Some APIs, such as
Marshal.GetIUnknownForObject
, respect the "Global registration" ofComWrappers
but currently those APIs are Windows only. We should enable allMarshal
APIs that support theComWrappers
API. - Update existing API testing Add test coverage for Marshal.AddRef/Release/QueryInterface on non-Windows #51072
- Platform compatibility metadata -
ComWrappers
is currently marked as only supported on Windows:
runtime/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs
Lines 72 to 74 in a6b9a63
[SupportedOSPlatform("windows")] [CLSCompliant(false)] public abstract partial class ComWrappers - Should be able to remove that attribute on the
ComWrappers
class - Might be a good idea to mark just the
RegisterForMarshalling
method as only supported on windows (based on the lack of marshalling with the global instance above)
- Should be able to remove that attribute on the