Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IL2087 trim warning in 'ObjectReferenceWithContext<T>' #1577

Merged
merged 7 commits into from
Apr 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix trim warning for '_iid' in 'ObjectReference<T>'
Sergio0694 committed Apr 26, 2024
commit d932bdb1953a2561edc2ad81b95c68145ffcb792
6 changes: 3 additions & 3 deletions src/WinRT.Runtime/ActivationFactory.cs
Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@ private DllModule(string fileName, IntPtr moduleHandle, void* getActivationFacto
int hr = _GetActivationFactory(MarshalString.GetAbi(ref __runtimeClassId), &instancePtr);
if (hr == 0)
{
var objRef = ObjectReference<IUnknownVftbl>.Attach(ref instancePtr);
var objRef = ObjectReference<IUnknownVftbl>.Attach(ref instancePtr, IID.IID_IUnknown);
return (objRef, hr);
}
else
@@ -169,7 +169,7 @@ public static unsafe (ObjectReference<I> obj, int hr) GetActivationFactory<I>(st
int hr = Platform.RoGetActivationFactory(MarshalString.GetAbi(ref __runtimeClassId), &iid, &instancePtr);
if (hr == 0)
{
var objRef = ObjectReference<I>.Attach(ref instancePtr);
var objRef = ObjectReference<I>.Attach(ref instancePtr, iid);
return (objRef, hr);
}
else
@@ -327,7 +327,7 @@ private static IObjectReference GetFromActivationHandler(string typeName, Guid i
instancePtr = activationHandler(typeName, iid);
if (instancePtr != IntPtr.Zero)
{
return ObjectReference<IUnknownVftbl>.Attach(ref instancePtr);
return ObjectReference<IUnknownVftbl>.Attach(ref instancePtr, iid);
}
}
finally
2 changes: 1 addition & 1 deletion src/WinRT.Runtime/AgileReference.cs
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ internal unsafe AgileReference(IntPtr thisPtr)
&iid,
thisPtr,
&agileReference));
_agileReference = ObjectReference<IUnknownVftbl>.Attach(ref agileReference);
_agileReference = ObjectReference<IUnknownVftbl>.Attach(ref agileReference, IID.IID_IUnknown);
}
catch (TypeLoadException)
{
7 changes: 5 additions & 2 deletions src/WinRT.Runtime/ComWrappersSupport.cs
Original file line number Diff line number Diff line change
@@ -113,9 +113,12 @@ internal unsafe static bool IsFreeThreaded(IObjectReference objRef)

public static IObjectReference GetObjectReferenceForInterface(IntPtr externalComObject)
{
return GetObjectReferenceForInterface<IUnknownVftbl>(externalComObject);
return GetObjectReferenceForInterface<IUnknownVftbl>(externalComObject, IID.IID_IUnknown);
}

#if NET
[RequiresUnreferencedCode(AttributeMessages.GenericRequiresUnreferencedCodeMessage)]
#endif
public static ObjectReference<T> GetObjectReferenceForInterface<T>(IntPtr externalComObject)
{
if (externalComObject == IntPtr.Zero)
@@ -1162,7 +1165,7 @@ internal InspectableInfo(Type type, Guid[] iids)
internal static ObjectReference<T> CreateCCWForObject<T>(object obj, Guid iid)
{
IntPtr ccw = CreateCCWForObjectForABI(obj, iid);
return ObjectReference<T>.Attach(ref ccw);
return ObjectReference<T>.Attach(ref ccw, iid);
}

internal static ObjectReferenceValue CreateCCWForObjectForMarshaling(object obj, Guid iid)
2 changes: 1 addition & 1 deletion src/WinRT.Runtime/ComWrappersSupport.net5.cs
Original file line number Diff line number Diff line change
@@ -616,7 +616,7 @@ private static object CreateObject(IntPtr externalComObject)
}
else if (Marshal.QueryInterface(externalComObject, ref inspectableIID, out ptr) == 0)
{
var inspectableObjRef = ComWrappersSupport.GetObjectReferenceForInterface<IInspectable.Vftbl>(ptr);
var inspectableObjRef = ComWrappersSupport.GetObjectReferenceForInterface<IInspectable.Vftbl>(ptr, IID.IID_IInspectable);
ComWrappersHelper.Init(inspectableObjRef);

IInspectable inspectable = new IInspectable(inspectableObjRef);
2 changes: 1 addition & 1 deletion src/WinRT.Runtime/IInspectable.cs
Original file line number Diff line number Diff line change
@@ -122,7 +122,7 @@ private static int Do_Abi_GetTrustLevel(IntPtr pThis, TrustLevel* trustLevel)
}

public static IInspectable FromAbi(IntPtr thisPtr) =>
new IInspectable(ObjectReference<Vftbl>.FromAbi(thisPtr));
new IInspectable(ObjectReference<Vftbl>.FromAbi(thisPtr, IID.IID_IInspectable));

private readonly ObjectReference<Vftbl> _obj;
public IntPtr ThisPtr => _obj.ThisPtr;
2 changes: 1 addition & 1 deletion src/WinRT.Runtime/Interop/ExceptionErrorInfo.net5.cs
Original file line number Diff line number Diff line change
@@ -242,7 +242,7 @@ public static unsafe IObjectReference GetLanguageException(ObjectReference<IUnkn

GC.KeepAlive(obj);

return ObjectReference<IUnknownVftbl>.Attach(ref __return_value__);
return ObjectReference<IUnknownVftbl>.Attach(ref __return_value__, IID.IID_IUnknown);
}
finally
{
4 changes: 2 additions & 2 deletions src/WinRT.Runtime/Interop/IActivationFactory.cs
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ public static unsafe IObjectReference ActivateInstanceUnsafe(IObjectReference ob

try
{
return ComWrappersSupport.GetObjectReferenceForInterface<IUnknownVftbl>(instancePtr);
return ComWrappersSupport.GetObjectReferenceForInterface<IUnknownVftbl>(instancePtr, global::WinRT.Interop.IID.IID_IUnknown);
}
finally
{
@@ -142,7 +142,7 @@ private static unsafe int Do_Abi_ActivateInstance_0(IntPtr thisPtr, IntPtr* resu
return 0;
}
}
internal static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr);
internal static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr, IID.IID_IActivationFactory);

public static implicit operator IActivationFactory(IObjectReference obj) => (obj != null) ? new IActivationFactory(obj) : null;
protected readonly ObjectReference<Vftbl> _obj;
4 changes: 2 additions & 2 deletions src/WinRT.Runtime/Interop/IAgileReference.net5.cs
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ public static unsafe ObjectReference<T> Resolve<T>(IObjectReference _obj, Guid r
ThisPtr, &riid, &ptr));
try
{
return ComWrappersSupport.GetObjectReferenceForInterface<T>(ptr);
return ComWrappersSupport.GetObjectReferenceForInterface<T>(ptr, riid);
}
finally
{
@@ -149,7 +149,7 @@ public struct Vftbl
public delegate* unmanaged[Stdcall]<IntPtr, IntPtr, Guid*, IntPtr*, int> GetInterfaceFromGlobal => (delegate* unmanaged[Stdcall]<IntPtr, IntPtr, Guid*, IntPtr*, int>)_GetInterfaceFromGlobal;
}

