File: _generated\147\Windows.Win32.IInspectable.g.cs
Web Access
Project: src\winforms\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,SYSLIB1092,CS3021,CS3019
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.WinRT
	{
		[Guid("AF86E2E0-B12D-4C6A-9C5A-D7AA65101E90")]
		[CLSCompliant(false)]
		[SupportedOSPlatform("windows8.0")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.287+85e3fa26dd.RR")]
		internal unsafe partial struct IInspectable
			:IComIID		{
			/// <inheritdoc cref="QueryInterface(global::System.Guid*, void**)"/>
			[OverloadResolutionPriority(1)]
			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]<IInspectable*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IInspectable*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

			/// <inheritdoc cref="GetIids(uint*, global::System.Guid**)"/>
			[OverloadResolutionPriority(1)]
			internal unsafe winmdroot.Foundation.HRESULT GetIids(out uint iidCount, out global::System.Guid* iids)
			{
				fixed (global::System.Guid** iidsLocal = &iids)
				{
					fixed (uint* iidCountLocal = &iidCount)
					{
						winmdroot.Foundation.HRESULT __result = this.GetIids(iidCountLocal, iidsLocal);
						return __result;
					}
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetIids(IInspectable* pThis, uint* iidCount, global::System.Guid** iids)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetIids(iidCount, iids);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Gets the interfaces that are implemented by the current Windows Runtime class.</summary>
			/// <param name="iidCount">
			/// <para>Type: <b>ULONG*</b> The number of interfaces that are implemented by the current Windows Runtime object, excluding the <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nn-unknwn-iunknown">IUnknown</a> and <a href="https://docs.microsoft.com/windows/desktop/api/inspectable/nn-inspectable-iinspectable">IInspectable</a> implementations.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/inspectable/nf-inspectable-iinspectable-getiids#parameters">Read more on learn.microsoft.com</see>.</para>
			/// </param>
			/// <param name="iids">
			/// <para>Type: <b>IID**</b> A pointer to an array that contains an IID for   each interface implemented by the current Windows Runtime object. The <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nn-unknwn-iunknown">IUnknown</a> and <a href="https://docs.microsoft.com/windows/desktop/api/inspectable/nn-inspectable-iinspectable">IInspectable</a> interfaces are excluded.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/inspectable/nf-inspectable-iinspectable-getiids#parameters">Read more on learn.microsoft.com</see>.</para>
			/// </param>
			/// <returns>
			/// <para>Type: <b>HRESULT</b> This function can return the following values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>Use the <b>GetIids</b> method to discover the interfaces that are implemented by a Windows Runtime object. A <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-queryinterface(q)">QueryInterface</a> call on any IID in the <i>iids</i> array must succeed. The caller is responsible for freeing the IID array by using the <a href="https://docs.microsoft.com/windows/desktop/api/combaseapi/nf-combaseapi-cotaskmemfree">CoTaskMemFree</a> function.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/inspectable/nf-inspectable-iinspectable-getiids#">Read more on learn.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetIids(uint* iidCount, global::System.Guid** iids)
			{
				return ((delegate *unmanaged [Stdcall]<IInspectable*,uint* ,global::System.Guid** ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IInspectable*)Unsafe.AsPointer(ref this), iidCount, iids);
			}

			/// <inheritdoc cref="GetRuntimeClassName(winmdroot.System.WinRT.HSTRING*)"/>
			[OverloadResolutionPriority(1)]
			internal unsafe winmdroot.Foundation.HRESULT GetRuntimeClassName(out winmdroot.System.WinRT.HSTRING className)
			{
				fixed (winmdroot.System.WinRT.HSTRING* classNameLocal = &className)
				{
					winmdroot.Foundation.HRESULT __result = this.GetRuntimeClassName(classNameLocal);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetRuntimeClassName(IInspectable* pThis, winmdroot.System.WinRT.HSTRING* className)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetRuntimeClassName(className);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Gets the fully qualified name of the current Windows Runtime object.</summary>
			/// <param name="className">
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinRT/hstring">HSTRING</a>*</b> The fully qualified name of the current Windows Runtime object.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/inspectable/nf-inspectable-iinspectable-getruntimeclassname#parameters">Read more on learn.microsoft.com</see>.</para>
			/// </param>
			/// <returns>
			/// <para>Type: <b>HRESULT</b> This function can return the following values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>Use the <b>GetRuntimeClassName</b> method to retrieve the namespace-qualified name of a Windows Runtime object. The caller is responsible for freeing the <i>className</i> string by using the <a href="https://docs.microsoft.com/windows/desktop/api/winstring/nf-winstring-windowsdeletestring">WindowsDeleteString</a> function. The following table shows example class name strings that could be returned by the <b>GetRuntimeClassName</b> method.</para>
			/// <para></para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/inspectable/nf-inspectable-iinspectable-getruntimeclassname#">Read more on learn.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetRuntimeClassName(winmdroot.System.WinRT.HSTRING* className)
			{
				return ((delegate *unmanaged [Stdcall]<IInspectable*,winmdroot.System.WinRT.HSTRING* ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IInspectable*)Unsafe.AsPointer(ref this), className);
			}

			/// <inheritdoc cref="GetTrustLevel(winmdroot.System.WinRT.TrustLevel*)"/>
			[OverloadResolutionPriority(1)]
			internal unsafe winmdroot.Foundation.HRESULT GetTrustLevel(out winmdroot.System.WinRT.TrustLevel trustLevel)
			{
				fixed (winmdroot.System.WinRT.TrustLevel* trustLevelLocal = &trustLevel)
				{
					winmdroot.Foundation.HRESULT __result = this.GetTrustLevel(trustLevelLocal);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetTrustLevel(IInspectable* pThis, winmdroot.System.WinRT.TrustLevel* trustLevel)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetTrustLevel(trustLevel);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Gets the trust level of the current Windows Runtime object.</summary>
			/// <param name="trustLevel">
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/inspectable/ne-inspectable-trustlevel">TrustLevel</a>*</b> The trust level of the current Windows Runtime object. The default is <b>BaseLevel</b>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/inspectable/nf-inspectable-iinspectable-gettrustlevel#parameters">Read more on learn.microsoft.com</see>.</para>
			/// </param>
			/// <returns>
			/// <para>Type: <b>HRESULT</b> This method always returns <b>S_OK</b>.</para>
			/// </returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/inspectable/nf-inspectable-iinspectable-gettrustlevel">Learn more about this API from learn.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetTrustLevel(winmdroot.System.WinRT.TrustLevel* trustLevel)
			{
				return ((delegate *unmanaged [Stdcall]<IInspectable*,winmdroot.System.WinRT.TrustLevel* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IInspectable*)Unsafe.AsPointer(ref this), trustLevel);
			}

			internal unsafe global::Windows.Win32.Foundation.HRESULT QueryInterface<T>(out T* ppv)
where T : unmanaged

			{
				Guid guid = typeof(T).GUID;
				void* pv;
				var hr = this.QueryInterface(&guid, &pv);
				if (hr.Succeeded)

				{
					ppv = (T*)pv;
				}
				else

				{
					ppv = null;
				}

				return hr;
			}

			internal struct Vtbl
			{
				internal delegate *unmanaged [Stdcall]<IInspectable*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

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

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

				internal delegate *unmanaged [Stdcall]<IInspectable*,uint* ,global::System.Guid** ,winmdroot.Foundation.HRESULT> GetIids_4;

				internal delegate *unmanaged [Stdcall]<IInspectable*,winmdroot.System.WinRT.HSTRING* ,winmdroot.Foundation.HRESULT> GetRuntimeClassName_5;

				internal delegate *unmanaged [Stdcall]<IInspectable*,winmdroot.System.WinRT.TrustLevel* ,winmdroot.Foundation.HRESULT> GetTrustLevel_6;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->GetIids_4 = &GetIids;
				vtable->GetRuntimeClassName_5 = &GetRuntimeClassName;
				vtable->GetTrustLevel_6 = &GetTrustLevel;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{af86e2e0-b12d-4c6a-9c5a-d7aa65101e90}</value>
			internal static readonly Guid IID_Guid = new Guid(0xAF86E2E0, 0xB12D, 0x4C6A, 0x9C, 0x5A, 0xD7, 0xAA, 0x65, 0x10, 0x1E, 0x90);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0xE0,0xE2,0x86,0xAF,0x2D,0xB1,0x6A,0x4C,0x9C,0x5A,0xD7,0xAA,0x65,0x10,0x1E,0x90					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("AF86E2E0-B12D-4C6A-9C5A-D7AA65101E90"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows8.0")]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetIids(uint* iidCount, global::System.Guid** iids);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetRuntimeClassName(winmdroot.System.WinRT.HSTRING* className);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetTrustLevel(winmdroot.System.WinRT.TrustLevel* trustLevel);
			}
		}
	}
}