File: Windows.Win32.IEnumIDList.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 UI.Shell
	{
		[Guid("000214F2-0000-0000-C000-000000000046")]
		[SupportedOSPlatform("windows5.1.2600")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IEnumIDList
			:IVTable<IEnumIDList,IEnumIDList.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]<IEnumIDList*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IEnumIDList*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Next(IEnumIDList* pThis, uint celt, winmdroot.UI.Shell.Common.ITEMIDLIST** rgelt, [Optional] 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 item identifiers in the enumeration sequence and advances the current position by the number of items retrieved.</summary>
			/// <param name="celt">
			/// <para>Type: <b>ULONG</b> The number of elements in the array referenced by the <i>rgelt</i> parameter.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ienumidlist-next#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <param name="rgelt">
			/// <para>Type: <b>LPITEMIDLIST*</b> The address of a pointer to an array of <a href="https://docs.microsoft.com/windows/desktop/api/shtypes/ns-shtypes-itemidlist">ITEMIDLIST</a> pointers that receive the item identifiers. The implementation must allocate these item identifiers using <a href="https://docs.microsoft.com/windows/desktop/api/combaseapi/nf-combaseapi-cotaskmemalloc">CoTaskMemAlloc</a>. The calling application is responsible for freeing the item identifiers using <a href="https://docs.microsoft.com/windows/desktop/api/combaseapi/nf-combaseapi-cotaskmemfree">CoTaskMemFree</a>.</para>
			/// <para>The <a href="https://docs.microsoft.com/windows/desktop/api/shtypes/ns-shtypes-itemidlist">ITEMIDLIST</a> structures returned in the array are relative to the <a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ishellfolder">IShellFolder</a> being enumerated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ienumidlist-next#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <param name="pceltFetched">
			/// <para>Type: <b>ULONG*</b> A pointer to a value that receives a count of the item identifiers actually returned in <i>rgelt</i>. The count can be smaller than the value specified in the <i>celt</i> parameter. This parameter can be <b>NULL</b> on entry only if <i>celt</i> = 1, because in that case the method can only retrieve one (S_OK) or zero (S_FALSE) items.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ienumidlist-next#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <returns>
			/// <para>Type: <b>HRESULT</b> Returns S_OK if the method successfully retrieved the requested <i>celt</i> elements. This method only returns S_OK if the full count of requested items are successfully retrieved.</para>
			/// <para>S_FALSE indicates that more items were requested than remained in the enumeration. The value pointed to by the <i>pceltFetched</i> parameter specifies the actual number of items retrieved. Note that the value will be 0 if there are no more items to retrieve. Returns a COM-defined error value otherwise.</para>
			/// </returns>
			/// <remarks>
			/// <para>If this method returns a Component Object Model (COM) error code (as determined by the <a href="https://docs.microsoft.com/windows/desktop/api/winerror/nf-winerror-failed">FAILED</a> macro), then no entries in the <i>rgelt</i> array are valid on exit. If this method returns a success code (such as S_OK or S_FALSE), then the <b>ULONG</b> pointed to by the <i>pceltFetched</i> parameter determines how many entries in the <i>rgelt</i> array are valid on exit. The distinction is important in the case where <i>celt</i> &gt; 1. For example, if you pass <i>celt</i>=10 and there are only 3 elements left, *<i>pceltFetched</i> will be 3 and the method will return S_FALSE meaning that you reached the end of the file. The three fetched elements will be stored into <i>rgelt</i> and are valid.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ienumidlist-next#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT Next(uint celt, winmdroot.UI.Shell.Common.ITEMIDLIST** rgelt, [Optional] uint* pceltFetched)
			{
				return ((delegate *unmanaged [Stdcall]<IEnumIDList*,uint ,winmdroot.UI.Shell.Common.ITEMIDLIST** ,uint* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IEnumIDList*)Unsafe.AsPointer(ref this), celt, rgelt, pceltFetched);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Skip(IEnumIDList* 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 the specified number of elements in the enumeration sequence.</summary>
			/// <param name="celt">
			/// <para>Type: <b>ULONG</b> The number of item identifiers to skip.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ienumidlist-skip#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <returns>
			/// <para>Type: <b>HRESULT</b> Returns S_OK if successful, or a COM-defined error value otherwise.</para>
			/// </returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ienumidlist-skip">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT Skip(uint celt)
			{
				return ((delegate *unmanaged [Stdcall]<IEnumIDList*,uint ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IEnumIDList*)Unsafe.AsPointer(ref this), celt);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Reset(IEnumIDList* 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>Returns to the beginning of the enumeration sequence.</summary>
			/// <returns>
			/// <para>Type: <b>HRESULT</b> Returns S_OK if successful, or a COM-defined error value otherwise.</para>
			/// </returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ienumidlist-reset">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT Reset()
			{
				return ((delegate *unmanaged [Stdcall]<IEnumIDList*,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IEnumIDList*)Unsafe.AsPointer(ref this));
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Clone(IEnumIDList* pThis, winmdroot.UI.Shell.IEnumIDList** 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 item enumeration object with the same contents and state as the current one. (IEnumIDList.Clone)</summary>
			/// <param name="ppenum">
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ienumidlist">IEnumIDList</a>**</b> The address of a pointer to the new enumeration object. The calling application must eventually free the new object by calling its <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">Release</a> member function.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ienumidlist-clone#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <returns>
			/// <para>Type: <b>HRESULT</b> Returns S_OK if successful, or a COM-defined error value otherwise.</para>
			/// </returns>
			/// <remarks>This method makes it possible to record a particular point in the enumeration sequence and then return to that point at a later time.</remarks>
			public unsafe winmdroot.Foundation.HRESULT Clone(winmdroot.UI.Shell.IEnumIDList** ppenum)
			{
				return ((delegate *unmanaged [Stdcall]<IEnumIDList*,winmdroot.UI.Shell.IEnumIDList** ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IEnumIDList*)Unsafe.AsPointer(ref this), ppenum);
			}

			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]<IEnumIDList*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

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

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

				internal delegate *unmanaged [Stdcall]<IEnumIDList*,uint ,winmdroot.UI.Shell.Common.ITEMIDLIST** ,uint* ,winmdroot.Foundation.HRESULT> Next_4;

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

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

				internal delegate *unmanaged [Stdcall]<IEnumIDList*,winmdroot.UI.Shell.IEnumIDList** ,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>{000214f2-0000-0000-c000-000000000046}</value>
			internal static readonly Guid IID_Guid = new Guid(0x000214F2, 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[]					{
0xF2,0x14,0x02,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("000214F2-0000-0000-C000-000000000046"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.1.2600")]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT Next(uint celt, winmdroot.UI.Shell.Common.ITEMIDLIST** rgelt, [Optional] uint* pceltFetched);

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

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

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT Clone(winmdroot.UI.Shell.IEnumIDList** ppenum);
			}
		}
	}
}