public static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr);
public static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr, global::WinRT.Interop.IID.IID_IGlobalInterfaceTable);

public static implicit operator IGlobalInterfaceTable(IObjectReference obj) => (obj != null) ? new IGlobalInterfaceTable(obj) : null;
public static implicit operator IGlobalInterfaceTable(ObjectReference<Vftbl> obj) => (obj != null) ? new IGlobalInterfaceTable(obj) : null;
200 changes: 200 additions & 0 deletions src/WinRT.Runtime/Interop/IID.g.cs
Original file line number Diff line number Diff line change
@@ -439,5 +439,205 @@ internal static ref readonly Guid IID_INotifyCollectionChangedEventArgs
return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
}
}

/// <summary>The IID for <c>PropertyChangedEventArgsRuntimeClassFactory</c> (7C0C27A8-0B41-5070-B160-FC9AE960A36C).</summary>
internal static ref readonly Guid IID_PropertyChangedEventArgsRuntimeClassFactory
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[]
{
0xA8, 0x27, 0x0C, 0x7C,
0x41, 0x0B,
0x70, 0x50,
0xB1,
0x60,
0xFC,
0x9A,
0xE9,
0x60,
0xA3,
0x6C
};

return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
}
}

/// <summary>The IID for <c>DataErrorsChangedEventArgsRuntimeClassFactory</c> (62D0BD1E-B85F-5FCC-842A-7CB0DDA37FE5).</summary>
internal static ref readonly Guid IID_DataErrorsChangedEventArgsRuntimeClassFactory
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[]
{
0x1E, 0xBD, 0xD0, 0x62,
0x5F, 0xB8,
0xCC, 0x5F,
0x84,
0x2A,
0x7C,
0xB0,
0xDD,
0xA3,
0x7F,
0xE5
};

return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
}
}

/// <summary>The IID for <c>UriRuntimeClassFactory</c> (44A9796F-723E-4FDF-A218-033E75B0C084).</summary>
internal static ref readonly Guid IID_UriRuntimeClassFactory
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[]
{
0x6F, 0x79, 0xA9, 0x44,
0x3E, 0x72,
0xDF, 0x4F,
0xA2,
0x18,
0x03,
0x3E,
0x75,
0xB0,
0xC0,
0x84
};

return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
}
}

/// <summary>The IID for <c>INotifyDataErrorInfo</c> (0EE6C2CC-273E-567D-BC0A-1DD87EE51EBA).</summary>
internal static ref readonly Guid IID_INotifyDataErrorInfo
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[]
{
0xCC, 0xC2, 0xE6, 0x0E,
0x3E, 0x27,
0x7D, 0x56,
0xBC,
0x0A,
0x1D,
0xD8,
0x7E,
0xE5,
0x1E,
0xBA
};

return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
}
}

/// <summary>The IID for <c>INotifyPropertyChanged</c> (90B17601-B065-586E-83D9-9ADC3A695284).</summary>
internal static ref readonly Guid IID_INotifyPropertyChanged
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[]
{
0x01, 0x76, 0xB1, 0x90,
0x65, 0xB0,
0x6E, 0x58,
0x83,
0xD9,
0x9A,
0xDC,
0x3A,
0x69,
0x52,
0x84
};

return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
}
}

/// <summary>The IID for <c>INotifyCollectionChanged</c> (530155E1-28A5-5693-87CE-30724D95A06D).</summary>
internal static ref readonly Guid IID_INotifyCollectionChanged
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[]
{
0xE1, 0x55, 0x01, 0x53,
0xA5, 0x28,
0x93, 0x56,
0x87,
0xCE,
0x30,
0x72,
0x4D,
0x95,
0xA0,
0x6D
};

return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
}
}

/// <summary>The IID for <c>ICommand</c> (E5AF3542-CA67-4081-995B-709DD13792DF).</summary>
internal static ref readonly Guid IID_ICommand
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[]
{
0x42, 0x35, 0xAF, 0xE5,
0x67, 0xCA,
0x81, 0x40,
0x99,
0x5B,
0x70,
0x9D,
0xD1,
0x37,
0x92,
0xDF
};

