Remove parsing from GUID constants (dotnet/coreclr#21717)
authorPent Ploompuu <kaalikas@gmail.com>
Mon, 31 Dec 2018 05:43:09 +0000 (07:43 +0200)
committerJan Kotas <jkotas@microsoft.com>
Mon, 31 Dec 2018 05:43:09 +0000 (19:43 -1000)
Commit migrated from https://github.com/dotnet/coreclr/commit/bac3ac897c0bfe943ca27fd8ca9188d1c74d1643

src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsSink.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs

index 0ddde5d..9281d24 100644 (file)
@@ -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;
         }
index eeef8eb..8af2cd2 100644 (file)
@@ -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");
+        /// <summary>
+        /// IUnknown is {00000000-0000-0000-C000-000000000046}
+        /// </summary>
+        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;