Enable COM interop for collectible classes (#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)
commit4c461d754ff29d1ba37c145676c397062378d1c0
tree3f31b4015f010054dae1b5bd2f2a516915d0fe74
parent9fca919fdc8f20f80d923088620ec026196785bf
Enable COM interop for collectible classes (#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.
26 files changed:
src/System.Private.CoreLib/Resources/Strings.resx
src/inc/CrstTypes.def
src/inc/crsttypes.h
src/vm/appdomain.cpp
src/vm/appdomain.hpp
src/vm/ceeload.cpp
src/vm/comcallablewrapper.cpp
src/vm/comcallablewrapper.h
src/vm/comtoclrcall.h
src/vm/dispatchinfo.cpp
src/vm/dispatchinfo.h
src/vm/interoputil.cpp
src/vm/loaderallocator.cpp
src/vm/loaderallocator.hpp
src/vm/methodtable.cpp
src/vm/runtimecallablewrapper.cpp
src/vm/stdinterfaces.cpp
tests/issues.targets
tests/src/Common/CoreCLRTestLibrary/Utilities.cs
tests/src/Interop/COM/NETClients/Primitives/NETClientPrimitivesInALC.csproj [new file with mode: 0644]
tests/src/Interop/COM/NETClients/Primitives/TestInALC.cs [new file with mode: 0644]
tests/src/Interop/MarshalAPI/IUnknown/IUnknownTest.csproj
tests/src/Interop/MarshalAPI/IUnknown/IUnknownTestInALC.csproj [new file with mode: 0644]
tests/src/Interop/MarshalAPI/IUnknown/TestInALC.cs [new file with mode: 0644]
tests/src/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTestInALC.csproj [new file with mode: 0644]
tests/src/Interop/PInvoke/NativeCallManagedComVisible/Default/TestInALC.cs [new file with mode: 0644]