-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Managed virtual method table property #83039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Managed virtual method table property #83039
Conversation
…rfaceGeneraterCompilesTests2
…rfaceGeneraterCompilesTests2
…when there are generator diagnostics
…rfaceGeneraterCompilesTests2
…VirtualMethodTableProperty
|
Tagging subscribers to this area: @dotnet/interop-contrib Issue DetailsIncludes #82657, so wait until that's merged to look. Adds static Guid IIUnknownInterfaceType.Iid => new Guid("00000000-0000-0000-0000-000000000000");
private static readonly void** m_vtable = (void**)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(<InterfaceType>), sizeof(void*) * <numberOfInterfaceMethods + 3>);
static void** IIUnknownInterfaceType.ManagedVirtualMethodTable
{
get
{
if (m_vtable[0] == null)
{
nint v0, v1, v2;
ComWrappers.GetIUnknownImpl(out v0, out v1, out v2);
m_vtable[0] = (void*)v0;
m_vtable[1] = (void*)v1;
m_vtable[2] = (void*)v2;
Native.PopulateManagedVirtualMethodTable(m_vtable);
}
return m_vtable;
}
}Also adds a definition of an interface with [GeneratedComInterface] to easily view the output of the generator in VS, and as a basis for functionality tests.
|
@jtschuster This is fine for a draft PR but all 0's represents |
…VirtualMethodTableProperty
|
This is mostly a subset of #83055 |
Includes #82657, so wait until that's merged to look.
Adds
GenerateIIUnknownInterfaceTypeImplementationmethod to generate the implementation ofIIUnknownInterfaceTypefor the Com interface shown below. It always uses a guid of all 0's.Also adds a definition of an interface with [GeneratedComInterface] to easily view the output of the generator in VS, and as a basis for functionality tests.