Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuqun Lou <luqunl@microsoft.com>2017-10-18 01:36:18 +0300
committerLuqun Lou <luqunl@microsoft.com>2017-10-18 01:36:18 +0300
commitb1f2d21fd0cfb9b779ecd715b64d62063f79b0cd (patch)
treee8f25339b6ea0b5f845136e0c2c90e1ebb18b0fa /src/System.Private.Interop
parentc2ea60d0f17abac47dc207db25cc752fcec12c62 (diff)
Delegate shouldn't treat as ComClass
From interop point, Delegate isn't ComClass. In WinRT, we treat delegate as interface instead of Class. [tfs-changeset: 1678339]
Diffstat (limited to 'src/System.Private.Interop')
-rw-r--r--src/System.Private.Interop/src/Shared/McgTypeHelpers.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/System.Private.Interop/src/Shared/McgTypeHelpers.cs b/src/System.Private.Interop/src/Shared/McgTypeHelpers.cs
index e965835b0..97c4b72e3 100644
--- a/src/System.Private.Interop/src/Shared/McgTypeHelpers.cs
+++ b/src/System.Private.Interop/src/Shared/McgTypeHelpers.cs
@@ -836,10 +836,12 @@ namespace System.Runtime.InteropServices
internal static bool IsComClass(this RuntimeTypeHandle handle)
{
+ //From Interop point, Delegates aren't treated as Class
#if CORECLR
- return InteropExtensions.IsClass(handle);
+ return InteropExtensions.IsClass(handle) &&
+ !InteropExtensions.AreTypesAssignable(handle, typeof(Delegate).TypeHandle);
#else
- return !InteropExtensions.IsInterface(handle) &&
+ return !InteropExtensions.IsInterface(handle) &&
!handle.IsValueType() &&
!InteropExtensions.AreTypesAssignable(handle, typeof(Delegate).TypeHandle);
#endif