// ------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> // ------------------------------------------------------------------------------ #pragma warning disable CS1591,CS1573,CS0465,CS0649,CS8019,CS1570,CS1584,CS1658,CS0436,CS8981,SYSLIB1092,CS3021,CS3019 using global::System; using global::System.Diagnostics; using global::System.Diagnostics.CodeAnalysis; using global::System.Runtime.CompilerServices; using global::System.Runtime.InteropServices; using global::System.Runtime.Versioning; using winmdroot = global::Windows.Win32; namespace Windows.Win32 { namespace System.Ole { [Guid("0000011B-0000-0000-C000-000000000046")] [CLSCompliant(false)] [SupportedOSPlatform("windows5.0")] [global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.287+85e3fa26dd.RR")] internal unsafe partial struct IOleContainer :winmdroot.IVTable<IOleContainer,IOleContainer.Vtbl>,IComIID { /// <inheritdoc cref="QueryInterface(global::System.Guid*, void**)"/> [OverloadResolutionPriority(1)] internal unsafe winmdroot.Foundation.HRESULT QueryInterface(in global::System.Guid riid, out void* ppvObject) { fixed (void** ppvObjectLocal = &ppvObject) { fixed (global::System.Guid* riidLocal = &riid) { winmdroot.Foundation.HRESULT __result = this.QueryInterface(riidLocal, ppvObjectLocal); return __result; } } } public unsafe winmdroot.Foundation.HRESULT QueryInterface(global::System.Guid* riid, void** ppvObject) { return ((delegate *unmanaged [Stdcall]<IOleContainer*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IOleContainer*)Unsafe.AsPointer(ref this), riid, ppvObject); } public uint AddRef() { return ((delegate *unmanaged [Stdcall]<IOleContainer*,uint>)lpVtbl[1])((IOleContainer*)Unsafe.AsPointer(ref this)); } public uint Release() { return ((delegate *unmanaged [Stdcall]<IOleContainer*,uint>)lpVtbl[2])((IOleContainer*)Unsafe.AsPointer(ref this)); } /// <inheritdoc cref="ParseDisplayName(winmdroot.System.Com.IBindCtx*, winmdroot.Foundation.PWSTR, uint*, winmdroot.System.Com.IMoniker**)"/> [OverloadResolutionPriority(1)] internal unsafe void ParseDisplayName(winmdroot.System.Com.IBindCtx* pbc, winmdroot.Foundation.PWSTR pszDisplayName, out uint pchEaten, winmdroot.System.Com.IMoniker** ppmkOut) { fixed (uint* pchEatenLocal = &pchEaten) { this.ParseDisplayName(pbc, pszDisplayName, pchEatenLocal, ppmkOut); } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT ParseDisplayName(IOleContainer* pThis, winmdroot.System.Com.IBindCtx* pbc, winmdroot.Foundation.PWSTR pszDisplayName, uint* pchEaten, winmdroot.System.Com.IMoniker** ppmkOut) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.ParseDisplayName(pbc, pszDisplayName, pchEaten, ppmkOut); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public unsafe void ParseDisplayName(winmdroot.System.Com.IBindCtx* pbc, winmdroot.Foundation.PWSTR pszDisplayName, uint* pchEaten, winmdroot.System.Com.IMoniker** ppmkOut) { ((delegate *unmanaged [Stdcall]<IOleContainer*,winmdroot.System.Com.IBindCtx* ,winmdroot.Foundation.PWSTR ,uint* ,winmdroot.System.Com.IMoniker** ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IOleContainer*)Unsafe.AsPointer(ref this), pbc, pszDisplayName, pchEaten, ppmkOut).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT EnumObjects(IOleContainer* pThis, uint grfFlags, winmdroot.System.Com.IEnumUnknown** ppenum) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.EnumObjects(grfFlags, ppenum); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Enumerates the objects in the current container.</summary> /// <param name="grfFlags">Specifies which objects in a container are to be enumerated, as defined in the enumeration <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/ne-oleidl-olecontf">OLECONTF</a>.</param> /// <param name="ppenum">A pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-ienumunknown">IEnumUnknown</a> pointer variable that receives the interface pointer to the enumerator object. Each time a container receives a successful call to <b>EnumObjects</b>, it must increase the reference count on the <i>ppenum</i> pointer the method returns. It is the caller's responsibility to call <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">IUnknown::Release</a> when it is done with the pointer. If an error is returned, the implementation must set <i>ppenum</i> to <b>NULL</b>.</param> /// <returns> /// <para>This method returns S_OK on success. Other possible return values include the following. </para> /// <para>This doc was truncated.</para> /// </returns> /// <remarks>A container should implement <b>EnumObjects</b> to enable programmatic clients to find out what objects it holds. This method, however, is not called in standard linking scenarios.</remarks> public unsafe void EnumObjects(uint grfFlags, winmdroot.System.Com.IEnumUnknown** ppenum) { ((delegate *unmanaged [Stdcall]<IOleContainer*,uint ,winmdroot.System.Com.IEnumUnknown** ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IOleContainer*)Unsafe.AsPointer(ref this), grfFlags, ppenum).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT LockContainer(IOleContainer* pThis, winmdroot.Foundation.BOOL fLock) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.LockContainer(fLock); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Keeps the container for embedded objects running until explicitly released.</summary> /// <param name="fLock">Indicates whether to lock (<b>TRUE</b>) or unlock (<b>FALSE</b>) a container.</param> /// <returns> /// <para>This method returns S_OK on success. Other possible return values include the following. </para> /// <para>This doc was truncated.</para> /// </returns> /// <remarks>An embedded object calls <b>LockContainer</b> to keep its container running when the object has link clients that require an update. If an end user selects <b>File Close</b> from the container's menu, however, the container ignores all outstanding <b>LockContainer</b> locks and closes the document anyway.</remarks> public void LockContainer(winmdroot.Foundation.BOOL fLock) { ((delegate *unmanaged [Stdcall]<IOleContainer*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IOleContainer*)Unsafe.AsPointer(ref this), fLock).ThrowOnFailure(); } internal unsafe global::Windows.Win32.Foundation.HRESULT QueryInterface<T>(out T* ppv) where T : unmanaged { Guid guid = typeof(T).GUID; void* pv; var hr = this.QueryInterface(&guid, &pv); if (hr.Succeeded) { ppv = (T*)pv; } else { ppv = null; } return hr; } internal struct Vtbl { internal delegate *unmanaged [Stdcall]<IOleContainer*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1; internal delegate *unmanaged [Stdcall]<IOleContainer*,uint> AddRef_2; internal delegate *unmanaged [Stdcall]<IOleContainer*,uint> Release_3; internal delegate *unmanaged [Stdcall]<IOleContainer*,winmdroot.System.Com.IBindCtx* ,winmdroot.Foundation.PWSTR ,uint* ,winmdroot.System.Com.IMoniker** ,winmdroot.Foundation.HRESULT> ParseDisplayName_4; internal delegate *unmanaged [Stdcall]<IOleContainer*,uint ,winmdroot.System.Com.IEnumUnknown** ,winmdroot.Foundation.HRESULT> EnumObjects_5; internal delegate *unmanaged [Stdcall]<IOleContainer*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> LockContainer_6; } public static void PopulateVTable(Vtbl* vtable) { vtable->ParseDisplayName_4 = &ParseDisplayName; vtable->EnumObjects_5 = &EnumObjects; vtable->LockContainer_6 = &LockContainer; } private void** lpVtbl; /// <summary>The IID guid for this interface.</summary> /// <value>{0000011b-0000-0000-c000-000000000046}</value> internal static readonly Guid IID_Guid = new Guid(0x0000011B, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46); static ref readonly Guid IComIID.Guid { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { ReadOnlySpan<byte> data = new byte[] { 0x1B,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 }; return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data)); } } [Guid("0000011B-0000-0000-C000-000000000046"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()] [SupportedOSPlatform("windows5.0")] internal interface Interface :winmdroot.System.Ole.IParseDisplayName.Interface { [PreserveSig()] unsafe new winmdroot.Foundation.HRESULT ParseDisplayName(winmdroot.System.Com.IBindCtx* pbc, winmdroot.Foundation.PWSTR pszDisplayName, uint* pchEaten, winmdroot.System.Com.IMoniker** ppmkOut); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT EnumObjects(uint grfFlags, winmdroot.System.Com.IEnumUnknown** ppenum); [PreserveSig()] winmdroot.Foundation.HRESULT LockContainer(winmdroot.Foundation.BOOL fLock); } } } }