return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
}
}

/// <summary>The IID for <c>IGlobalInterfaceTable</c> (00000146-0000-0000-C000-000000000046).</summary>
internal static ref readonly Guid IID_IGlobalInterfaceTable
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[]
{
0x46, 0x01, 0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0xC0,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x46
};

return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
}
}
}
}
10 changes: 9 additions & 1 deletion src/WinRT.Runtime/Interop/IID.tt
Original file line number Diff line number Diff line change
@@ -38,7 +38,15 @@ var entries = new (string Name, string IID, bool IsPublic)[]
("ILanguageExceptionErrorInfo", "04A2DBF3-DF83-116C-0946-0812ABF6E07D", false),
("IRestrictedErrorInfo", "82BA7092-4C88-427D-A7BC-16DD93FEB67E", false),
("INotifyCollectionChangedEventArgsFactory", "5108EBA4-4892-5A20-8374-A96815E0FD27", false),
("INotifyCollectionChangedEventArgs", "DA049FF2-D2E0-5FE8-8C7B-F87F26060B6F", false)
("INotifyCollectionChangedEventArgs", "DA049FF2-D2E0-5FE8-8C7B-F87F26060B6F", false),
("PropertyChangedEventArgsRuntimeClassFactory", "7C0C27A8-0B41-5070-B160-FC9AE960A36C", false),
("DataErrorsChangedEventArgsRuntimeClassFactory", "62D0BD1E-B85F-5FCC-842A-7CB0DDA37FE5", false),
("UriRuntimeClassFactory", "44A9796F-723E-4FDF-A218-033E75B0C084", false),
("INotifyDataErrorInfo", "0EE6C2CC-273E-567D-BC0A-1DD87EE51EBA", false),
("INotifyPropertyChanged", "90B17601-B065-586E-83D9-9ADC3A695284", false),
("INotifyCollectionChanged", "530155E1-28A5-5693-87CE-30724D95A06D", false),
("ICommand", "E5AF3542-CA67-4081-995B-709DD13792DF", false),
("IGlobalInterfaceTable", "00000146-0000-0000-C000-000000000046", false)
};

for (int i = 0; i < entries.Length; i++)
410 changes: 205 additions & 205 deletions src/WinRT.Runtime/Interop/IMarshal.cs

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/WinRT.Runtime/MatchingRefApiCompatBaseline.txt
Original file line number Diff line number Diff line change
@@ -237,4 +237,8 @@ MembersMustExist : Member 'public void WinRT.ComWrappersSupport.RegisterTypeRunt
CannotRemoveAttribute : Attribute 'System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute' exists on 'WinRT.Projections.FindCustomHelperTypeMapping(System.Type, System.Boolean)' in the implementation but not the reference.
CannotRemoveAttribute : Attribute 'System.ComponentModel.EditorBrowsableAttribute' exists on 'WinRT.IWinRTObject.GetOrCreateTypeHelperData(System.RuntimeTypeHandle, System.Func<System.Object>)' in the implementation but not the reference.
CannotRemoveAttribute : Attribute 'System.ObsoleteAttribute' exists on 'WinRT.IWinRTObject.GetOrCreateTypeHelperData(System.RuntimeTypeHandle, System.Func<System.Object>)' in the implementation but not the reference.
Total Issues: 239
CannotRemoveAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' exists on 'WinRT.ObjectReference<T>.Attach(System.IntPtr)' in the implementation but not the reference.
CannotRemoveAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' exists on 'WinRT.ObjectReference<T>.FromAbi(System.IntPtr)' in the implementation but not the reference.
CannotRemoveAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' exists on 'WinRT.ObjectReference<T>.FromAbi(System.IntPtr, T)' in the implementation but not the reference.
CannotRemoveAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' exists on 'WinRT.ComWrappersSupport.GetObjectReferenceForInterface<T>(System.IntPtr)' in the implementation but not the reference.
Total Issues: 242
32 changes: 28 additions & 4 deletions src/WinRT.Runtime/ObjectReference.cs
Original file line number Diff line number Diff line change
@@ -199,13 +199,13 @@ public unsafe int TryAs<T>(Guid iid, out ObjectReference<T> objRef)
}

// Normal path for IObjectReference or any IObjectReference<T>
return ObjectReference<T>.TryAs(this, iid, out objRef);
return ObjectReference<T>.TryAs(this, iid, out objRef);
}

public virtual unsafe ObjectReference<IUnknownVftbl> AsKnownPtr(IntPtr ptr)
{
AddRef(true);
var objRef = ObjectReference<IUnknownVftbl>.Attach(ref ptr);
var objRef = ObjectReference<IUnknownVftbl>.Attach(ref ptr, IID.IID_IUnknown);
objRef.IsAggregated = IsAggregated;
objRef.PreventReleaseOnDispose = IsAggregated;
objRef.ReferenceTrackerPtr = ReferenceTrackerPtr;
@@ -497,6 +497,9 @@ private protected ObjectReference(IntPtr thisPtr) :
{
}

#if NET
[RequiresUnreferencedCode(AttributeMessages.GenericRequiresUnreferencedCodeMessage)]
#endif
public static ObjectReference<T> Attach(ref IntPtr thisPtr)
{
if (thisPtr == IntPtr.Zero)
@@ -546,6 +549,9 @@ public static ObjectReference<T> Attach(ref IntPtr thisPtr, Guid iid)
}
}

