File: Windows.Win32.IModalWindow.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.Shell
	{
		[Guid("B4DB1657-70D7-485E-8E3E-6FCB5A5C1802")]
		[SupportedOSPlatform("windows5.1.2600")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IModalWindow
			:IVTable<IModalWindow,IModalWindow.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]<IModalWindow*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IModalWindow*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

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

			/// <summary>Launches the modal window.</summary>
			/// <param name="hwndOwner">
			/// <para>Type: <b>HWND</b> The handle of the owner window. This value can be <b>NULL</b>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-imodalwindow-show#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <returns>
			/// <para>Type: <b>HRESULT</b> If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code, including the following: </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-imodalwindow-show">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public void Show(winmdroot.Foundation.HWND hwndOwner)
			{
				((delegate *unmanaged [Stdcall]<IModalWindow*,winmdroot.Foundation.HWND ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IModalWindow*)Unsafe.AsPointer(ref this), hwndOwner).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]<IModalWindow*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

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

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

				internal delegate *unmanaged [Stdcall]<IModalWindow*,winmdroot.Foundation.HWND ,winmdroot.Foundation.HRESULT> Show_4;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->Show_4 = &Show;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{b4db1657-70d7-485e-8e3e-6fcb5a5c1802}</value>
			internal static readonly Guid IID_Guid = new Guid(0xB4DB1657, 0x70D7, 0x485E, 0x8E, 0x3E, 0x6F, 0xCB, 0x5A, 0x5C, 0x18, 0x02);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0x57,0x16,0xDB,0xB4,0xD7,0x70,0x5E,0x48,0x8E,0x3E,0x6F,0xCB,0x5A,0x5C,0x18,0x02					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("B4DB1657-70D7-485E-8E3E-6FCB5A5C1802"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.1.2600")]
			internal interface Interface
			{
								[PreserveSig()]
winmdroot.Foundation.HRESULT Show(winmdroot.Foundation.HWND hwndOwner);
			}
		}
	}
}