File: Windows.Win32.IInvokeProvider.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.Accessibility
	{
		[Guid("54FCB24B-E18E-47A2-B4D3-ECCBE77599A2")]
		[SupportedOSPlatform("windows5.1.2600")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IInvokeProvider
			:IVTable<IInvokeProvider,IInvokeProvider.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]<IInvokeProvider*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IInvokeProvider*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

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

			/// <summary>Sends a request to activate a control and initiate its single, unambiguous action. (IInvokeProvider.Invoke)</summary>
			/// <returns>
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">HRESULT</a></b> If this method succeeds, it returns <b>S_OK</b>. Otherwise, it returns an <b>HRESULT</b> error code.</para>
			/// </returns>
			/// <remarks>
			/// <para><b>IInvokeProvider::Invoke</b> is an asynchronous call and must return immediately without blocking.</para>
			/// <para><div class="alert"><b>Note</b>  This is particularly critical for controls that, directly or indirectly, launch a modal dialog when invoked. Any Microsoft UI Automation client that instigated the event will remain blocked until the modal dialog is closed. </div> <div> </div> <b>IInvokeProvider::Invoke</b> raises the Invoked event after the control has completed its associated action, if possible.</para>
			/// <para>The event should be raised before servicing the Invoke request in the following scenarios:</para>
			/// <para></para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-iinvokeprovider-invoke#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public void Invoke()
			{
				((delegate *unmanaged [Stdcall]<IInvokeProvider*,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IInvokeProvider*)Unsafe.AsPointer(ref this)).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]<IInvokeProvider*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

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

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

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

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{54fcb24b-e18e-47a2-b4d3-eccbe77599a2}</value>
			internal static readonly Guid IID_Guid = new Guid(0x54FCB24B, 0xE18E, 0x47A2, 0xB4, 0xD3, 0xEC, 0xCB, 0xE7, 0x75, 0x99, 0xA2);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0x4B,0xB2,0xFC,0x54,0x8E,0xE1,0xA2,0x47,0xB4,0xD3,0xEC,0xCB,0xE7,0x75,0x99,0xA2					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("54FCB24B-E18E-47A2-B4D3-ECCBE77599A2"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.1.2600")]
			internal interface Interface
			{
								[PreserveSig()]
winmdroot.Foundation.HRESULT Invoke();
			}
		}
	}
}