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

Unify all IIDs into 'IID' type #1620

Merged
merged 9 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/WinRT.Runtime/AgileReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ internal unsafe AgileReference(IntPtr thisPtr)
}

IntPtr agileReference = default;
Guid iid = IUnknownVftbl.IID;
Guid iid = IID.IID_IUnknown;
try
{
Marshal.ThrowExceptionForHR(Platform.RoGetAgileReference(
Expand All @@ -92,9 +92,9 @@ internal unsafe AgileReference(IntPtr thisPtr)
}


public IObjectReference Get() => _cookie == IntPtr.Zero ? ABI.WinRT.Interop.IAgileReferenceMethods.Resolve(_agileReference, IUnknownVftbl.IID) : Git.GetInterfaceFromGlobal(_cookie, IUnknownVftbl.IID);
public IObjectReference Get() => _cookie == IntPtr.Zero ? ABI.WinRT.Interop.IAgileReferenceMethods.Resolve(_agileReference, IID.IID_IUnknown) : Git.GetInterfaceFromGlobal(_cookie, IID.IID_IUnknown);

internal ObjectReference<T> Get<T>(Guid iid) => _cookie == IntPtr.Zero ? ABI.WinRT.Interop.IAgileReferenceMethods.Resolve<T>(_agileReference, iid) : Git.GetInterfaceFromGlobal(_cookie, IUnknownVftbl.IID)?.As<T>(iid);
internal ObjectReference<T> Get<T>(Guid iid) => _cookie == IntPtr.Zero ? ABI.WinRT.Interop.IAgileReferenceMethods.Resolve<T>(_agileReference, iid) : Git.GetInterfaceFromGlobal(_cookie, IID.IID_IUnknown)?.As<T>(iid);

protected virtual void Dispose(bool disposing)
{
Expand Down
112 changes: 56 additions & 56 deletions src/WinRT.Runtime/ComWrappersSupport.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/WinRT.Runtime/ComWrappersSupport.net5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/WinRT.Runtime/ComWrappersSupport.netstandard2.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ public ComCallableWrapper(object obj)

InitializeManagedQITable(interfaceTableEntries);

IdentityPtr = _managedQITable[IUnknownVftbl.IID];
IdentityPtr = _managedQITable[IID.IID_IUnknown];
}

~ComCallableWrapper()
Expand Down
4 changes: 1 addition & 3 deletions src/WinRT.Runtime/Interop/IAgileReference.net5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<global::WinRT.Interop.IUnknownVftbl> FromAbi(IntPtr thisPtr) => ObjectReference<global::WinRT.Interop.IUnknownVftbl>.FromAbi(thisPtr, global::WinRT.Interop.IID.IID_IGlobalInterfaceTable);

private readonly ObjectReference<global::WinRT.Interop.IUnknownVftbl> _obj;
Expand Down
Loading