#if NET
[RequiresUnreferencedCode(AttributeMessages.GenericRequiresUnreferencedCodeMessage)]
#endif
public static unsafe ObjectReference<T> FromAbi(IntPtr thisPtr, T vftblT)
{
if (thisPtr == IntPtr.Zero)
@@ -595,6 +601,9 @@ public static unsafe ObjectReference<T> FromAbi(IntPtr thisPtr, T vftblT, Guid i
}
}

#if NET
[RequiresUnreferencedCode(AttributeMessages.GenericRequiresUnreferencedCodeMessage)]
#endif
public static ObjectReference<T> FromAbi(IntPtr thisPtr)
{
if (thisPtr == IntPtr.Zero)
@@ -662,7 +671,7 @@ internal static int TryAs(IObjectReference sourceRef, Guid iid, out ObjectRefere

sourceRef.AddRefFromTrackerSource();

objRef = ObjectReference<T>.Attach(ref thatPtr);
objRef = Attach(ref thatPtr, iid);
objRef.IsAggregated = sourceRef.IsAggregated;
objRef.PreventReleaseOnDispose = sourceRef.IsAggregated;
objRef.ReferenceTrackerPtr = sourceRef.ReferenceTrackerPtr;
@@ -705,26 +714,38 @@ void InitAgileReference()

private readonly Guid _iid;

#if NET
[RequiresUnreferencedCode(AttributeMessages.GenericRequiresUnreferencedCodeMessage)]
#endif
internal ObjectReferenceWithContext(IntPtr thisPtr, IntPtr contextCallbackPtr, IntPtr contextToken)
: base(thisPtr)
{
_contextCallbackPtr = contextCallbackPtr;
_contextToken = contextToken;
}

#if NET
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "This constructor is setting the '_iid' field directly.")]
#endif
internal ObjectReferenceWithContext(IntPtr thisPtr, IntPtr contextCallbackPtr, IntPtr contextToken, Guid iid)
: this(thisPtr, contextCallbackPtr, contextToken)
{
_iid = iid;
}

#if NET
[RequiresUnreferencedCode(AttributeMessages.GenericRequiresUnreferencedCodeMessage)]
#endif
internal ObjectReferenceWithContext(IntPtr thisPtr, T vftblT, IntPtr contextCallbackPtr, IntPtr contextToken)
: base(thisPtr, vftblT)
{
_contextCallbackPtr = contextCallbackPtr;
_contextToken = contextToken;
}

#if NET
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "This constructor is setting the '_iid' field directly.")]
#endif
internal ObjectReferenceWithContext(IntPtr thisPtr, T vftblT, IntPtr contextCallbackPtr, IntPtr contextToken, Guid iid)
: this(thisPtr, vftblT, contextCallbackPtr, contextToken)
{
@@ -778,6 +799,9 @@ private ObjectReference<T> GetCurrentContext()

return Unsafe.As<ObjectReference<T>>(objectReference);

#if NET
[UnconditionalSuppressMessage("Trimming", "IL2087", Justification = "The '_iid' field is only empty when using annotated APIs not trim-safe.")]
#endif
IObjectReference CreateForCurrentContext(IntPtr _)
{
var agileReference = AgileReference;
@@ -822,7 +846,7 @@ protected override unsafe void Release()
public override ObjectReference<IUnknownVftbl> AsKnownPtr(IntPtr ptr)
{
AddRef(true);
var objRef = new ObjectReferenceWithContext<IUnknownVftbl>(ptr, Context.GetContextCallback(), Context.GetContextToken())
var objRef = new ObjectReferenceWithContext<IUnknownVftbl>(ptr, Context.GetContextCallback(), Context.GetContextToken(), IID.IID_IUnknown)
{
IsAggregated = IsAggregated,
PreventReleaseOnDispose = IsAggregated,
8 changes: 4 additions & 4 deletions src/WinRT.Runtime/Projections/Bindable.net5.cs
Original file line number Diff line number Diff line change
@@ -158,7 +158,7 @@ private static unsafe int Do_Abi_get_HasCurrent_1(IntPtr thisPtr, byte* value)
return 0;
}

internal static ObjectReference<IUnknownVftbl> FromAbi(IntPtr thisPtr) => ObjectReference<IUnknownVftbl>.FromAbi(thisPtr);
internal static ObjectReference<IUnknownVftbl> FromAbi(IntPtr thisPtr) => ObjectReference<IUnknownVftbl>.FromAbi(thisPtr, IID.IID_IUnknown);

unsafe bool global::Microsoft.UI.Xaml.Interop.IBindableIterator.MoveNext()
{
@@ -297,7 +297,7 @@ private static unsafe int Do_Abi_get_Size_1(IntPtr thisPtr, uint* value)
return 0;
}

internal static ObjectReference<IUnknownVftbl> FromAbi(IntPtr thisPtr) => ObjectReference<IUnknownVftbl>.FromAbi(thisPtr);
internal static ObjectReference<IUnknownVftbl> FromAbi(IntPtr thisPtr) => ObjectReference<IUnknownVftbl>.FromAbi(thisPtr, global::WinRT.Interop.IID.IID_IUnknown);

private static readonly global::System.Runtime.CompilerServices.ConditionalWeakTable<IWinRTObject, ABI.System.Collections.IEnumerable.FromAbiHelper> _helperTable = new();

@@ -573,7 +573,7 @@ internal static ObjectReference<IUnknownVftbl> ObjRefFromAbi(IntPtr thisPtr)
{
return null;
}
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr);
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr, IID.IID_IUnknown);
}

private static FromAbiHelper _AbiHelper(IWinRTObject _this)
@@ -1281,7 +1281,7 @@ internal static ObjectReference<IUnknownVftbl> ObjRefFromAbi(IntPtr thisPtr)
{
return null;
}
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr);
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr, IID.IID_IUnknown);
}

