File: Windows.Win32.IEnumSTATSTG.g.cs
Project: src\src\System.Private.Windows.Core\src\System.Private.Windows.Core.csproj (System.Private.Windows.Core)
// ------------------------------------------------------------------------------
// <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.Com.StructuredStorage
	{
		[Guid("0000000D-0000-0000-C000-000000000046")]
		[SupportedOSPlatform("windows5.0")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IEnumSTATSTG
			:IVTable<IEnumSTATSTG,IEnumSTATSTG.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]<IEnumSTATSTG*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IEnumSTATSTG*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

			/// <inheritdoc cref="Next(uint, winmdroot.System.Com.STATSTG*, uint*)"/>
			internal unsafe winmdroot.Foundation.HRESULT Next(Span<winmdroot.System.Com.STATSTG> rgelt, uint* pceltFetched)
			{
				fixed (winmdroot.System.Com.STATSTG* rgeltLocal = rgelt)
				{
					winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, pceltFetched);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Next(IEnumSTATSTG* pThis, uint celt, winmdroot.System.Com.STATSTG* 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 a specified number of STATSTG structures, that follow in the enumeration sequence.</summary>
			/// <param name="celt">The number of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/ns-objidl-statstg">STATSTG</a> structures requested.</param>
			/// <param name="rgelt">An array of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/ns-objidl-statstg">STATSTG</a> structures returned.</param>
			/// <param name="pceltFetched">The number of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/ns-objidl-statstg">STATSTG</a> structures  retrieved in the <i>rgelt</i> parameter.</param>
			/// <returns>
			/// <para>This method supports the following return values: </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-ienumstatstg-next">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT Next(uint celt, winmdroot.System.Com.STATSTG* rgelt, [Optional] uint* pceltFetched)
			{
				return ((delegate *unmanaged [Stdcall]<IEnumSTATSTG*,uint ,winmdroot.System.Com.STATSTG* ,uint* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IEnumSTATSTG*)Unsafe.AsPointer(ref this), celt, rgelt, pceltFetched);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Skip(IEnumSTATSTG* 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 a specified number of STATSTG structures in the enumeration sequence.</summary>
			/// <param name="celt">The number of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/ns-objidl-statstg">STATSTG</a> structures to skip.</param>
			/// <returns>
			/// <para>This method supports the following return values: | Return code | Description | |----------------|---------------| | S_OK | The specified number of **STATSTG** structures that were successfully skipped. | | S_FALSE | The number of **STATSTG** structures skipped is less than the *celt* parameter. |</para>
			/// </returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-ienumstatstg-skip">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT Skip(uint celt)
			{
				return ((delegate *unmanaged [Stdcall]<IEnumSTATSTG*,uint ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IEnumSTATSTG*)Unsafe.AsPointer(ref this), celt);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Reset(IEnumSTATSTG* 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 of the STATSTG structure array.</summary>
			/// <returns>
			/// <para>This method supports the S_OK return value. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-ienumstatstg-reset">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT Reset()
			{
				return ((delegate *unmanaged [Stdcall]<IEnumSTATSTG*,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IEnumSTATSTG*)Unsafe.AsPointer(ref this));
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Clone(IEnumSTATSTG* pThis, winmdroot.System.Com.StructuredStorage.IEnumSTATSTG** 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 STATSTG structure enumerator.</summary>
			/// <param name="ppenum">
			/// <para>A pointer to the variable that receives the  <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-ienumstatstg">IEnumSTATSTG</a> interface pointer. If the method is unsuccessful, the value of the <i>ppenum</i> parameter is undefined.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-ienumstatstg-clone#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <returns>
			/// <para>This method supports the following return values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-ienumstatstg-clone">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT Clone(winmdroot.System.Com.StructuredStorage.IEnumSTATSTG** ppenum)
			{
				return ((delegate *unmanaged [Stdcall]<IEnumSTATSTG*,winmdroot.System.Com.StructuredStorage.IEnumSTATSTG** ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IEnumSTATSTG*)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]<IEnumSTATSTG*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

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

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

				internal delegate *unmanaged [Stdcall]<IEnumSTATSTG*,uint ,winmdroot.System.Com.STATSTG* ,uint* ,winmdroot.Foundation.HRESULT> Next_4;

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

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

				internal delegate *unmanaged [Stdcall]<IEnumSTATSTG*,winmdroot.System.Com.StructuredStorage.IEnumSTATSTG** ,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>{0000000d-0000-0000-c000-000000000046}</value>
			internal static readonly Guid IID_Guid = new Guid(0x0000000D, 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[]					{
0x0D,0x00,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("0000000D-0000-0000-C000-000000000046"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.0")]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT Next(uint celt, winmdroot.System.Com.STATSTG* rgelt, [Optional] uint* pceltFetched);

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

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

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT Clone(winmdroot.System.Com.StructuredStorage.IEnumSTATSTG** ppenum);
			}
		}
	}
}