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

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

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

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static uint GetTypeInfoCount(ITypeLib* pThis)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					__hr.ThrowOnFailure();
					return __object.GetTypeInfoCount();
				}
				catch (Exception ex)
				{
					global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex);
					throw;
				}
			}

			/// <summary>Provides the number of type descriptions that are in a type library.</summary>
			/// <returns>The number of type descriptions in the type library.</returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oaidl/nf-oaidl-itypelib-gettypeinfocount">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public uint GetTypeInfoCount()
			{
				return ((delegate *unmanaged [Stdcall]<ITypeLib*,uint>)lpVtbl[3])((ITypeLib*)Unsafe.AsPointer(ref this));
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetTypeInfo(ITypeLib* pThis, uint index, winmdroot.System.Com.ITypeInfo** ppTInfo)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetTypeInfo(index, ppTInfo);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves the specified type description in the library.</summary>
			/// <param name="index">The index of the interface to be returned.</param>
			/// <param name="ppTInfo">If successful, returns a pointer to the pointer to the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypeinfo">ITypeInfo</a> interface.</param>
			/// <returns>
			/// <para>This method can return one of these values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>For dual interfaces, <b>GetTypeInfo</b> returns only the TKIND_DISPATCH type information. To get the TKIND_INTERFACE type information, <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nf-oaidl-itypeinfo-getreftypeofimpltype">GetRefTypeOfImplType</a> can be called on the TKIND_DISPATCH type information, passing an index of –1. Then, the returned type information handle can be passed to <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nf-oaidl-itypeinfo-getreftypeinfo">GetRefTypeInfo</a>.</remarks>
			public unsafe winmdroot.Foundation.HRESULT GetTypeInfo(uint index, winmdroot.System.Com.ITypeInfo** ppTInfo)
			{
				return ((delegate *unmanaged [Stdcall]<ITypeLib*,uint ,winmdroot.System.Com.ITypeInfo** ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((ITypeLib*)Unsafe.AsPointer(ref this), index, ppTInfo);
			}

			/// <inheritdoc cref="GetTypeInfoType(uint, winmdroot.System.Com.TYPEKIND*)"/>
			internal unsafe winmdroot.Foundation.HRESULT GetTypeInfoType(uint index, out winmdroot.System.Com.TYPEKIND pTKind)
			{
				fixed (winmdroot.System.Com.TYPEKIND* pTKindLocal = &pTKind)
				{
					winmdroot.Foundation.HRESULT __result = this.GetTypeInfoType(index, pTKindLocal);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetTypeInfoType(ITypeLib* pThis, uint index, winmdroot.System.Com.TYPEKIND* pTKind)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetTypeInfoType(index, pTKind);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves the type of a type description.</summary>
			/// <param name="index">The index of the type description within the type library.</param>
			/// <param name="pTKind">The <a href="https://docs.microsoft.com/windows/desktop/api/oaidl/ne-oaidl-typekind">TYPEKIND</a> enumeration value for the type description.</param>
			/// <returns>
			/// <para>This method can return one of these values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oaidl/nf-oaidl-itypelib-gettypeinfotype">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetTypeInfoType(uint index, winmdroot.System.Com.TYPEKIND* pTKind)
			{
				return ((delegate *unmanaged [Stdcall]<ITypeLib*,uint ,winmdroot.System.Com.TYPEKIND* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((ITypeLib*)Unsafe.AsPointer(ref this), index, pTKind);
			}

			/// <inheritdoc cref="GetTypeInfoOfGuid(global::System.Guid*, winmdroot.System.Com.ITypeInfo**)"/>
			internal unsafe winmdroot.Foundation.HRESULT GetTypeInfoOfGuid(in global::System.Guid guid, winmdroot.System.Com.ITypeInfo** ppTinfo)
			{
				fixed (global::System.Guid* guidLocal = &guid)
				{
					winmdroot.Foundation.HRESULT __result = this.GetTypeInfoOfGuid(guidLocal, ppTinfo);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetTypeInfoOfGuid(ITypeLib* pThis, global::System.Guid* guid, winmdroot.System.Com.ITypeInfo** ppTinfo)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetTypeInfoOfGuid(guid, ppTinfo);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves the type description that corresponds to the specified GUID.</summary>
			/// <param name="guid">The GUID of the type description.</param>
			/// <param name="ppTinfo">The <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypeinfo">ITypeInfo</a> interface.</param>
			/// <returns>
			/// <para>This method can return one of these values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oaidl/nf-oaidl-itypelib-gettypeinfoofguid">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetTypeInfoOfGuid(global::System.Guid* guid, winmdroot.System.Com.ITypeInfo** ppTinfo)
			{
				return ((delegate *unmanaged [Stdcall]<ITypeLib*,global::System.Guid* ,winmdroot.System.Com.ITypeInfo** ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((ITypeLib*)Unsafe.AsPointer(ref this), guid, ppTinfo);
			}

			/// <inheritdoc cref="GetLibAttr(winmdroot.System.Com.TLIBATTR**)"/>
			internal unsafe winmdroot.Foundation.HRESULT GetLibAttr(out winmdroot.System.Com.TLIBATTR* ppTLibAttr)
			{
				fixed (winmdroot.System.Com.TLIBATTR** ppTLibAttrLocal = &ppTLibAttr)
				{
					winmdroot.Foundation.HRESULT __result = this.GetLibAttr(ppTLibAttrLocal);
					return __result;
				}
			}

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

			/// <summary>Retrieves the structure that contains the library's attributes.</summary>
			/// <param name="ppTLibAttr">The library's attributes.</param>
			/// <returns>
			/// <para>This method can return one of these values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>Use <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nf-oaidl-itypelib-releasetlibattr">ITypeLib::ReleaseTLibAttr</a> to free the memory occupied by the TLIBATTR structure.</remarks>
			public unsafe winmdroot.Foundation.HRESULT GetLibAttr(winmdroot.System.Com.TLIBATTR** ppTLibAttr)
			{
				return ((delegate *unmanaged [Stdcall]<ITypeLib*,winmdroot.System.Com.TLIBATTR** ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((ITypeLib*)Unsafe.AsPointer(ref this), ppTLibAttr);
			}

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

			/// <summary>Enables a client compiler to bind to the types, variables, constants, and global functions for a library.</summary>
			/// <param name="ppTComp">The <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypecomp">ITypeComp</a> instance for this <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypelib">ITypeLib</a>. A client compiler uses the methods in the <b>ITypeComp</b> interface to bind to types in <b>ITypeLib</b>, as well as to the global functions, variables, and constants defined in <b>ITypeLib</b></param>
			/// <returns>
			/// <para>This method can return one of these values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>The <a href="https://docs.microsoft.com/windows/desktop/api/oaidl/nf-oaidl-itypecomp-bind">Bind</a> function of the returned <b>TypeComp</b> binds to global functions, variables, constants, enumerated values, and coclass members. The <b>Bind</b> function also binds the names of the TYPEKIND enumerations of TKIND_MODULE, TKIND_ENUM, and TKIND_COCLASS. These names shadow any global names defined within the type information. The members of TKIND_ENUM, TKIND_MODULE, and TKIND_COCLASS types marked as Application objects can be directly bound to from <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypecomp">ITypeComp</a> without specifying the name of the module.</para>
			/// <para><a href="https://docs.microsoft.com/windows/desktop/api/oaidl/nf-oaidl-itypecomp-bind">ITypeComp::Bind</a> and <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nf-oaidl-itypecomp-bindtype">ITypeComp::BindType</a> accept only unqualified names. <b>ITypeLib::GetTypeComp</b> returns a pointer to the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypecomp">ITypeComp</a> interface, which is then used to bind to global elements in the library. The names of some types (TKIND_ENUM, TKIND_MODULE, and TKIND_COCLASS) share the name space with variables, functions, constants, and enumerators. If a member requires qualification to differentiate it from other items in the name space, <b>GetTypeComp</b> can be called successively for each qualifier in order to bind to the desired member. This allows programming language compilers to access members of modules, enumerations, and coclasses, even though the member can't be bound to with a qualified name.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oaidl/nf-oaidl-itypelib-gettypecomp#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetTypeComp(winmdroot.System.Com.ITypeComp** ppTComp)
			{
				return ((delegate *unmanaged [Stdcall]<ITypeLib*,winmdroot.System.Com.ITypeComp** ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((ITypeLib*)Unsafe.AsPointer(ref this), ppTComp);
			}

			/// <inheritdoc cref="GetDocumentation(int, winmdroot.Foundation.BSTR*, winmdroot.Foundation.BSTR*, uint*, winmdroot.Foundation.BSTR*)"/>
			internal unsafe winmdroot.Foundation.HRESULT GetDocumentation(int index, winmdroot.Foundation.BSTR* pBstrName, winmdroot.Foundation.BSTR* pBstrDocString, out uint pdwHelpContext, winmdroot.Foundation.BSTR* pBstrHelpFile)
			{
				fixed (uint* pdwHelpContextLocal = &pdwHelpContext)
				{
					winmdroot.Foundation.HRESULT __result = this.GetDocumentation(index, pBstrName, pBstrDocString, pdwHelpContextLocal, pBstrHelpFile);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetDocumentation(ITypeLib* pThis, int index, [Optional] winmdroot.Foundation.BSTR* pBstrName, [Optional] winmdroot.Foundation.BSTR* pBstrDocString, uint* pdwHelpContext, [Optional] winmdroot.Foundation.BSTR* pBstrHelpFile)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetDocumentation(index, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves the documentation string for the library, the complete Help file name and path, and the context identifier for the library Help topic in the Help file.</summary>
			/// <param name="index">The index of the type description whose documentation is to be returned. If <i>index</i> is -1, then the documentation for the library itself is returned.</param>
			/// <param name="pBstrName">The name of the specified item. If the caller does not need the item name, then <i>pBstrName</i> can be null.</param>
			/// <param name="pBstrDocString">The documentation string for the specified item. If the caller does not need the documentation string, then <i>pBstrDocString</i> can be null..</param>
			/// <param name="pdwHelpContext">The Help context identifier (ID) associated with the specified item. If the caller does not need the Help context ID, then <i>pdwHelpContext</i> can be null.</param>
			/// <param name="pBstrHelpFile">The fully qualified name of the Help file. If the caller does not need the Help file name, then <i>pBstrHelpFile</i> can be null.</param>
			/// <returns>
			/// <para>This method can return one of these values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>The caller should free the parameters <i>pBstrName</i>, <i>pBstrDocString</i>, and <i>pBstrHelpFile</i>.</remarks>
			public unsafe winmdroot.Foundation.HRESULT GetDocumentation(int index, [Optional] winmdroot.Foundation.BSTR* pBstrName, [Optional] winmdroot.Foundation.BSTR* pBstrDocString, uint* pdwHelpContext, [Optional] winmdroot.Foundation.BSTR* pBstrHelpFile)
			{
				return ((delegate *unmanaged [Stdcall]<ITypeLib*,int ,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.BSTR* ,uint* ,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT>)lpVtbl[9])((ITypeLib*)Unsafe.AsPointer(ref this), index, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile);
			}

			/// <inheritdoc cref="IsName(winmdroot.Foundation.PWSTR, uint, winmdroot.Foundation.BOOL*)"/>
			internal unsafe winmdroot.Foundation.HRESULT IsName(ref Span<char>szNameBuf, uint lHashVal, out winmdroot.Foundation.BOOL pfName)
			{
				if (szNameBuf != null && szNameBuf.LastIndexOf('\0') == -1)					throw new ArgumentException("Required null terminator missing.", "szNameBuf");
				fixed (winmdroot.Foundation.BOOL* pfNameLocal = &pfName)
				{
					fixed (char* pszNameBuf = szNameBuf)
					{
						winmdroot.Foundation.PWSTR wstrszNameBuf = pszNameBuf;
						winmdroot.Foundation.HRESULT __result = this.IsName(wstrszNameBuf, lHashVal, pfNameLocal);
						szNameBuf = szNameBuf.Slice(0, wstrszNameBuf.Length);
						return __result;
					}
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT IsName(ITypeLib* pThis, winmdroot.Foundation.PWSTR szNameBuf, uint lHashVal, winmdroot.Foundation.BOOL* pfName)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.IsName(szNameBuf, lHashVal, pfName);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Indicates whether a passed-in string contains the name of a type or member described in the library.</summary>
			/// <param name="szNameBuf">The string to test. If this method is successful, <i>szNameBuf</i> is modified to match the case (capitalization) found in the type library.</param>
			/// <param name="lHashVal">The hash value of <i>szNameBuf</i>.</param>
			/// <param name="pfName">True if <i>szNameBuf</i> was found in the type library; otherwise false.</param>
			/// <returns>
			/// <para>This method can return one of these values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oaidl/nf-oaidl-itypelib-isname">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT IsName(winmdroot.Foundation.PWSTR szNameBuf, uint lHashVal, winmdroot.Foundation.BOOL* pfName)
			{
				return ((delegate *unmanaged [Stdcall]<ITypeLib*,winmdroot.Foundation.PWSTR ,uint ,winmdroot.Foundation.BOOL* ,winmdroot.Foundation.HRESULT>)lpVtbl[10])((ITypeLib*)Unsafe.AsPointer(ref this), szNameBuf, lHashVal, pfName);
			}

			/// <inheritdoc cref="FindName(winmdroot.Foundation.PWSTR, uint, winmdroot.System.Com.ITypeInfo**, int*, ushort*)"/>
			internal unsafe winmdroot.Foundation.HRESULT FindName(ref Span<char>szNameBuf, uint lHashVal, winmdroot.System.Com.ITypeInfo** ppTInfo, int* rgMemId, ref ushort pcFound)
			{
				if (szNameBuf != null && szNameBuf.LastIndexOf('\0') == -1)					throw new ArgumentException("Required null terminator missing.", "szNameBuf");
				fixed (ushort* pcFoundLocal = &pcFound)
				{
					fixed (char* pszNameBuf = szNameBuf)
					{
						winmdroot.Foundation.PWSTR wstrszNameBuf = pszNameBuf;
						winmdroot.Foundation.HRESULT __result = this.FindName(wstrszNameBuf, lHashVal, ppTInfo, rgMemId, pcFoundLocal);
						szNameBuf = szNameBuf.Slice(0, wstrszNameBuf.Length);
						return __result;
					}
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT FindName(ITypeLib* pThis, winmdroot.Foundation.PWSTR szNameBuf, uint lHashVal, winmdroot.System.Com.ITypeInfo** ppTInfo, int* rgMemId, ushort* pcFound)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.FindName(szNameBuf, lHashVal, ppTInfo, rgMemId, pcFound);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Finds occurrences of a type description in a type library. This may be used to quickly verify that a name exists in a type library.</summary>
			/// <param name="szNameBuf">The name to search for.</param>
			/// <param name="lHashVal">A hash value to speed up the search, computed by the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-lhashvalofnamesys">LHashValOfNameSys</a> function. If <i>lHashVal</i> = 0, a value is computed.</param>
			/// <param name="ppTInfo">An array of pointers to the type descriptions that contain the name specified in <i>szNameBuf</i>. This parameter cannot be null.</param>
			/// <param name="rgMemId">An array of the found items; <i>rgMemId</i>[<i>i</i>] is the MEMBERID that indexes into the type description specified by <i>ppTInfo</i>[<i>i</i>]. This parameter cannot be null.</param>
			/// <param name="pcFound">
			/// <para>On entry, indicates how many instances to look for. For example, *<i>pcFound</i> = 1 can be called to find the first occurrence. The search stops when one is found. On exit, indicates the number of instances that were found. If the in and out values of *<i>pcFound</i> are identical, there may be more type descriptions that contain the name.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oaidl/nf-oaidl-itypelib-findname#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <returns>
			/// <para>This method can return one of these values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>Passing *<i>pcFound</i> = <i>n</i> indicates that there is enough room in the <i>ppTInfo</i> and <i>rgMemId</i> arrays for <i>n</i> (<i>ptinfo</i>, <i>memid</i>) pairs. The function returns MEMBERID_NIL in <i>rgMemId</i>[<i>i</i>], if the name in <i>szNameBuf</i> is the name of the type information in <i>ppTInfo</i>[<i>i</i>].</remarks>
			public unsafe winmdroot.Foundation.HRESULT FindName(winmdroot.Foundation.PWSTR szNameBuf, uint lHashVal, winmdroot.System.Com.ITypeInfo** ppTInfo, int* rgMemId, ushort* pcFound)
			{
				return ((delegate *unmanaged [Stdcall]<ITypeLib*,winmdroot.Foundation.PWSTR ,uint ,winmdroot.System.Com.ITypeInfo** ,int* ,ushort* ,winmdroot.Foundation.HRESULT>)lpVtbl[11])((ITypeLib*)Unsafe.AsPointer(ref this), szNameBuf, lHashVal, ppTInfo, rgMemId, pcFound);
			}

			/// <inheritdoc cref="ReleaseTLibAttr(winmdroot.System.Com.TLIBATTR*)"/>
			internal unsafe void ReleaseTLibAttr(in winmdroot.System.Com.TLIBATTR pTLibAttr)
			{
				fixed (winmdroot.System.Com.TLIBATTR* pTLibAttrLocal = &pTLibAttr)
				{
					this.ReleaseTLibAttr(pTLibAttrLocal);
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static void ReleaseTLibAttr(ITypeLib* pThis, winmdroot.System.Com.TLIBATTR* pTLibAttr)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					__hr.ThrowOnFailure();
					__object.ReleaseTLibAttr(pTLibAttr);
				}
				catch (Exception ex)
				{
					global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex);
					throw;
				}
			}

			/// <summary>Releases the TLIBATTR originally obtained from GetLibAttr.</summary>
			/// <param name="pTLibAttr">The TLIBATTR to be freed.</param>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oaidl/nf-oaidl-itypelib-releasetlibattr">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void ReleaseTLibAttr(winmdroot.System.Com.TLIBATTR* pTLibAttr)
			{
				((delegate *unmanaged [Stdcall]<ITypeLib*,winmdroot.System.Com.TLIBATTR* ,void>)lpVtbl[12])((ITypeLib*)Unsafe.AsPointer(ref this), pTLibAttr);
			}

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

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

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

				internal delegate *unmanaged [Stdcall]<ITypeLib*,uint> GetTypeInfoCount_4;

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

				internal delegate *unmanaged [Stdcall]<ITypeLib*,uint ,winmdroot.System.Com.TYPEKIND* ,winmdroot.Foundation.HRESULT> GetTypeInfoType_6;

				internal delegate *unmanaged [Stdcall]<ITypeLib*,global::System.Guid* ,winmdroot.System.Com.ITypeInfo** ,winmdroot.Foundation.HRESULT> GetTypeInfoOfGuid_7;

				internal delegate *unmanaged [Stdcall]<ITypeLib*,winmdroot.System.Com.TLIBATTR** ,winmdroot.Foundation.HRESULT> GetLibAttr_8;

				internal delegate *unmanaged [Stdcall]<ITypeLib*,winmdroot.System.Com.ITypeComp** ,winmdroot.Foundation.HRESULT> GetTypeComp_9;

				internal delegate *unmanaged [Stdcall]<ITypeLib*,int ,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.BSTR* ,uint* ,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT> GetDocumentation_10;

				internal delegate *unmanaged [Stdcall]<ITypeLib*,winmdroot.Foundation.PWSTR ,uint ,winmdroot.Foundation.BOOL* ,winmdroot.Foundation.HRESULT> IsName_11;

				internal delegate *unmanaged [Stdcall]<ITypeLib*,winmdroot.Foundation.PWSTR ,uint ,winmdroot.System.Com.ITypeInfo** ,int* ,ushort* ,winmdroot.Foundation.HRESULT> FindName_12;

				internal delegate *unmanaged [Stdcall]<ITypeLib*,winmdroot.System.Com.TLIBATTR* ,void> ReleaseTLibAttr_13;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->GetTypeInfoCount_4 = &GetTypeInfoCount;
				vtable->GetTypeInfo_5 = &GetTypeInfo;
				vtable->GetTypeInfoType_6 = &GetTypeInfoType;
				vtable->GetTypeInfoOfGuid_7 = &GetTypeInfoOfGuid;
				vtable->GetLibAttr_8 = &GetLibAttr;
				vtable->GetTypeComp_9 = &GetTypeComp;
				vtable->GetDocumentation_10 = &GetDocumentation;
				vtable->IsName_11 = &IsName;
				vtable->FindName_12 = &FindName;
				vtable->ReleaseTLibAttr_13 = &ReleaseTLibAttr;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{00020402-0000-0000-c000-000000000046}</value>
			internal static readonly Guid IID_Guid = new Guid(0x00020402, 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[]					{
0x02,0x04,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("00020402-0000-0000-C000-000000000046"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			internal interface Interface
			{
								[PreserveSig()]
uint GetTypeInfoCount();

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetTypeInfo(uint index, winmdroot.System.Com.ITypeInfo** ppTInfo);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetTypeInfoType(uint index, winmdroot.System.Com.TYPEKIND* pTKind);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetTypeInfoOfGuid(global::System.Guid* guid, winmdroot.System.Com.ITypeInfo** ppTinfo);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetLibAttr(winmdroot.System.Com.TLIBATTR** ppTLibAttr);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetTypeComp(winmdroot.System.Com.ITypeComp** ppTComp);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetDocumentation(int index, [Optional] winmdroot.Foundation.BSTR* pBstrName, [Optional] winmdroot.Foundation.BSTR* pBstrDocString, uint* pdwHelpContext, [Optional] winmdroot.Foundation.BSTR* pBstrHelpFile);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT IsName(winmdroot.Foundation.PWSTR szNameBuf, uint lHashVal, winmdroot.Foundation.BOOL* pfName);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT FindName(winmdroot.Foundation.PWSTR szNameBuf, uint lHashVal, winmdroot.System.Com.ITypeInfo** ppTInfo, int* rgMemId, ushort* pcFound);

				[PreserveSig()]
				unsafe void ReleaseTLibAttr(winmdroot.System.Com.TLIBATTR* pTLibAttr);
			}
		}
	}
}