internal static FromAbiHelper _VectorToList(IWinRTObject _this)
4 changes: 2 additions & 2 deletions src/WinRT.Runtime/Projections/DataErrorsChangedEventArgs.cs
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ public struct Vftbl
private void* _CreateInstance_0;
public delegate* unmanaged[Stdcall]<IntPtr, IntPtr, IntPtr*, int> CreateInstance_0 => (delegate* unmanaged[Stdcall]<IntPtr, IntPtr, IntPtr*, int>)_CreateInstance_0;
}
public static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr);
public static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr, IID.IID_DataErrorsChangedEventArgsRuntimeClassFactory);

public static implicit operator WinRTDataErrorsChangedEventArgsRuntimeClassFactory(IObjectReference obj) => (obj != null) ? new WinRTDataErrorsChangedEventArgsRuntimeClassFactory(obj) : null;
public static implicit operator WinRTDataErrorsChangedEventArgsRuntimeClassFactory(ObjectReference<Vftbl> obj) => (obj != null) ? new WinRTDataErrorsChangedEventArgsRuntimeClassFactory(obj) : null;
@@ -57,7 +57,7 @@ public unsafe IObjectReference CreateInstance(string name)
fixed (void* ___name = __name)
{
global::WinRT.ExceptionHelpers.ThrowExceptionForHR(_obj.Vftbl.CreateInstance_0(ThisPtr, MarshalString.GetAbi(ref __name), &__retval));
return ObjectReference<IUnknownVftbl>.Attach(ref __retval);
return ObjectReference<IUnknownVftbl>.Attach(ref __retval, IID.IID_IUnknown);
}
}
finally
2 changes: 1 addition & 1 deletion src/WinRT.Runtime/Projections/ICommand.net5.cs
Original file line number Diff line number Diff line change
@@ -200,7 +200,7 @@ private static unsafe int Do_Abi_remove_CanExecuteChanged_1(IntPtr thisPtr, glob
}
}
}
public static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr);
public static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr, global::WinRT.Interop.IID.IID_ICommand);

private static global::ABI.WinRT.Interop.EventHandlerEventSource _CanExecuteChanged(IWinRTObject _this)
{
2 changes: 1 addition & 1 deletion src/WinRT.Runtime/Projections/IDictionary.net5.cs
Original file line number Diff line number Diff line change
@@ -1307,7 +1307,7 @@ public static ObjectReference<IUnknownVftbl> ObjRefFromAbi(IntPtr thisPtr)
{
return null;
}
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr);
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr, IID.IID_IUnknown);
}

public static Guid PIID = IDictionaryMethods<K,V>.PIID;
6 changes: 3 additions & 3 deletions src/WinRT.Runtime/Projections/IEnumerable.net5.cs
Original file line number Diff line number Diff line change
@@ -422,7 +422,7 @@ public static ObjectReference<IUnknownVftbl> ObjRefFromAbi(IntPtr thisPtr)
{
return null;
}
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr);
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr, IID.IID_IUnknown);
}

public static Guid PIID = ABI.System.Collections.Generic.IEnumerableMethods<T>.PIID;
@@ -812,7 +812,7 @@ internal FromAbiEnumerator(global::Windows.Foundation.Collections.IIterator<T> i
{
return null;
}
return new FromAbiEnumerator<T>(ObjectReference<IUnknownVftbl>.FromAbi(abi));
return new FromAbiEnumerator<T>(ObjectReference<IUnknownVftbl>.FromAbi(abi, IID.IID_IUnknown));
}

public static void DisposeAbi(IntPtr abi) => MarshalInterfaceHelper<global::Windows.Foundation.Collections.IIterator<T>>.DisposeAbi(abi);
@@ -1135,7 +1135,7 @@ public static ObjectReference<IUnknownVftbl> ObjRefFromAbi(IntPtr thisPtr)
{
return null;
}
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr);
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr, IID.IID_IUnknown);
}
public static Guid PIID = IEnumeratorMethods<T>.PIID;

2 changes: 1 addition & 1 deletion src/WinRT.Runtime/Projections/IList.net5.cs
Original file line number Diff line number Diff line change
@@ -1412,7 +1412,7 @@ public static ObjectReference<IUnknownVftbl> ObjRefFromAbi(IntPtr thisPtr)
{
return null;
}
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr);
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr, IID.IID_IUnknown);
}

public static Guid PIID = IListMethods<T>.PIID;
Original file line number Diff line number Diff line change
@@ -121,7 +121,7 @@ private static unsafe int Do_Abi_remove_CollectionChanged_1(IntPtr thisPtr, glob
}
}
}
internal static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr);
internal static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr, global::WinRT.Interop.IID.IID_INotifyCollectionChanged);

private static global::ABI.WinRT.Interop.EventSource<global::System.Collections.Specialized.NotifyCollectionChangedEventHandler> _CollectionChanged(IWinRTObject _this)
{
2 changes: 1 addition & 1 deletion src/WinRT.Runtime/Projections/INotifyDataErrorInfo.net5.cs
Original file line number Diff line number Diff line change
@@ -205,7 +205,7 @@ private static unsafe int Do_Abi_remove_ErrorsChanged_2(IntPtr thisPtr, global::
}
}
}
internal static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr);
internal static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr, IID.IID_INotifyDataErrorInfo);

private static EventHandlerEventSource<global::System.ComponentModel.DataErrorsChangedEventArgs> _ErrorsChanged(IWinRTObject _this)
{
Original file line number Diff line number Diff line change
@@ -119,7 +119,7 @@ private static unsafe int Do_Abi_remove_PropertyChanged_1(IntPtr thisPtr, global
}
}
}
internal static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr);
internal static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr, global::WinRT.Interop.IID.IID_INotifyPropertyChanged);

