File: Windows.Win32.IEnumOleUndoUnits.g.cs
Project: src\src\System.Windows.Forms.Primitives\src\System.Windows.Forms.Primitives.csproj (System.Windows.Forms.Primitives)
// ------------------------------------------------------------------------------
// <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
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("B3E7C340-EF97-11CE-9BC9-00AA00608E01")]
		[SupportedOSPlatform("windows5.0")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IEnumOleUndoUnits
			:IVTable<IEnumOleUndoUnits,IEnumOleUndoUnits.Vtbl>,IComIID		{
			/// <inheritdoc cref="QueryInterface(global::System.Guid*, void**)"/>
			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]<IEnumOleUndoUnits*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IEnumOleUndoUnits*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

			public uint AddRef()
			{
				return ((delegate *unmanaged [Stdcall]<IEnumOleUndoUnits*,uint>)lpVtbl[1])((IEnumOleUndoUnits*)Unsafe.AsPointer(ref this));
			}

			public uint Release()
			{
				return ((delegate *unmanaged [Stdcall]<IEnumOleUndoUnits*,uint>)lpVtbl[2])((IEnumOleUndoUnits*)Unsafe.AsPointer(ref this));
			}

			/// <inheritdoc cref="Next(uint, winmdroot.System.Ole.IOleUndoUnit**, uint*)"/>
			internal unsafe winmdroot.Foundation.HRESULT Next(uint cElt, winmdroot.System.Ole.IOleUndoUnit** rgElt, out uint pcEltFetched)
			{
				fixed (uint* pcEltFetchedLocal = &pcEltFetched)
				{
					winmdroot.Foundation.HRESULT __result = this.Next(cElt, rgElt, pcEltFetchedLocal);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Next(IEnumOleUndoUnits* pThis, uint cElt, winmdroot.System.Ole.IOleUndoUnit** rgElt, uint* pcEltFetched)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.Next(cElt, rgElt, pcEltFetched);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves the specified number of items in the enumeration sequence. (IEnumOleUndoUnits.Next)</summary>
			/// <param name="cElt">The number of items to be retrieved. If there are fewer than the requested number of items left in the sequence, this method retrieves the remaining elements.</param>
			/// <param name="rgElt">
			/// <para>An array of enumerated items. The enumerator is responsible for calling <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-addref">AddRef</a>, and the caller is responsible for calling <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">Release</a> through each pointer enumerated. If <i>cElt</i> is greater than 1, the caller must also pass a non-NULL pointer passed to <i>pcEltFetched</i> to know how many pointers to release.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ienumoleundounits-next#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <param name="pcEltFetched">The number of items that were retrieved. This parameter is always less than or equal to the number of items requested.</param>
			/// <returns>If the method retrieves the number of items requested, the return value is S_OK. Otherwise, it is S_FALSE.</returns>
			/// <remarks>
			/// <para>The caller is responsible for calling the Release method for each element in the array once this method returns successfully. If cUndoUnits is greater than one, the caller must also pass a non-NULL pointer to pcFetched to get the number of pointers it has to release.</para>
			/// <para>E_NOTIMPL is not allowed as a return value. If an error value is returned, no entries in the rgpcd array are valid on exit and require no release.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ienumoleundounits-next#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT Next(uint cElt, winmdroot.System.Ole.IOleUndoUnit** rgElt, uint* pcEltFetched)
			{
				return ((delegate *unmanaged [Stdcall]<IEnumOleUndoUnits*,uint ,winmdroot.System.Ole.IOleUndoUnit** ,uint* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IEnumOleUndoUnits*)Unsafe.AsPointer(ref this), cElt, rgElt, pcEltFetched);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Skip(IEnumOleUndoUnits* pThis, uint cElt)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.Skip(cElt);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Skips over the specified number of items in the enumeration sequence. (IEnumOleUndoUnits.Skip)</summary>
			/// <param name="cElt">The number of items to be skipped.</param>
			/// <returns>If the method skips the number of items requested, the return value is S_OK. Otherwise, it is S_FALSE.</returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ienumoleundounits-skip">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public void Skip(uint cElt)
			{
				((delegate *unmanaged [Stdcall]<IEnumOleUndoUnits*,uint ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IEnumOleUndoUnits*)Unsafe.AsPointer(ref this), cElt).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Reset(IEnumOleUndoUnits* pThis)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.Reset();
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Resets the enumeration sequence to the beginning. (IEnumOleUndoUnits.Reset)</summary>
			/// <returns>This method returns S_OK on success.</returns>
			/// <remarks>There is no guarantee that the same set of objects will be enumerated after the reset operation has completed. A static collection is reset to the beginning, but it can be too expensive for some collections, such as files in a directory, to guarantee this condition.</remarks>
			public void Reset()
			{
				((delegate *unmanaged [Stdcall]<IEnumOleUndoUnits*,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IEnumOleUndoUnits*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Clone(IEnumOleUndoUnits* pThis, winmdroot.System.Ole.IEnumOleUndoUnits** ppEnum)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.Clone(ppEnum);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Creates a new enumerator that contains the same enumeration state as the current one. (IEnumOleUndoUnits.Clone)</summary>
			/// <param name="ppEnum">A pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ienumoleundounits">IEnumOleUndoUnits</a> interface pointer on the newly created enumerator. The caller must release this enumerator separately from the one from which it was cloned.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ienumoleundounits-clone">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void Clone(winmdroot.System.Ole.IEnumOleUndoUnits** ppEnum)
			{
				((delegate *unmanaged [Stdcall]<IEnumOleUndoUnits*,winmdroot.System.Ole.IEnumOleUndoUnits** ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IEnumOleUndoUnits*)Unsafe.AsPointer(ref this), ppEnum).ThrowOnFailure();
			}

			internal unsafe global::Windows.Win32.Foundation.HRESULT QueryInterface<T>(out T* ppv)
where T : unmanaged

			{
				var hr = this.QueryInterface(typeof(T).GUID, out void* pv);
				if (hr.Succeeded)

				{
					ppv = (T*)pv;
				}
				else

				{
					ppv = null;
				}

				return hr;
			}

			internal struct Vtbl
			{
				internal delegate *unmanaged [Stdcall]<IEnumOleUndoUnits*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

				internal delegate *unmanaged [Stdcall]<IEnumOleUndoUnits*,uint> AddRef_2;

				internal delegate *unmanaged [Stdcall]<IEnumOleUndoUnits*,uint> Release_3;

				internal delegate *unmanaged [Stdcall]<IEnumOleUndoUnits*,uint ,winmdroot.System.Ole.IOleUndoUnit** ,uint* ,winmdroot.Foundation.HRESULT> Next_4;

				internal delegate *unmanaged [Stdcall]<IEnumOleUndoUnits*,uint ,winmdroot.Foundation.HRESULT> Skip_5;

				internal delegate *unmanaged [Stdcall]<IEnumOleUndoUnits*,winmdroot.Foundation.HRESULT> Reset_6;

				internal delegate *unmanaged [Stdcall]<IEnumOleUndoUnits*,winmdroot.System.Ole.IEnumOleUndoUnits** ,winmdroot.Foundation.HRESULT> Clone_7;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->Next_4 = &Next;
				vtable->Skip_5 = &Skip;
				vtable->Reset_6 = &Reset;
				vtable->Clone_7 = &Clone;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{b3e7c340-ef97-11ce-9bc9-00aa00608e01}</value>
			internal static readonly Guid IID_Guid = new Guid(0xB3E7C340, 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[]					{
0x40,0xC3,0xE7,0xB3,0x97,0xEF,0xCE,0x11,0x9B,0xC9,0x00,0xAA,0x00,0x60,0x8E,0x01					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("B3E7C340-EF97-11CE-9BC9-00AA00608E01"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.0")]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT Next(uint cElt, winmdroot.System.Ole.IOleUndoUnit** rgElt, uint* pcEltFetched);

								[PreserveSig()]
winmdroot.Foundation.HRESULT Skip(uint cElt);

								[PreserveSig()]
winmdroot.Foundation.HRESULT Reset();

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT Clone(winmdroot.System.Ole.IEnumOleUndoUnits** ppEnum);
			}
		}
	}
}