From 6a9b7880922609f307545e2e6eb6df1dc48dbe44 Mon Sep 17 00:00:00 2001 From: Pent Ploompuu Date: Mon, 31 Dec 2018 07:43:09 +0200 Subject: [PATCH] Remove parsing from GUID constants (dotnet/coreclr#21717) Commit migrated from https://github.com/dotnet/coreclr/commit/bac3ac897c0bfe943ca27fd8ca9188d1c74d1643 --- .../src/System/Runtime/InteropServices/ComEventsSink.cs | 6 ------ .../src/System/Runtime/InteropServices/Marshal.cs | 5 ++++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsSink.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsSink.cs index 0ddde5d..9281d24 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsSink.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsSink.cs @@ -122,8 +122,6 @@ namespace System.Runtime.InteropServices #endregion - private static Guid IID_IManagedObject = new Guid("{C3FCC19E-A970-11D2-8B5A-00A0C9B7C9C4}"); - CustomQueryInterfaceResult ICustomQueryInterface.GetInterface(ref Guid iid, out IntPtr ppv) { ppv = IntPtr.Zero; @@ -132,10 +130,6 @@ namespace System.Runtime.InteropServices ppv = Marshal.GetComInterfaceForObject(this, typeof(IDispatch), CustomQueryInterfaceMode.Ignore); return CustomQueryInterfaceResult.Handled; } - else if (iid == IID_IManagedObject) - { - return CustomQueryInterfaceResult.Failed; - } return CustomQueryInterfaceResult.NotHandled; } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs index eeef8eb..8af2cd2 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs @@ -29,7 +29,10 @@ namespace System.Runtime.InteropServices public static partial class Marshal { #if FEATURE_COMINTEROP - internal static Guid IID_IUnknown = new Guid("00000000-0000-0000-C000-000000000046"); + /// + /// IUnknown is {00000000-0000-0000-C000-000000000046} + /// + internal static Guid IID_IUnknown = new Guid(0, 0, 0, 0xC0, 0, 0, 0, 0, 0, 0, 0x46); #endif //FEATURE_COMINTEROP private const int LMEM_FIXED = 0; -- 2.7.4