private static global::ABI.WinRT.Interop.EventSource<global::System.ComponentModel.PropertyChangedEventHandler> _PropertyChanged(IWinRTObject _this)
{
2 changes: 1 addition & 1 deletion src/WinRT.Runtime/Projections/IReadOnlyDictionary.net5.cs
Original file line number Diff line number Diff line change
@@ -1138,7 +1138,7 @@ public static ObjectReference<IUnknownVftbl> ObjRefFromAbi(IntPtr thisPtr)
{
return null;
}
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr);
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr, IID.IID_IUnknown);
}

public static Guid PIID = IReadOnlyDictionaryMethods<K, V>.PIID;
2 changes: 1 addition & 1 deletion src/WinRT.Runtime/Projections/IReadOnlyList.net5.cs
Original file line number Diff line number Diff line change
@@ -691,7 +691,7 @@ public static ObjectReference<IUnknownVftbl> ObjRefFromAbi(IntPtr thisPtr)
{
return null;
}
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr);
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr, IID.IID_IUnknown);
}

public static Guid PIID = IReadOnlyListMethods<T>.PIID;
2 changes: 1 addition & 1 deletion src/WinRT.Runtime/Projections/IReferenceArray.net5.cs
Original file line number Diff line number Diff line change
@@ -105,7 +105,7 @@ public static object FromAbi(IntPtr ptr)
return null;
}

var wrapper = new IReferenceArray<T>(ObjectReference<IUnknownVftbl>.FromAbi(ptr));
var wrapper = new IReferenceArray<T>(ObjectReference<IUnknownVftbl>.FromAbi(ptr, IID.IID_IUnknown));
return wrapper.Value;
}

2 changes: 1 addition & 1 deletion src/WinRT.Runtime/Projections/KeyValuePair.cs
Original file line number Diff line number Diff line change
@@ -440,7 +440,7 @@ public static ObjectReference<IUnknownVftbl> _FromAbi(IntPtr thisPtr)
{
return null;
}
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr);
return ObjectReference<IUnknownVftbl>.FromAbi(thisPtr, IID.IID_IUnknown);
}

public static Guid PIID = KeyValuePairMethods<K, V>.IID;
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ public static IObjectReference CreateMarshaler(global::System.Collections.Specia
try
{
_value = CreateMarshaler2(value);
return ObjectReference<IUnknownVftbl>.FromAbi(_value.GetAbi());
return ObjectReference<IUnknownVftbl>.FromAbi(_value.GetAbi(), IID.IID_IUnknown);
}
finally
{
2 changes: 1 addition & 1 deletion src/WinRT.Runtime/Projections/Nullable.cs
Original file line number Diff line number Diff line change
@@ -261,7 +261,7 @@ public static object FromAbi(IntPtr ptr)
return null;
}
var vftblT = new Vftbl(ptr);
var wrapper = new Nullable<T>(ObjectReference<Vftbl>.FromAbi(ptr, vftblT));
var wrapper = new Nullable<T>(ObjectReference<Vftbl>.FromAbi(ptr, vftblT, PIID));
return wrapper.Value;
}

332 changes: 166 additions & 166 deletions src/WinRT.Runtime/Projections/PropertyChangedEventArgs.cs

Large diffs are not rendered by default.

310 changes: 155 additions & 155 deletions src/WinRT.Runtime/Projections/Uri.cs
Original file line number Diff line number Diff line change
@@ -1,170 +1,170 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System;
using System.Runtime.InteropServices;
using WinRT;
using WinRT.Interop;

namespace ABI.Windows.Foundation
{
[Guid("9E365E57-48B2-4160-956F-C7385120BBFC")]
[StructLayout(LayoutKind.Sequential)]
internal unsafe struct IUriRuntimeClassVftbl
{
internal IInspectable.Vftbl IInspectableVftbl;
public IntPtr get_AbsoluteUri_0;
public IntPtr get_DisplayUri_1;
public IntPtr get_Domain_2;
public IntPtr get_Extension_3;
public IntPtr get_Fragment_4;
public IntPtr get_Host_5;
public IntPtr get_Password_6;
public IntPtr get_Path_7;
public IntPtr get_Query_8;
public IntPtr get_QueryParsed_9;
public void* _get_RawUri_10;
public delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int> get_RawUri_10 => (delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int>)_get_RawUri_10;
public IntPtr get_SchemeName_11;
public IntPtr get_UserName_12;
public IntPtr get_Port_13;
public IntPtr get_Suspicious_14;
public IntPtr Equals_15;
public IntPtr CombineUri_16;
}
}

