Skip to content

Commit

Permalink
[release/8.0] Use strategy in StrategyBasedComWrappers.ComputeVtables (
Browse files Browse the repository at this point in the history
…dotnet#92250)

* 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 <[email protected]>

---------

Co-authored-by: Jeremy Koritzinsky <[email protected]>
Co-authored-by: Jackson Schuster <[email protected]>
  • Loading branch information
3 people authored Sep 19, 2023
1 parent f678a18 commit c38ca78
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static IIUnknownInterfaceDetailsStrategy GetInteropStrategy()
/// <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);
}
Expand Down

0 comments on commit c38ca78

Please sign in to comment.