public static unsafe IntPtr CreateWrapper() => (IntPtr)BlindAggregator.CreateInstance();
public static unsafe IntPtr CreateWrapper() { return((IntPtr)BlindAggregator.CreateInstance()); }
private static unsafe int GetGCHandlePtr(BlindAggregator* pThis, out IntPtr pResult) { pResult = pThis->_gcHandle; return S_OK; }
private static unsafe uint Release(BlindAggregator* pThis) { uint result = unchecked((uint)Interlocked.Decrement(ref pThis->_refCount)); if (result == 0u) { pThis->FinalRelease(); Marshal.FreeCoTaskMem((IntPtr)pThis); } return result; }
private static unsafe uint AddRef(BlindAggregator* pThis) { return unchecked((uint)Interlocked.Increment(ref pThis->_refCount)); }
private static unsafe int QueryInterface(BlindAggregator* pThis, [In] ref Guid riid, out IntPtr pvObject) { if (riid == s_IUnknownInterfaceGuid || riid == s_IComWrapperGuid) { AddRef(pThis); pvObject = (IntPtr)pThis; return S_OK; } else if (riid == s_IMarshalInterfaceGuid) { pvObject = IntPtr.Zero; return E_NOINTERFACE; } else { // We don't know what the interface is, so aggregate blindly from here return Marshal.QueryInterface(pThis->_innerUnknown, ref riid, out pvObject); } }