Don't rely on the built-in interface marshaller during COM activation. (#40228)
authorAaron Robinson <arobins@microsoft.com>
Mon, 3 Aug 2020 22:30:09 +0000 (15:30 -0700)
committerGitHub <noreply@github.com>
Mon, 3 Aug 2020 22:30:09 +0000 (15:30 -0700)
commitd10f6f11debe5308d21f9e9802ba155b6624e2fd
tree819c14783b92d0b694f91d57689b8cb75e73473e
parent985f8ef146f6c19a7190acaa9c48e3334cb54616
Don't rely on the built-in interface marshaller during COM activation. (#40228)

* Don't rely on the built-in marshaller during activation.

Relying on the built-in marshaller leverages the Class interface approach
which doesn't work for some interface types (e.g. interfaces inheriting
from IDispatch).

This approach is wrong regardless of why given that COM dictates the
returned value must be properly cast the specific interface vtable.
src/coreclr/src/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs
src/tests/Interop/COM/Activator/Program.cs
src/tests/Interop/COM/NativeClients/Dispatch/Client.cpp