Enable COM interop for collectible classes (dotnet/coreclr#20919)
authorJan Vorlicek <janvorli@microsoft.com>
Sat, 1 Dec 2018 09:31:35 +0000 (10:31 +0100)
committerGitHub <noreply@github.com>
Sat, 1 Dec 2018 09:31:35 +0000 (10:31 +0100)
commitab8ec609f7cfc3a878ce5f0c5ba92849cde7a361
tree9048362bb29e244212474f215e200303d56eab89
parent8a9ad4977081e724ccee0576d344a74800058957
Enable COM interop for collectible classes (dotnet/coreclr#20919)

* Enable COM interop for collectible classes

* Modify DispatchInfo to use LoaderAllocator handles

The DispatchMemberInfo was using global handles to refer to the managed
MemberInfo instances. That doesn't work with unloadability.
This change modifies it to use handles allocated from LoaderAllocator.

* Disable COM interop for WinRT types

* Remove collectible check from IsTypeVisibleFromCom. That fixes three
  new COM interop tests
* Add collectible check to GetComClassFactory when we check for
  unsupported interop with WinRT

* Add COM unloadability tests

Add two tests to test COM unloadability:
* One for using native COM server from managed COM client
* One for using managed COM objects from native client

* Add unloading test for IUnknownTest

* Disable NETClientPrimitivesInALC on Win ARM

The NETClientPrimitives is disabled there too.

Commit migrated from https://github.com/dotnet/coreclr/commit/4c461d754ff29d1ba37c145676c397062378d1c0
26 files changed:
src/coreclr/src/System.Private.CoreLib/Resources/Strings.resx
src/coreclr/src/inc/CrstTypes.def
src/coreclr/src/inc/crsttypes.h
src/coreclr/src/vm/appdomain.cpp
src/coreclr/src/vm/appdomain.hpp
src/coreclr/src/vm/ceeload.cpp
src/coreclr/src/vm/comcallablewrapper.cpp
src/coreclr/src/vm/comcallablewrapper.h
src/coreclr/src/vm/comtoclrcall.h
src/coreclr/src/vm/dispatchinfo.cpp
src/coreclr/src/vm/dispatchinfo.h
src/coreclr/src/vm/interoputil.cpp
src/coreclr/src/vm/loaderallocator.cpp
src/coreclr/src/vm/loaderallocator.hpp
src/coreclr/src/vm/methodtable.cpp
src/coreclr/src/vm/runtimecallablewrapper.cpp
src/coreclr/src/vm/stdinterfaces.cpp
src/coreclr/tests/issues.targets
src/coreclr/tests/src/Common/CoreCLRTestLibrary/Utilities.cs
src/coreclr/tests/src/Interop/COM/NETClients/Primitives/NETClientPrimitivesInALC.csproj [new file with mode: 0644]
src/coreclr/tests/src/Interop/COM/NETClients/Primitives/TestInALC.cs [new file with mode: 0644]
src/coreclr/tests/src/Interop/MarshalAPI/IUnknown/IUnknownTest.csproj
src/coreclr/tests/src/Interop/MarshalAPI/IUnknown/IUnknownTestInALC.csproj [new file with mode: 0644]
src/coreclr/tests/src/Interop/MarshalAPI/IUnknown/TestInALC.cs [new file with mode: 0644]
src/coreclr/tests/src/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTestInALC.csproj [new file with mode: 0644]
src/coreclr/tests/src/Interop/PInvoke/NativeCallManagedComVisible/Default/TestInALC.cs [new file with mode: 0644]