Implement source generator for proposed System.Runtime.InteropServices.Marshalling.GeneratedComInterfaceAttribute #76767
Labels
area-System.Runtime.InteropServices
Bottom Up Work
Not part of a theme, epic, or user story
User Story
A single user-facing feature. Can be grouped under an epic.
Milestone
In the design doc for the COM source generator, we determined that we wanted to add a new attribute named
System.Runtime.InteropServices.Marshalling.GeneratedComInterfaceAttribute
(name subject to change in API review) with the following tentative shape:This attribute could also alternatively be a generic attribute so we as the source-generator authors don't need to handle validating the type passed to the constructor.
After discussing the design further, we also proposed adding a new public type that implements basic COM support around
IUnknown
as well as aComWrappers
-derived base class and an interface to help, possibly with the following shapes:The user will use the attribute as follows:
This issues tracks the following components of the generator, each of which can be completed relatively independently:
ComputeVtables
method forMyComWrappers
to return vtables for all interfaces with the[GeneratedComInterface]
attribute that point atMyComWrappers
that the provided object implements.CreateObject
method to create an object of typeComObject
around the provided external COM object.DynamicInterfaceCastableImplementation
-interface for the marked interface that provides the managed-to-unmanaged implementation based on the design and generator in Introduce a source generator for invoking methods on unmanaged vtables #68276.ComWrappers
type.The text was updated successfully, but these errors were encountered: