using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using ComputeSharp.Win32; #pragma warning disable CS0649, IDE0055, IDE1006 namespace ABI.Microsoft.Graphics.Canvas; /// /// An interop wrapper type for Win2D objects (see ). /// [NativeTypeName("class ICanvasResourceWrapperNative : IUnknown")] [NativeInheritance("IUnknown")] internal unsafe struct ICanvasResourceWrapperNative : IComObject { /// static Guid* IComObject.IID { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { ReadOnlySpan data = [ 0x8D, 0x68, 0x10, 0x5F, 0x55, 0xEA, 0x55, 0x4D, 0xA3, 0xB0, 0x4D, 0xDB, 0x55, 0xC0, 0xC2, 0x0A ]; return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); } } public void** lpVtbl; /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(0)] public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) { return ((delegate* unmanaged[Stdcall])this.lpVtbl[0])((ICanvasResourceWrapperNative*)Unsafe.AsPointer(ref this), riid, ppvObject); } /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(1)] [return: NativeTypeName("ULONG")] public uint AddRef() { return ((delegate* unmanaged[Stdcall])this.lpVtbl[1])((ICanvasResourceWrapperNative*)Unsafe.AsPointer(ref this)); } /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(2)] [return: NativeTypeName("ULONG")] public uint Release() { return ((delegate* unmanaged[Stdcall])this.lpVtbl[2])((ICanvasResourceWrapperNative*)Unsafe.AsPointer(ref this)); } /// /// Interface provided by various Win2D objects that is able to retrieve the wrapped resource. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(3)] public HRESULT GetNativeResource(ICanvasDevice* device, float dpi, [NativeTypeName("REFIID")] Guid* iid, void** resource) { return ((delegate* unmanaged[Stdcall])this.lpVtbl[3])((ICanvasResourceWrapperNative*)Unsafe.AsPointer(ref this), device, dpi, iid, resource); } }