namespace ABI.System
{
// Licensed under the MIT License.

using System;
using System.Runtime.InteropServices;
using WinRT;
using WinRT.Interop;

namespace ABI.Windows.Foundation
{
[Guid("9E365E57-48B2-4160-956F-C7385120BBFC")]
[StructLayout(LayoutKind.Sequential)]
internal unsafe struct IUriRuntimeClassVftbl
{
internal IInspectable.Vftbl IInspectableVftbl;
public IntPtr get_AbsoluteUri_0;
public IntPtr get_DisplayUri_1;
public IntPtr get_Domain_2;
public IntPtr get_Extension_3;
public IntPtr get_Fragment_4;
public IntPtr get_Host_5;
public IntPtr get_Password_6;
public IntPtr get_Path_7;
public IntPtr get_Query_8;
public IntPtr get_QueryParsed_9;
public void* _get_RawUri_10;
public delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int> get_RawUri_10 => (delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int>)_get_RawUri_10;
public IntPtr get_SchemeName_11;
public IntPtr get_UserName_12;
public IntPtr get_Port_13;
public IntPtr get_Suspicious_14;
public IntPtr Equals_15;
public IntPtr CombineUri_16;
}
}

namespace ABI.System
{
#if !NET
[global::WinRT.ObjectReferenceWrapper(nameof(_obj))]
#endif
[Guid("44A9796F-723E-4FDF-A218-033E75B0C084")]
internal sealed class WinRTUriRuntimeClassFactory
{
[Guid("44A9796F-723E-4FDF-A218-033E75B0C084")]
[StructLayout(LayoutKind.Sequential)]
public unsafe struct Vftbl
{
internal IInspectable.Vftbl IInspectableVftbl;
private void* _CreateUri_0;
public delegate* unmanaged[Stdcall]<IntPtr, IntPtr, IntPtr*, int> CreateUri_0 => (delegate* unmanaged[Stdcall]<IntPtr, IntPtr, IntPtr*, int>)_CreateUri_0;
public IntPtr _CreateWithRelativeUri;
}
public static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr);

public static implicit operator WinRTUriRuntimeClassFactory(IObjectReference obj) => (obj != null) ? new WinRTUriRuntimeClassFactory(obj) : null;
public static implicit operator WinRTUriRuntimeClassFactory(ObjectReference<Vftbl> obj) => (obj != null) ? new WinRTUriRuntimeClassFactory(obj) : null;
private readonly ObjectReference<Vftbl> _obj;
public IntPtr ThisPtr => _obj.ThisPtr;
public WinRTUriRuntimeClassFactory(IObjectReference obj) : this(obj.As<Vftbl>()) { }
public WinRTUriRuntimeClassFactory(ObjectReference<Vftbl> obj)
{
_obj = obj;
}

public unsafe IObjectReference CreateUri(string uri)
{
IntPtr __retval = default;
MarshalString.Pinnable __uri = new(uri);
fixed (void* ___uri = __uri)
#endif
[Guid("44A9796F-723E-4FDF-A218-033E75B0C084")]
internal sealed class WinRTUriRuntimeClassFactory
{
[Guid("44A9796F-723E-4FDF-A218-033E75B0C084")]
[StructLayout(LayoutKind.Sequential)]
public unsafe struct Vftbl
{
internal IInspectable.Vftbl IInspectableVftbl;
private void* _CreateUri_0;
public delegate* unmanaged[Stdcall]<IntPtr, IntPtr, IntPtr*, int> CreateUri_0 => (delegate* unmanaged[Stdcall]<IntPtr, IntPtr, IntPtr*, int>)_CreateUri_0;
public IntPtr _CreateWithRelativeUri;
}
public static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr, IID.IID_UriRuntimeClassFactory);

public static implicit operator WinRTUriRuntimeClassFactory(IObjectReference obj) => (obj != null) ? new WinRTUriRuntimeClassFactory(obj) : null;
public static implicit operator WinRTUriRuntimeClassFactory(ObjectReference<Vftbl> obj) => (obj != null) ? new WinRTUriRuntimeClassFactory(obj) : null;
private readonly ObjectReference<Vftbl> _obj;
public IntPtr ThisPtr => _obj.ThisPtr;
public WinRTUriRuntimeClassFactory(IObjectReference obj) : this(obj.As<Vftbl>()) { }
public WinRTUriRuntimeClassFactory(ObjectReference<Vftbl> obj)
{
_obj = obj;
}

public unsafe IObjectReference CreateUri(string uri)
{
IntPtr __retval = default;
MarshalString.Pinnable __uri = new(uri);
fixed (void* ___uri = __uri)
{
global::WinRT.ExceptionHelpers.ThrowExceptionForHR((*(delegate* unmanaged[Stdcall]<IntPtr, IntPtr, IntPtr*, int>**)ThisPtr)[6](ThisPtr, MarshalString.GetAbi(ref __uri), &__retval));
return ObjectReference<IUnknownVftbl>.Attach(ref __retval);
}
return ObjectReference<IUnknownVftbl>.Attach(ref __retval, IID.IID_IUnknown);
}
}

public unsafe ObjectReferenceValue CreateUriForMarshaling(string uri)
{
IntPtr __retval = default;
MarshalString.Pinnable __uri = new(uri);
fixed (void* ___uri = __uri)
public unsafe ObjectReferenceValue CreateUriForMarshaling(string uri)
{
IntPtr __retval = default;
MarshalString.Pinnable __uri = new(uri);
fixed (void* ___uri = __uri)
{
global::WinRT.ExceptionHelpers.ThrowExceptionForHR((*(delegate* unmanaged[Stdcall]<IntPtr, IntPtr, IntPtr*, int>**)ThisPtr)[6](ThisPtr, MarshalString.GetAbi(ref __uri), &__retval));
return new ObjectReferenceValue(__retval);
}
}
}


[StructLayout(LayoutKind.Sequential)]
#if EMBED
internal
#else
public
#endif
unsafe struct Uri
{
private static WinRTUriRuntimeClassFactory Instance = ActivationFactory.Get("Windows.Foundation.Uri");

public static IObjectReference CreateMarshaler(global::System.Uri value)
{
if (value is null)
{
return null;
}

return Instance.CreateUri(value.OriginalString);
return new ObjectReferenceValue(__retval);
}
}
}


[StructLayout(LayoutKind.Sequential)]
#if EMBED
internal
#else
public
#endif
unsafe struct Uri
{
private static WinRTUriRuntimeClassFactory Instance = ActivationFactory.Get("Windows.Foundation.Uri");

public static IObjectReference CreateMarshaler(global::System.Uri value)
{
if (value is null)
{
return null;
}

return Instance.CreateUri(value.OriginalString);
}

public static ObjectReferenceValue CreateMarshaler2(global::System.Uri value)
{
if (value is null)
{
return new ObjectReferenceValue();
}

return Instance.CreateUriForMarshaling(value.OriginalString);
}

public static IntPtr GetAbi(IObjectReference m) => m?.ThisPtr ?? IntPtr.Zero;

public static global::System.Uri FromAbi(IntPtr ptr)
{
if (ptr == IntPtr.Zero)
{
return null;
}

IntPtr rawUri = IntPtr.Zero;
try
{
ExceptionHelpers.ThrowExceptionForHR((**(ABI.Windows.Foundation.IUriRuntimeClassVftbl**)ptr).get_RawUri_10(ptr, &rawUri));
return new global::System.Uri(MarshalString.FromAbi(rawUri));
}
finally
{
MarshalString.DisposeAbi(rawUri);
}
}

public static ObjectReferenceValue CreateMarshaler2(global::System.Uri value)
{
if (value is null)
{
return new ObjectReferenceValue();
}

return Instance.CreateUriForMarshaling(value.OriginalString);
}

public static IntPtr GetAbi(IObjectReference m) => m?.ThisPtr ?? IntPtr.Zero;

public static global::System.Uri FromAbi(IntPtr ptr)
{
if (ptr == IntPtr.Zero)
{
return null;
}

IntPtr rawUri = IntPtr.Zero;
try
{
ExceptionHelpers.ThrowExceptionForHR((**(ABI.Windows.Foundation.IUriRuntimeClassVftbl**)ptr).get_RawUri_10(ptr, &rawUri));
return new global::System.Uri(MarshalString.FromAbi(rawUri));
}
finally
{
MarshalString.DisposeAbi(rawUri);
}
public static unsafe global::System.Uri[] FromAbiArray(object box) => MarshalInterfaceHelper<global::System.Uri>.FromAbiArray(box, FromAbi);

public static unsafe void CopyManaged(global::System.Uri o, IntPtr dest)
{
*(IntPtr*)dest.ToPointer() = CreateMarshaler2(o).Detach();
}

public static unsafe global::System.Uri[] FromAbiArray(object box) => MarshalInterfaceHelper<global::System.Uri>.FromAbiArray(box, FromAbi);

public static unsafe void CopyManaged(global::System.Uri o, IntPtr dest)
{
*(IntPtr*)dest.ToPointer() = CreateMarshaler2(o).Detach();
}

public static IntPtr FromManaged(global::System.Uri value)
{
if (value is null)
{
return IntPtr.Zero;
}
return CreateMarshaler2(value).Detach();
public static IntPtr FromManaged(global::System.Uri value)
{
if (value is null)
{
return IntPtr.Zero;
}
return CreateMarshaler2(value).Detach();
}

public static unsafe MarshalInterfaceHelper<global::System.Uri>.MarshalerArray CreateMarshalerArray(global::System.Uri[] array) => MarshalInterfaceHelper<global::System.Uri>.CreateMarshalerArray2(array, (o) => CreateMarshaler2(o));
public static (int length, IntPtr data) GetAbiArray(object box) => MarshalInterfaceHelper<global::System.Uri>.GetAbiArray(box);
public static void CopyAbiArray(global::System.Uri[] array, object box) => MarshalInterfaceHelper<global::System.Uri>.CopyAbiArray(array, box, FromAbi);
public static (int length, IntPtr data) FromManagedArray(global::System.Uri[] array) => MarshalInterfaceHelper<global::System.Uri>.FromManagedArray(array, (o) => FromManaged(o));
public static void DisposeMarshalerArray(MarshalInterfaceHelper<global::System.Uri>.MarshalerArray array) => MarshalInterfaceHelper<global::System.Uri>.DisposeMarshalerArray(array);
public static void DisposeMarshaler(IObjectReference m) { m?.Dispose(); }
public static void DisposeAbi(IntPtr abi) { MarshalInspectable<object>.DisposeAbi(abi); }

public static string GetGuidSignature()
{
return "rc(Windows.Foundation.Uri;{9e365e57-48b2-4160-956f-c7385120bbfc})";
}
}
}
public static unsafe MarshalInterfaceHelper<global::System.Uri>.MarshalerArray CreateMarshalerArray(global::System.Uri[] array) => MarshalInterfaceHelper<global::System.Uri>.CreateMarshalerArray2(array, (o) => CreateMarshaler2(o));
public static (int length, IntPtr data) GetAbiArray(object box) => MarshalInterfaceHelper<global::System.Uri>.GetAbiArray(box);
public static void CopyAbiArray(global::System.Uri[] array, object box) => MarshalInterfaceHelper<global::System.Uri>.CopyAbiArray(array, box, FromAbi);
public static (int length, IntPtr data) FromManagedArray(global::System.Uri[] array) => MarshalInterfaceHelper<global::System.Uri>.FromManagedArray(array, (o) => FromManaged(o));
public static void DisposeMarshalerArray(MarshalInterfaceHelper<global::System.Uri>.MarshalerArray array) => MarshalInterfaceHelper<global::System.Uri>.DisposeMarshalerArray(array);
public static void DisposeMarshaler(IObjectReference m) { m?.Dispose(); }
public static void DisposeAbi(IntPtr abi) { MarshalInspectable<object>.DisposeAbi(abi); }

public static string GetGuidSignature()
{
return "rc(Windows.Foundation.Uri;{9e365e57-48b2-4160-956f-c7385120bbfc})";
}
}
}