<PackageReference Include="System.Drawing.Common" Version="9.0.8" />

IComCallableWrapper

using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Win32.Foundation; namespace Windows.Win32.System.Com { internal struct IComCallableWrapper : IComIID, IVTable<IComCallableWrapper, IComCallableWrapper.Vtbl>, IVTable { public struct Vtbl { internal IntPtr QueryInterface_1; internal IntPtr AddRef_2; internal IntPtr Release_3; } [ComImport] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [Guid("73B17DAF-0480-4702-AF7C-AF3BD4715D71")] public interface Interface { } private unsafe readonly void** _vtbl; public static Guid IID_Guid { get; } = new Guid(1941011887, 1152, 18178, 175, 124, 175, 59, 212, 113, 93, 113); [IsReadOnly] static unsafe ref Guid IComIID.Guid { [MethodImpl(MethodImplOptions.AggressiveInlining)] [return: IsReadOnly] get { return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(new ReadOnlySpan<byte>(&global::<PrivateImplementationDetails>.B210345D6E192B6C46DBC6E62B13D5E2BC9A0C5B34249EFAA509ACAD73B65D31, 16))); } } public unsafe HRESULT QueryInterface([In] [IsReadOnly] ref Guid riid, out void* ppvObject) { fixed (void** ppvObject2 = &ppvObject) { fixed (Guid* riid2 = &riid) { return QueryInterface(riid2, ppvObject2); } } } public unsafe HRESULT QueryInterface(Guid* riid, void** ppvObject) { fixed (IComCallableWrapper* ptr = &this) { IntPtr vtbl = (IntPtr)(*_vtbl); return (HRESULT); } } public unsafe uint AddRef() { fixed (IComCallableWrapper* ptr = &this) { IntPtr intPtr = (IntPtr)_vtbl[1]; return (uint); } } public unsafe uint Release() { fixed (IComCallableWrapper* ptr = &this) { IntPtr intPtr = (IntPtr)_vtbl[2]; return (uint); } } unsafe static void IVTable<IComCallableWrapper, Vtbl>.PopulateVTable(Vtbl* vtable) { } } }