From 2d4be6d92d002ca5bf50a070e30c1bfdf98843b1 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 1 Jun 2024 15:30:59 +0200 Subject: [PATCH] Remove last leftover duplicate 'IID' fields --- src/WinRT.Runtime/ComWrappersSupport.net5.cs | 2 +- src/WinRT.Runtime/Interop/IAgileReference.net5.cs | 4 +--- src/WinRT.Runtime/Interop/IWeakReferenceSource.net5.cs | 8 ++------ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/WinRT.Runtime/ComWrappersSupport.net5.cs b/src/WinRT.Runtime/ComWrappersSupport.net5.cs index 6e3a78aae..ebeae4d98 100644 --- a/src/WinRT.Runtime/ComWrappersSupport.net5.cs +++ b/src/WinRT.Runtime/ComWrappersSupport.net5.cs @@ -590,7 +590,7 @@ private static unsafe bool IsRuntimeImplementedRCW(Type objType) private static object CreateObject(IntPtr externalComObject) { Guid inspectableIID = IID.IID_IInspectable; - Guid weakReferenceIID = ABI.WinRT.Interop.IWeakReference.IID; + Guid weakReferenceIID = IID.IID_IWeakReference; IntPtr ptr = IntPtr.Zero; try diff --git a/src/WinRT.Runtime/Interop/IAgileReference.net5.cs b/src/WinRT.Runtime/Interop/IAgileReference.net5.cs index d394fffbd..71a152757 100644 --- a/src/WinRT.Runtime/Interop/IAgileReference.net5.cs +++ b/src/WinRT.Runtime/Interop/IAgileReference.net5.cs @@ -123,9 +123,7 @@ static unsafe IAgileObject() [Guid("00000146-0000-0000-C000-000000000046")] internal sealed unsafe class IGlobalInterfaceTable - { - internal static readonly Guid IID = global::WinRT.Interop.IID.IID_IGlobalInterfaceTable; - + { public static ObjectReference FromAbi(IntPtr thisPtr) => ObjectReference.FromAbi(thisPtr, global::WinRT.Interop.IID.IID_IGlobalInterfaceTable); private readonly ObjectReference _obj; diff --git a/src/WinRT.Runtime/Interop/IWeakReferenceSource.net5.cs b/src/WinRT.Runtime/Interop/IWeakReferenceSource.net5.cs index 575465595..41e92fb8b 100644 --- a/src/WinRT.Runtime/Interop/IWeakReferenceSource.net5.cs +++ b/src/WinRT.Runtime/Interop/IWeakReferenceSource.net5.cs @@ -72,7 +72,7 @@ public ComWrappers.ComInterfaceEntry[] GetExposedInterfaces() { new ComWrappers.ComInterfaceEntry { - IID = ABI.WinRT.Interop.IWeakReference.IID, + IID = IID.IID_IWeakReference, Vtable = ABI.WinRT.Interop.IWeakReference.AbiToProjectionVftablePtr } }; @@ -110,8 +110,6 @@ static class IWeakReferenceSourceMethods [Guid("00000038-0000-0000-C000-000000000046")] internal unsafe interface IWeakReferenceSource : global::WinRT.Interop.IWeakReferenceSource { - internal static readonly Guid IID = global::WinRT.Interop.IID.IID_IWeakReferenceSource; - public static IntPtr AbiToProjectionVftablePtr; static unsafe IWeakReferenceSource() { @@ -127,7 +125,7 @@ private static int Do_Abi_GetWeakReference(IntPtr thisPtr, IntPtr* weakReference try { - *weakReference = ComWrappersSupport.CreateCCWForObjectForABI(new global::WinRT.Interop.ManagedWeakReference(ComWrappersSupport.FindObject(thisPtr)), IWeakReference.IID); + *weakReference = ComWrappersSupport.CreateCCWForObjectForABI(new global::WinRT.Interop.ManagedWeakReference(ComWrappersSupport.FindObject(thisPtr)), global::WinRT.Interop.IID.IID_IWeakReference); } catch (Exception __exception__) { @@ -147,8 +145,6 @@ private static int Do_Abi_GetWeakReference(IntPtr thisPtr, IntPtr* weakReference [Guid("00000037-0000-0000-C000-000000000046")] internal unsafe interface IWeakReference : global::WinRT.Interop.IWeakReference { - internal static readonly Guid IID = global::WinRT.Interop.IID.IID_IWeakReference; - public static IntPtr AbiToProjectionVftablePtr; static unsafe IWeakReference() {