File: Windows.Win32.ITextStoryRanges.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.Controls.RichEdit
	{
		[Guid("8CC497C5-A1DF-11CE-8098-00AA0047BE5D")]
		[SupportedOSPlatform("windows6.0.6000")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct ITextStoryRanges
			:IVTable<ITextStoryRanges,ITextStoryRanges.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]<ITextStoryRanges*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((ITextStoryRanges*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

			/// <inheritdoc cref="GetTypeInfoCount(uint*)"/>
			internal unsafe void GetTypeInfoCount(out uint pctinfo)
			{
				fixed (uint* pctinfoLocal = &pctinfo)
				{
					this.GetTypeInfoCount(pctinfoLocal);
				}
			}

			public unsafe void GetTypeInfoCount(uint* pctinfo)
			{
				((delegate *unmanaged [Stdcall]<ITextStoryRanges*,uint* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((ITextStoryRanges*)Unsafe.AsPointer(ref this), pctinfo).ThrowOnFailure();
			}

			public unsafe void GetTypeInfo(uint iTInfo, uint lcid, winmdroot.System.Com.ITypeInfo** ppTInfo)
			{
				((delegate *unmanaged [Stdcall]<ITextStoryRanges*,uint ,uint ,winmdroot.System.Com.ITypeInfo** ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((ITextStoryRanges*)Unsafe.AsPointer(ref this), iTInfo, lcid, ppTInfo).ThrowOnFailure();
			}

			/// <inheritdoc cref="GetIDsOfNames(global::System.Guid*, winmdroot.Foundation.PWSTR*, uint, uint, int*)"/>
			internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
			{
				fixed (int* rgDispIdLocal = rgDispId)
				{
					fixed (winmdroot.Foundation.PWSTR* rgszNamesLocal = rgszNames)
					{
						fixed (global::System.Guid* riidLocal = &riid)
						{
							if (rgszNames.Length != rgDispId.Length)								throw new ArgumentException();
							this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )rgDispId.Length, lcid, rgDispIdLocal);
						}
					}
				}
			}

			public unsafe void GetIDsOfNames(global::System.Guid* riid, winmdroot.Foundation.PWSTR* rgszNames, uint cNames, uint lcid, int* rgDispId)
			{
				((delegate *unmanaged [Stdcall]<ITextStoryRanges*,global::System.Guid* ,winmdroot.Foundation.PWSTR* ,uint ,uint ,int* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((ITextStoryRanges*)Unsafe.AsPointer(ref this), riid, rgszNames, cNames, lcid, rgDispId).ThrowOnFailure();
			}

			/// <inheritdoc cref="Invoke(int, global::System.Guid*, uint, winmdroot.System.Com.DISPATCH_FLAGS, winmdroot.System.Com.DISPPARAMS*, winmdroot.System.Variant.VARIANT*, winmdroot.System.Com.EXCEPINFO*, uint*)"/>
			internal unsafe void Invoke(int dispIdMember, in global::System.Guid riid, uint lcid, winmdroot.System.Com.DISPATCH_FLAGS wFlags, in winmdroot.System.Com.DISPPARAMS pDispParams, winmdroot.System.Variant.VARIANT* pVarResult, winmdroot.System.Com.EXCEPINFO* pExcepInfo, uint* puArgErr)
			{
				fixed (winmdroot.System.Com.DISPPARAMS* pDispParamsLocal = &pDispParams)
				{
					fixed (global::System.Guid* riidLocal = &riid)
					{
						this.Invoke(dispIdMember, riidLocal, lcid, wFlags, pDispParamsLocal, pVarResult, pExcepInfo, puArgErr);
					}
				}
			}

			public unsafe void Invoke(int dispIdMember, global::System.Guid* riid, uint lcid, winmdroot.System.Com.DISPATCH_FLAGS wFlags, winmdroot.System.Com.DISPPARAMS* pDispParams, [Optional] winmdroot.System.Variant.VARIANT* pVarResult, [Optional] winmdroot.System.Com.EXCEPINFO* pExcepInfo, [Optional] uint* puArgErr)
			{
				((delegate *unmanaged [Stdcall]<ITextStoryRanges*,int ,global::System.Guid* ,uint ,winmdroot.System.Com.DISPATCH_FLAGS ,winmdroot.System.Com.DISPPARAMS* ,winmdroot.System.Variant.VARIANT* ,winmdroot.System.Com.EXCEPINFO* ,uint* ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((ITextStoryRanges*)Unsafe.AsPointer(ref this), dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr).ThrowOnFailure();
			}

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

			/// <summary>Retrieves an IEnumVARIANT enumerator interface for this collection of stories.</summary>
			/// <param name="ppunkEnum">
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nn-unknwn-iunknown">IUnknown</a>**</b> The pointer to the enumerator interface.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextstoryranges-_newenum#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <returns>
			/// <para>Type: <b>HRESULT</b> If the method succeeds, it returns <b>S_OK</b>. If the method fails, it returns one of the following error codes. For more information about COM error codes, see <a href="https://docs.microsoft.com/windows/desktop/com/error-handling-in-com">Error Handling in COM</a>. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>This definition together with the implementation of <b>IEnumVARIANT</b>, enables one to support the following Microsoft Visual Basic for Applications (VBA) code.</para>
			/// <para></para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextstoryranges-_newenum#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void _NewEnum(winmdroot.System.Com.IUnknown** ppunkEnum)
			{
				((delegate *unmanaged [Stdcall]<ITextStoryRanges*,winmdroot.System.Com.IUnknown** ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((ITextStoryRanges*)Unsafe.AsPointer(ref this), ppunkEnum).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Item(ITextStoryRanges* pThis, int Index, winmdroot.UI.Controls.RichEdit.ITextRange** ppRange)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.Item(Index, ppRange);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves an ITextRange object for the Indexth story in this story collection.</summary>
			/// <param name="Index">
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">LONG</a></b> Index of story range that is retrieved. The default value is 1, which indicates the first story in the collection. <i>Count</i>, given by <a href="https://docs.microsoft.com/windows/desktop/api/tom/nf-tom-itextstoryranges-getcount">ITextStoryRanges::GetCount</a>, indicates the last story in the collection. If <i>Index</i> is less than zero, the stories are counted from last to first, with -1 being the index of the last story in the collection, and <i>Index</i> = - <i>Count</i> indicating the first story in the collection.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextstoryranges-item#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <param name="ppRange">
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/tom/nn-tom-itextrange">ITextRange</a>**</b> The <a href="https://docs.microsoft.com/windows/desktop/api/tom/nn-tom-itextrange">ITextRange</a> object.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextstoryranges-item#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <returns>
			/// <para>Type: <b>HRESULT</b> The method returns an <b>HRESULT</b> value. If the method succeeds, it returns <b>S_OK</b>. If the method fails, it returns one of the following error codes. For more information about COM error codes, see <a href="https://docs.microsoft.com/windows/desktop/com/error-handling-in-com">Error Handling in COM</a>. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextstoryranges-item">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void Item(int Index, winmdroot.UI.Controls.RichEdit.ITextRange** ppRange)
			{
				((delegate *unmanaged [Stdcall]<ITextStoryRanges*,int ,winmdroot.UI.Controls.RichEdit.ITextRange** ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((ITextStoryRanges*)Unsafe.AsPointer(ref this), Index, ppRange).ThrowOnFailure();
			}

			/// <inheritdoc cref="GetCount(int*)"/>
			internal unsafe void GetCount(out int pCount)
			{
				fixed (int* pCountLocal = &pCount)
				{
					this.GetCount(pCountLocal);
				}
			}

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

			/// <summary>Retrieves the number of stories in the specified stories collection.</summary>
			/// <param name="pCount">
			/// <para>Type: <b>long*</b> The count of stories.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextstoryranges-getcount#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <returns>
			/// <para>Type: <b>HRESULT</b> This method returns <b>S_OK</b>.</para>
			/// </returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextstoryranges-getcount">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void GetCount(int* pCount)
			{
				((delegate *unmanaged [Stdcall]<ITextStoryRanges*,int* ,winmdroot.Foundation.HRESULT>)lpVtbl[9])((ITextStoryRanges*)Unsafe.AsPointer(ref this), pCount).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]<ITextStoryRanges*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

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

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

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

				internal delegate *unmanaged [Stdcall]<ITextStoryRanges*,uint ,uint ,winmdroot.System.Com.ITypeInfo** ,winmdroot.Foundation.HRESULT> GetTypeInfo_5;

				internal delegate *unmanaged [Stdcall]<ITextStoryRanges*,global::System.Guid* ,winmdroot.Foundation.PWSTR* ,uint ,uint ,int* ,winmdroot.Foundation.HRESULT> GetIDsOfNames_6;

				internal delegate *unmanaged [Stdcall]<ITextStoryRanges*,int ,global::System.Guid* ,uint ,winmdroot.System.Com.DISPATCH_FLAGS ,winmdroot.System.Com.DISPPARAMS* ,winmdroot.System.Variant.VARIANT* ,winmdroot.System.Com.EXCEPINFO* ,uint* ,winmdroot.Foundation.HRESULT> Invoke_7;

				internal delegate *unmanaged [Stdcall]<ITextStoryRanges*,winmdroot.System.Com.IUnknown** ,winmdroot.Foundation.HRESULT> _NewEnum_8;

				internal delegate *unmanaged [Stdcall]<ITextStoryRanges*,int ,winmdroot.UI.Controls.RichEdit.ITextRange** ,winmdroot.Foundation.HRESULT> Item_9;

				internal delegate *unmanaged [Stdcall]<ITextStoryRanges*,int* ,winmdroot.Foundation.HRESULT> GetCount_10;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->_NewEnum_8 = &_NewEnum;
				vtable->Item_9 = &Item;
				vtable->GetCount_10 = &GetCount;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{8cc497c5-a1df-11ce-8098-00aa0047be5d}</value>
			internal static readonly Guid IID_Guid = new Guid(0x8CC497C5, 0xA1DF, 0x11CE, 0x80, 0x98, 0x00, 0xAA, 0x00, 0x47, 0xBE, 0x5D);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0xC5,0x97,0xC4,0x8C,0xDF,0xA1,0xCE,0x11,0x80,0x98,0x00,0xAA,0x00,0x47,0xBE,0x5D					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("8CC497C5-A1DF-11CE-8098-00AA0047BE5D"),InterfaceType(ComInterfaceType.InterfaceIsDual),ComImport()]
			[SupportedOSPlatform("windows6.0.6000")]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT _NewEnum(winmdroot.System.Com.IUnknown** ppunkEnum);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT Item(int Index, winmdroot.UI.Controls.RichEdit.ITextRange** ppRange);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetCount(int* pCount);
			}
		}
	}
}