* Use strategy in StrategyBasedComWrappers.ComputeVtables
We didn't actually use the strategy object here, so users like WinForms can't actually use it.
* Update src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/StrategyBasedComWrappers.cs
Co-authored-by: Jackson Schuster <36744439+jtschuster@users.noreply.github.com>
---------
Co-authored-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
Co-authored-by: Jackson Schuster <36744439+jtschuster@users.noreply.github.com>
/// <inheritdoc cref="ComWrappers.ComputeVtables" />
protected sealed override unsafe ComInterfaceEntry* ComputeVtables(object obj, CreateComInterfaceFlags flags, out int count)
{
- if (obj.GetType().GetCustomAttribute(typeof(ComExposedClassAttribute<>)) is IComExposedDetails details)
+ if (GetOrCreateInterfaceDetailsStrategy().GetComExposedTypeDetails(obj.GetType().TypeHandle) is { } details)
{
return details.GetComInterfaceEntries(out count);
}