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

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

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

			/// <inheritdoc cref="Bind(winmdroot.Foundation.PWSTR, uint, ushort, winmdroot.System.Com.ITypeInfo**, winmdroot.System.Com.DESCKIND*, winmdroot.System.Com.BINDPTR*)"/>
			internal unsafe winmdroot.Foundation.HRESULT Bind(winmdroot.Foundation.PWSTR szName, uint lHashVal, ushort wFlags, winmdroot.System.Com.ITypeInfo** ppTInfo, out winmdroot.System.Com.DESCKIND pDescKind, out winmdroot.System.Com.BINDPTR pBindPtr)
			{
				fixed (winmdroot.System.Com.BINDPTR* pBindPtrLocal = &pBindPtr)
				{
					fixed (winmdroot.System.Com.DESCKIND* pDescKindLocal = &pDescKind)
					{
						winmdroot.Foundation.HRESULT __result = this.Bind(szName, lHashVal, wFlags, ppTInfo, pDescKindLocal, pBindPtrLocal);
						return __result;
					}
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Bind(ITypeComp* pThis, winmdroot.Foundation.PWSTR szName, uint lHashVal, ushort wFlags, winmdroot.System.Com.ITypeInfo** ppTInfo, winmdroot.System.Com.DESCKIND* pDescKind, winmdroot.System.Com.BINDPTR* pBindPtr)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.Bind(szName, lHashVal, wFlags, ppTInfo, pDescKind, pBindPtr);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Maps a name to a member of a type, or binds global variables and functions contained in a type library.</summary>
			/// <param name="szName">The name to be bound.</param>
			/// <param name="lHashVal">The hash value for the name computed by <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-lhashvalofnamesys">LHashValOfNameSys</a>.</param>
			/// <param name="wFlags">One or more of the flags defined in the INVOKEKIND enumeration. Specifies whether the name was referenced as a method or a property. When binding to a variable, specify the flag INVOKE_PROPERTYGET. Specify zero to bind to any type of member.</param>
			/// <param name="ppTInfo">If a FUNCDESC or VARDESC was returned, then <i>ppTInfo</i> points to a pointer to the type description that contains the item to which it is bound.</param>
			/// <param name="pDescKind">Indicates whether the name bound to is a VARDESC, FUNCDESC, or TYPECOMP. If there was no match, DESCKIND_NONE.</param>
			/// <param name="pBindPtr">The bound-to VARDESC, FUNCDESC, or <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypecomp">ITypeComp</a> interface.</param>
			/// <returns>
			/// <para>This method can return one of these values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>Use <b>Bind</b> for binding to the variables and methods of a type, or for binding to the global variables and methods in a type library. The returned DESCKIND pointer <i>pDescKind</i> indicates whether the name was bound to a VARDESC, a FUNCDESC, or to an <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypecomp">ITypeComp</a> instance. The returned <i>pBindPtr</i> points to the VARDESC, FUNCDESC, or <b>ITypeComp</b>. If a data member or method is bound to, then ppTInfopoints to the type description that contains the method or data member.</para>
			/// <para>If <b>Bind</b> binds the name to a nested binding context, it returns a pointer to an <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypecomp">ITypeComp</a> instance in <i>pBindPtr</i> and a null type description pointer in <i>ppTInfo</i>. For example, if the name of a type description is passed for a module (TKIND_MODULE), enumeration (TKIND_ENUM), or coclass (TKIND_COCLASS), Bind returns the <b>ITypeComp</b> instance of the type description for the module, enumeration, or coclass. This feature supports languages such as Visual Basic that allow references to members of a type description to be qualified by the name of the type description. For example, a function in a module can be referenced by <i>modulename</i>.<i>functionname.</i> The members of TKIND_ENUM, TKIND_MODULE, and TKIND_COCLASS types marked as Application objects can be bound to directly 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. The <b>ITypeComp</b> of a coclass defers to the <b>ITypeComp</b> of its default interface.</para>
			/// <para>As with other methods of <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypecomp">ITypeComp</a>, <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypeinfo">ITypeInfo</a>, and <b>ITypeInfo</b>, the calling code is responsible for releasing the returned object instances or structures. If a VARDESC or FUNCDESC is returned, the caller is responsible for deleting it with the returned type description and releasing the type description instance itself. Otherwise, if an <b>ITypeComp</b> instance is returned, the caller must release it.</para>
			/// <para>Special rules apply if you call a type library's <b>Bind</b> method, passing it the name of a member of an Application object class (a class that has the TYPEFLAG_FAPPOBJECT flag set). In this case, Bind returns DESCKIND_IMPLICITAPPOBJ in <i>pDescKind</i>, a VARDESC that describes the Application object in <i>pBindPtr</i>, and the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypeinfo">ITypeInfo</a> of the Application object class in <i>ppTInfo</i>. To bind to the object, <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nf-oaidl-itypeinfo-gettypecomp">ITypeInfo::GetTypeComp</a> must make a call to get the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypecomp">ITypeComp</a> of the Application object class, and then reinvoke its <b>Bind</b> method with the name initially passed to the type library's <b>ITypeComp</b>.</para>
			/// <para>The caller should use the returned <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypeinfo">ITypeInfo</a> pointer (<i>ppTInfo</i>) to get the address of the member.</para>
			/// <para><div class="alert"><b>Note</b>  The <i>wflags</i> parameter is the same as the <i>wflags</i> parameter in <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nf-oaidl-idispatch-invoke">IDispatch::Invoke</a>. </div> <div> </div></para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oaidl/nf-oaidl-itypecomp-bind#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT Bind(winmdroot.Foundation.PWSTR szName, uint lHashVal, ushort wFlags, winmdroot.System.Com.ITypeInfo** ppTInfo, winmdroot.System.Com.DESCKIND* pDescKind, winmdroot.System.Com.BINDPTR* pBindPtr)
			{
				return ((delegate *unmanaged [Stdcall]<ITypeComp*,winmdroot.Foundation.PWSTR ,uint ,ushort ,winmdroot.System.Com.ITypeInfo** ,winmdroot.System.Com.DESCKIND* ,winmdroot.System.Com.BINDPTR* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((ITypeComp*)Unsafe.AsPointer(ref this), szName, lHashVal, wFlags, ppTInfo, pDescKind, pBindPtr);
			}

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

			/// <summary>Binds to the type descriptions contained within a type library.</summary>
			/// <param name="szName">The name to be bound.</param>
			/// <param name="lHashVal">The hash value for the name computed by <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-lhashvalofname">LHashValOfName</a>.</param>
			/// <param name="ppTInfo">An <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypeinfo">ITypeInfo</a> of the type to which the name was bound.</param>
			/// <param name="ppTComp">Passes a valid pointer, such as the address of an <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypecomp">ITypeComp</a> variable.</param>
			/// <returns>
			/// <para>This method can return one of these values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>Use the function <b>BindType</b> for binding a type name to the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypeinfo">ITypeInfo</a> that describes the type. This function is invoked on the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-itypecomp">ITypeComp</a> that is returned by <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nf-oaidl-itypelib-gettypecomp">ITypeLib::GetTypeComp</a> to bind to types defined within that library. It can also be used in the future for binding to nested types.</remarks>
			public unsafe winmdroot.Foundation.HRESULT BindType(winmdroot.Foundation.PWSTR szName, uint lHashVal, winmdroot.System.Com.ITypeInfo** ppTInfo, winmdroot.System.Com.ITypeComp** ppTComp)
			{
				return ((delegate *unmanaged [Stdcall]<ITypeComp*,winmdroot.Foundation.PWSTR ,uint ,winmdroot.System.Com.ITypeInfo** ,winmdroot.System.Com.ITypeComp** ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((ITypeComp*)Unsafe.AsPointer(ref this), szName, lHashVal, ppTInfo, ppTComp);
			}

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

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

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

				internal delegate *unmanaged [Stdcall]<ITypeComp*,winmdroot.Foundation.PWSTR ,uint ,ushort ,winmdroot.System.Com.ITypeInfo** ,winmdroot.System.Com.DESCKIND* ,winmdroot.System.Com.BINDPTR* ,winmdroot.Foundation.HRESULT> Bind_4;

				internal delegate *unmanaged [Stdcall]<ITypeComp*,winmdroot.Foundation.PWSTR ,uint ,winmdroot.System.Com.ITypeInfo** ,winmdroot.System.Com.ITypeComp** ,winmdroot.Foundation.HRESULT> BindType_5;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->Bind_4 = &Bind;
				vtable->BindType_5 = &BindType;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{00020403-0000-0000-c000-000000000046}</value>
			internal static readonly Guid IID_Guid = new Guid(0x00020403, 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[]					{
0x03,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("00020403-0000-0000-C000-000000000046"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT Bind(winmdroot.Foundation.PWSTR szName, uint lHashVal, ushort wFlags, winmdroot.System.Com.ITypeInfo** ppTInfo, winmdroot.System.Com.DESCKIND* pDescKind, winmdroot.System.Com.BINDPTR* pBindPtr);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT BindType(winmdroot.Foundation.PWSTR szName, uint lHashVal, winmdroot.System.Com.ITypeInfo** ppTInfo, winmdroot.System.Com.ITypeComp** ppTComp);
			}
		}
	}
}