IGlobalInterfaceTable
using System;
using System.CodeDom.Compiler;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using Windows.Win32.Foundation;
namespace Windows.Win32.System.Com
{
[Guid("00000146-0000-0000-C000-000000000046")]
[SupportedOSPlatform("windows5.0")]
[GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal struct IGlobalInterfaceTable : IVTable<IGlobalInterfaceTable, IGlobalInterfaceTable.Vtbl>, IVTable, IComIID
{
internal struct Vtbl
{
internal IntPtr QueryInterface_1;
internal IntPtr AddRef_2;
internal IntPtr Release_3;
internal IntPtr RegisterInterfaceInGlobal_4;
internal IntPtr RevokeInterfaceFromGlobal_5;
internal IntPtr GetInterfaceFromGlobal_6;
}
[ComImport]
[Guid("00000146-0000-0000-C000-000000000046")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[SupportedOSPlatform("windows5.0")]
internal interface Interface
{
[PreserveSig]
unsafe HRESULT RegisterInterfaceInGlobal(IUnknown* pUnk, Guid* riid, uint* pdwCookie);
[PreserveSig]
HRESULT RevokeInterfaceFromGlobal(uint dwCookie);
[PreserveSig]
unsafe HRESULT GetInterfaceFromGlobal(uint dwCookie, Guid* riid, void** ppv);
}
private unsafe void** lpVtbl;
internal static readonly Guid IID_Guid = new Guid(326, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70);
[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>.91E04C936FAA54D7E61A891D3F1FAA29CEF480E923FA85EA0FE9F074D60BDFB0, 16)));
}
}
internal 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)
{
IntPtr intPtr = (IntPtr)(*lpVtbl);
return (HRESULT);
}
public unsafe uint AddRef()
{
IntPtr intPtr = (IntPtr)lpVtbl[1];
return (uint);
}
public unsafe uint Release()
{
IntPtr intPtr = (IntPtr)lpVtbl[2];
return (uint);
}
internal unsafe HRESULT RegisterInterfaceInGlobal(IUnknown* pUnk, [In] [IsReadOnly] ref Guid riid, out uint pdwCookie)
{
fixed (uint* pdwCookie2 = &pdwCookie) {
fixed (Guid* riid2 = &riid) {
return RegisterInterfaceInGlobal(pUnk, riid2, pdwCookie2);
}
}
}
[UnmanagedCallersOnly(CallConvs = new Type[] {
typeof(CallConvStdcall)
})]
private unsafe static HRESULT RegisterInterfaceInGlobal(IGlobalInterfaceTable* pThis, IUnknown* pUnk, Guid* riid, uint* pdwCookie)
{
try {
Interface object;
HRESULT result = ComHelpers.UnwrapCCW<IGlobalInterfaceTable, Interface>(pThis, out object);
if (!result.Failed)
return object.RegisterInterfaceInGlobal(pUnk, riid, pdwCookie);
return result;
} catch (Exception ex) {
return (HRESULT)ex.HResult;
}
}
public unsafe HRESULT RegisterInterfaceInGlobal(IUnknown* pUnk, Guid* riid, uint* pdwCookie)
{
IntPtr intPtr = (IntPtr)lpVtbl[3];
return (HRESULT);
}
[UnmanagedCallersOnly(CallConvs = new Type[] {
typeof(CallConvStdcall)
})]
private unsafe static HRESULT RevokeInterfaceFromGlobal(IGlobalInterfaceTable* pThis, uint dwCookie)
{
try {
Interface object;
HRESULT result = ComHelpers.UnwrapCCW<IGlobalInterfaceTable, Interface>(pThis, out object);
if (!result.Failed)
return object.RevokeInterfaceFromGlobal(dwCookie);
return result;
} catch (Exception ex) {
return (HRESULT)ex.HResult;
}
}
public unsafe HRESULT RevokeInterfaceFromGlobal(uint dwCookie)
{
IntPtr intPtr = (IntPtr)lpVtbl[4];
return (HRESULT);
}
internal unsafe HRESULT GetInterfaceFromGlobal(uint dwCookie, [In] [IsReadOnly] ref Guid riid, out void* ppv)
{
fixed (void** ppv2 = &ppv) {
fixed (Guid* riid2 = &riid) {
return GetInterfaceFromGlobal(dwCookie, riid2, ppv2);
}
}
}
[UnmanagedCallersOnly(CallConvs = new Type[] {
typeof(CallConvStdcall)
})]
private unsafe static HRESULT GetInterfaceFromGlobal(IGlobalInterfaceTable* pThis, uint dwCookie, Guid* riid, void** ppv)
{
try {
Interface object;
HRESULT result = ComHelpers.UnwrapCCW<IGlobalInterfaceTable, Interface>(pThis, out object);
if (!result.Failed)
return object.GetInterfaceFromGlobal(dwCookie, riid, ppv);
return result;
} catch (Exception ex) {
return (HRESULT)ex.HResult;
}
}
public unsafe HRESULT GetInterfaceFromGlobal(uint dwCookie, Guid* riid, void** ppv)
{
IntPtr intPtr = (IntPtr)lpVtbl[5];
return (HRESULT);
}
internal unsafe HRESULT QueryInterface<[IsUnmanaged] T>(out T* ppv) where T : struct
{
Guid riid = typeof(T).GUID;
void* ppvObject;
HRESULT result = QueryInterface(ref riid, out ppvObject);
if (result.Succeeded)
ppv = (T*)ppvObject;
else
ppv = null;
return result;
}
public unsafe static void PopulateVTable(Vtbl* vtable)
{
vtable->RegisterInterfaceInGlobal_4 = (IntPtr)(void*);
vtable->RevokeInterfaceFromGlobal_5 = (IntPtr)(void*);
vtable->GetInterfaceFromGlobal_6 = (IntPtr)(void*);
}
unsafe void IVTable<IGlobalInterfaceTable, Vtbl>.PopulateVTable(Vtbl* vtable)
{
this.PopulateVTable(vtable);
}
}
}