// ------------------------------------------------------------------------------ // <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("A1FAF330-EF97-11CE-9BC9-00AA00608E01")] [CLSCompliant(false)] [SupportedOSPlatform("windows5.0")] [global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.287+85e3fa26dd.RR")] internal unsafe partial struct IOleParentUndoUnit :winmdroot.IVTable<IOleParentUndoUnit,IOleParentUndoUnit.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]<IOleParentUndoUnit*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IOleParentUndoUnit*)Unsafe.AsPointer(ref this), riid, ppvObject); } public uint AddRef() { return ((delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,uint>)lpVtbl[1])((IOleParentUndoUnit*)Unsafe.AsPointer(ref this)); } public uint Release() { return ((delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,uint>)lpVtbl[2])((IOleParentUndoUnit*)Unsafe.AsPointer(ref this)); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT Do(IOleParentUndoUnit* pThis, winmdroot.System.Ole.IOleUndoManager* pUndoManager) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.Do(pUndoManager); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public unsafe void Do(winmdroot.System.Ole.IOleUndoManager* pUndoManager) { ((delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,winmdroot.System.Ole.IOleUndoManager* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IOleParentUndoUnit*)Unsafe.AsPointer(ref this), pUndoManager).ThrowOnFailure(); } /// <inheritdoc cref="GetDescription(winmdroot.Foundation.BSTR*)"/> [OverloadResolutionPriority(1)] internal unsafe void GetDescription(out winmdroot.Foundation.BSTR pBstr) { fixed (winmdroot.Foundation.BSTR* pBstrLocal = &pBstr) { this.GetDescription(pBstrLocal); } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetDescription(IOleParentUndoUnit* pThis, winmdroot.Foundation.BSTR* pBstr) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetDescription(pBstr); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public unsafe void GetDescription(winmdroot.Foundation.BSTR* pBstr) { ((delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IOleParentUndoUnit*)Unsafe.AsPointer(ref this), pBstr).ThrowOnFailure(); } /// <inheritdoc cref="GetUnitType(global::System.Guid*, int*)"/> [OverloadResolutionPriority(1)] internal unsafe void GetUnitType(out global::System.Guid pClsid, out int plID) { fixed (int* plIDLocal = &plID) { fixed (global::System.Guid* pClsidLocal = &pClsid) { this.GetUnitType(pClsidLocal, plIDLocal); } } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetUnitType(IOleParentUndoUnit* pThis, global::System.Guid* pClsid, int* plID) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetUnitType(pClsid, plID); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public unsafe void GetUnitType(global::System.Guid* pClsid, int* plID) { ((delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,global::System.Guid* ,int* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IOleParentUndoUnit*)Unsafe.AsPointer(ref this), pClsid, plID).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT OnNextAdd(IOleParentUndoUnit* pThis) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.OnNextAdd(); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } public void OnNextAdd() { ((delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IOleParentUndoUnit*)Unsafe.AsPointer(ref this)).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT Open(IOleParentUndoUnit* pThis, winmdroot.System.Ole.IOleParentUndoUnit* pPUU) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.Open(pPUU); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Opens a new parent undo unit, which becomes part of the containing unit's undo stack.</summary> /// <param name="pPUU">An <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ioleparentundounit">IOleParentUndoUnit</a> pointer to the parent undo unit to be opened.</param> /// <returns>This method returns S_OK if the parent undo unit was successfully opened or it is currently blocked.</returns> /// <remarks> /// <para>The specified parent unit is created and remains open. The undo manager then calls the <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleparentundounit-add">IOleParentUndoUnit::Add</a> or <b>IOleParentUndoUnit::Open</b> methods on this parent unit to add new units to it. This parent unit receives any additional undo units until its <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleparentundounit-close">IOleParentUndoUnit::Close</a> method is called. The parent unit specified by <i>pPUU</i> is not added to the undo stack until its <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleparentundounit-close">IOleParentUndoUnit::Close</a> method is called with the <i>fCommit</i> parameter set to <b>TRUE</b>. The parent undo unit or undo manager must contain any undo unit given to it unless it is blocked. If it is blocked, it must return S_OK but should do nothing else.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleparentundounit-open#">Read more on learn.microsoft.com</see>.</para> /// </remarks> public unsafe void Open(winmdroot.System.Ole.IOleParentUndoUnit* pPUU) { ((delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,winmdroot.System.Ole.IOleParentUndoUnit* ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IOleParentUndoUnit*)Unsafe.AsPointer(ref this), pPUU).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT Close(IOleParentUndoUnit* pThis, winmdroot.System.Ole.IOleParentUndoUnit* pPUU, winmdroot.Foundation.BOOL fCommit) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.Close(pPUU, fCommit); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Closes the specified parent undo unit. (IOleParentUndoUnit.Close)</summary> /// <param name="pPUU">An <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ioleparentundounit">IOleParentUndoUnit</a> pointer to the currently open parent unit to be closed.</param> /// <param name="fCommit">Indicates whether to keep or discard the unit. If <b>TRUE</b>, the unit is kept in the collection. If <b>FALSE</b>, the unit is discarded. This parameter is used to allow the client to discard an undo unit under construction if an error or a cancellation occurs.</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> /// <para>A parent undo unit knows it is being closed when it returns S_FALSE from this method. At that time, it should terminate any communication with other objects which may be giving data to it through private interfaces. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> An error return indicates a fatal error condition. The parent unit or undo manager must accept the undo unit if <i>fCommit</i> is <b>TRUE</b>. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> To process a close request, a parent undo unit first checks to see if it has an open child unit. If it does not, it returns S_FALSE. If it does have a child unit open, it calls the <b>IOleParentUndoUnit::Close</b> method on the child. If the child returns S_FALSE, then the parent undo unit verifies that <i>pPUU</i> points to the child unit, and closes that child undo unit. If the child returns S_OK then it handled the close internally and its parent should do nothing. If the parent unit is blocked, it should check the <i>pPUU</i> parameter to determine the appropriate return code. If <i>pPUU</i> is pointing to itself, then it should return S_FALSE. Otherwise, it should return S_OK; the <i>fCommit</i> parameter is ignored; and no action is taken. If <i>pPUU</i> does not match the currently open parent undo unit, then implementations of this method should return E_INVALIDARG without changing any internal state. The only exception to this is if the unit is blocked.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleparentundounit-close#">Read more on learn.microsoft.com</see>.</para> /// </remarks> public unsafe void Close(winmdroot.System.Ole.IOleParentUndoUnit* pPUU, winmdroot.Foundation.BOOL fCommit) { ((delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,winmdroot.System.Ole.IOleParentUndoUnit* ,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IOleParentUndoUnit*)Unsafe.AsPointer(ref this), pPUU, fCommit).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT Add(IOleParentUndoUnit* pThis, winmdroot.System.Ole.IOleUndoUnit* pUU) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.Add(pUU); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Adds a simple undo unit to the collection.</summary> /// <param name="pUU">An <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ioleundounit">IOleUndoUnit</a> pointer to the undo unit to be added.</param> /// <returns>This method returns S_OK if the specified unit was successfully added or the parent unit was blocked.</returns> /// <remarks>The parent undo unit or undo manager must accept any undo unit given to it, unless it is blocked. If it is blocked, it should do nothing but return S_OK.</remarks> public unsafe void Add(winmdroot.System.Ole.IOleUndoUnit* pUU) { ((delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,winmdroot.System.Ole.IOleUndoUnit* ,winmdroot.Foundation.HRESULT>)lpVtbl[9])((IOleParentUndoUnit*)Unsafe.AsPointer(ref this), pUU).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT FindUnit(IOleParentUndoUnit* pThis, winmdroot.System.Ole.IOleUndoUnit* pUU) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.FindUnit(pUU); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Indicates whether the specified unit is a child of this undo unit or one of its children, that is if the specified unit is part of the hierarchy in this parent unit.</summary> /// <param name="pUU">An <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ioleundounit">IOleUndoUnit</a> pointer to the undo unit to be found.</param> /// <returns>This method returns S_OK if the specified undo unit is in the hierarchy subordinate to this parent; otherwise, S_FALSE.</returns> /// <remarks>This is typically called by the undo manager in its implementation of its <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleundomanager-discardfrom">IOleUndoManager::DiscardFrom</a> method in the rare event that the unit being discarded is not a top-level unit. The parent unit should look in its own list first, then delegate to each child that is also a parent unit, as determined by doing a <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-queryinterface(q)">IUnknown::QueryInterface</a> for <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ioleparentundounit">IOleParentUndoUnit</a>.</remarks> public unsafe void FindUnit(winmdroot.System.Ole.IOleUndoUnit* pUU) { ((delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,winmdroot.System.Ole.IOleUndoUnit* ,winmdroot.Foundation.HRESULT>)lpVtbl[10])((IOleParentUndoUnit*)Unsafe.AsPointer(ref this), pUU).ThrowOnFailure(); } /// <inheritdoc cref="GetParentState(uint*)"/> [OverloadResolutionPriority(1)] internal unsafe void GetParentState(out uint pdwState) { fixed (uint* pdwStateLocal = &pdwState) { this.GetParentState(pdwStateLocal); } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetParentState(IOleParentUndoUnit* pThis, uint* pdwState) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetParentState(pdwState); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Retrieves state information about the innermost open parent undo unit. (IOleParentUndoUnit.GetParentState)</summary> /// <param name="pdwState">A pointer to the state information. This information is a value taken from the <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/ne-ocidl-uasflags">UASFLAGS</a> enumeration.</param> /// <returns>This method returns S_OK on success.</returns> /// <remarks> /// <para><h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> If the unit has an open child, it should delegate this method to that child. If not, it should fill in <i>pdwState</i> values appropriately and return. Note that a parent unit must never be blocked while it has an open child. If this happened it could prevent the child unit from being closed, which would cause serious problems. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> When checking for a normal state, use the UAS_MASK value to mask unused bits in the <i>pdwState</i> parameter to this method for future compatibility.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleparentundounit-getparentstate#">Read more on learn.microsoft.com</see>.</para> /// </remarks> public unsafe void GetParentState(uint* pdwState) { ((delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,uint* ,winmdroot.Foundation.HRESULT>)lpVtbl[11])((IOleParentUndoUnit*)Unsafe.AsPointer(ref this), pdwState).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]<IOleParentUndoUnit*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1; internal delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,uint> AddRef_2; internal delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,uint> Release_3; internal delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,winmdroot.System.Ole.IOleUndoManager* ,winmdroot.Foundation.HRESULT> Do_4; internal delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT> GetDescription_5; internal delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,global::System.Guid* ,int* ,winmdroot.Foundation.HRESULT> GetUnitType_6; internal delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,winmdroot.Foundation.HRESULT> OnNextAdd_7; internal delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,winmdroot.System.Ole.IOleParentUndoUnit* ,winmdroot.Foundation.HRESULT> Open_8; internal delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,winmdroot.System.Ole.IOleParentUndoUnit* ,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> Close_9; internal delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,winmdroot.System.Ole.IOleUndoUnit* ,winmdroot.Foundation.HRESULT> Add_10; internal delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,winmdroot.System.Ole.IOleUndoUnit* ,winmdroot.Foundation.HRESULT> FindUnit_11; internal delegate *unmanaged [Stdcall]<IOleParentUndoUnit*,uint* ,winmdroot.Foundation.HRESULT> GetParentState_12; } public static void PopulateVTable(Vtbl* vtable) { vtable->Do_4 = &Do; vtable->GetDescription_5 = &GetDescription; vtable->GetUnitType_6 = &GetUnitType; vtable->OnNextAdd_7 = &OnNextAdd; vtable->Open_8 = &Open; vtable->Close_9 = &Close; vtable->Add_10 = &Add; vtable->FindUnit_11 = &FindUnit; vtable->GetParentState_12 = &GetParentState; } private void** lpVtbl; /// <summary>The IID guid for this interface.</summary> /// <value>{a1faf330-ef97-11ce-9bc9-00aa00608e01}</value> internal static readonly Guid IID_Guid = new Guid(0xA1FAF330, 0xEF97, 0x11CE, 0x9B, 0xC9, 0x00, 0xAA, 0x00, 0x60, 0x8E, 0x01); static ref readonly Guid IComIID.Guid { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { ReadOnlySpan<byte> data = new byte[] { 0x30,0xF3,0xFA,0xA1,0x97,0xEF,0xCE,0x11,0x9B,0xC9,0x00,0xAA,0x00,0x60,0x8E,0x01 }; return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data)); } } [Guid("A1FAF330-EF97-11CE-9BC9-00AA00608E01"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()] [SupportedOSPlatform("windows5.0")] internal interface Interface :winmdroot.System.Ole.IOleUndoUnit.Interface { [PreserveSig()] unsafe new winmdroot.Foundation.HRESULT Do(winmdroot.System.Ole.IOleUndoManager* pUndoManager); [PreserveSig()] unsafe new winmdroot.Foundation.HRESULT GetDescription(winmdroot.Foundation.BSTR* pBstr); [PreserveSig()] unsafe new winmdroot.Foundation.HRESULT GetUnitType(global::System.Guid* pClsid, int* plID); [PreserveSig()] new winmdroot.Foundation.HRESULT OnNextAdd(); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT Open(winmdroot.System.Ole.IOleParentUndoUnit* pPUU); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT Close(winmdroot.System.Ole.IOleParentUndoUnit* pPUU, winmdroot.Foundation.BOOL fCommit); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT Add(winmdroot.System.Ole.IOleUndoUnit* pUU); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT FindUnit(winmdroot.System.Ole.IOleUndoUnit* pUU); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT GetParentState(uint* pdwState); } } } }