diff options
author | Luqun Lou <luqunl@microsoft.com> | 2017-06-24 02:42:55 +0300 |
---|---|---|
committer | Luqun Lou <luqunl@microsoft.com> | 2017-06-24 02:42:55 +0300 |
commit | da0a0051b9e78e1b0026e7943a249bdc542fc415 (patch) | |
tree | 08ebb2d568edda8ad3e65cd14fd98459258c9aa8 /src/System.Private.Interop | |
parent | 61282185850786cc8b7e8ea8afb8ab2e85786c08 (diff) |
Enable DynamicRCW by default
Enable dynamic rcw by default, which enable generic interface casting for incremental build and non-incremental build
For non-generic type, this shouldn't affect its behavior
For generic type, support the cast will always work if QI return succeeded
Generic Type Dynamic RCW dependency:
1. These DynamicRCWAdapter for generic interface need to be UniversalCanon
Note: This change may have negative perf impact for non-incremental build
Before(Disable DynamicRCW):
• It will only call ICastable.IsInstanceOfInterface
• ICastable.IsInstanceOfInterface will return true iff whether ComObject support(QI) this interface
After(Enable DyanamicRCW):
• It will call ICastable.IsInstanceOfInterface first, if ICastable.IsInstanceOfInterface return false, then call CastableObject.CastToInterface
• ICastable.IsInstanceOfInterface will return true iff interface has DispatchClass and ComObject support(QI) this interface
[tfs-changeset: 1662871]
Diffstat (limited to 'src/System.Private.Interop')
-rw-r--r-- | src/System.Private.Interop/src/Shared/__ComObject.cs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/System.Private.Interop/src/Shared/__ComObject.cs b/src/System.Private.Interop/src/Shared/__ComObject.cs index ea151f4d6..8d3512b7f 100644 --- a/src/System.Private.Interop/src/Shared/__ComObject.cs +++ b/src/System.Private.Interop/src/Shared/__ComObject.cs @@ -1689,11 +1689,7 @@ namespace System castError = null; IntPtr pComPtr = IntPtr.Zero; - if (!McgModuleManager.UseDynamicInterop) - return null; - // CastableObject support used for generics *only* for now - if (!interfaceType.IsGenericType()) { RuntimeTypeHandle genericInterfaceType = FindCastableGenericInterfaceInCache(interfaceType, out pComPtr); @@ -1846,9 +1842,7 @@ namespace System bool hasValidDispatcher = true; #if !RHTESTCL && !CORECLR && !CORERT && ENABLE_WINRT - hasValidDispatcher = McgModuleManager.UseDynamicInterop && interfaceType.IsGenericType() ? - !interfaceType.GetDispatchClassType().IsInvalid() : - true; + hasValidDispatcher = interfaceType.IsGenericType() ? !interfaceType.GetDispatchClassType().IsInvalid() : true; #endif try |