File: Windows.Win32.IOleControl.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 System.Ole
	{
		[Guid("B196B288-BAB4-101A-B69C-00AA00341D07")]
		[SupportedOSPlatform("windows5.0")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IOleControl
			:IVTable<IOleControl,IOleControl.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]<IOleControl*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IOleControl*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

			/// <inheritdoc cref="GetControlInfo(winmdroot.System.Ole.CONTROLINFO*)"/>
			internal unsafe winmdroot.Foundation.HRESULT GetControlInfo(ref winmdroot.System.Ole.CONTROLINFO pCI)
			{
				fixed (winmdroot.System.Ole.CONTROLINFO* pCILocal = &pCI)
				{
					winmdroot.Foundation.HRESULT __result = this.GetControlInfo(pCILocal);
					return __result;
				}
			}

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

			/// <summary>Retrieves information about the control's keyboard mnemonics and behavior.</summary>
			/// <param name="pCI">A pointer to a <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/ns-ocidl-controlinfo">CONTROLINFO</a> structure that receives the information.</param>
			/// <returns>
			/// <para>This method can return the standard return value E_OUTOFMEMORY, as well as the following values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-iolecontrol-getcontrolinfo">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetControlInfo(winmdroot.System.Ole.CONTROLINFO* pCI)
			{
				return ((delegate *unmanaged [Stdcall]<IOleControl*,winmdroot.System.Ole.CONTROLINFO* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IOleControl*)Unsafe.AsPointer(ref this), pCI);
			}

			/// <inheritdoc cref="OnMnemonic(winmdroot.UI.WindowsAndMessaging.MSG*)"/>
			internal unsafe winmdroot.Foundation.HRESULT OnMnemonic(in winmdroot.UI.WindowsAndMessaging.MSG pMsg)
			{
				fixed (winmdroot.UI.WindowsAndMessaging.MSG* pMsgLocal = &pMsg)
				{
					winmdroot.Foundation.HRESULT __result = this.OnMnemonic(pMsgLocal);
					return __result;
				}
			}

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

			/// <summary>Informs a control that the user has pressed a keystroke that represents a keyboard mnemonic.</summary>
			/// <param name="pMsg">A pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/winuser/ns-winuser-msg">MSG</a> structure describing the keystroke to be processed.</param>
			/// <returns>
			/// <para>This method can return the standard return values E_INVALIDARG and E_UNEXPECTED, as well as the following values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>The keystroke must match one of the <b>ACCEL</b> entries in the mnemonic table returned through <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-iolecontrol-getcontrolinfo">IOleControl::GetControlInfo</a>. The control takes whatever action is appropriate for the keystroke.</para>
			/// <para><h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> A container of a control is allowed to cache the control's <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/ns-ocidl-controlinfo">CONTROLINFO</a> structure, provided that the container implements <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-iolecontrolsite-oncontrolinfochanged">IOleControlSite::OnControlInfoChanged</a> to know when it must update its cached information. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> If a control changes the contents of its <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/ns-ocidl-controlinfo">CONTROLINFO</a> structure, it must notify its container by calling <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-iolecontrolsite-oncontrolinfochanged">IOleControlSite::OnControlInfoChanged</a>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-iolecontrol-onmnemonic#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT OnMnemonic(winmdroot.UI.WindowsAndMessaging.MSG* pMsg)
			{
				return ((delegate *unmanaged [Stdcall]<IOleControl*,winmdroot.UI.WindowsAndMessaging.MSG* ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IOleControl*)Unsafe.AsPointer(ref this), pMsg);
			}

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

			/// <summary>Informs a control that one or more of the container's ambient properties has changed.</summary>
			/// <param name="dispID">The dispatch identifier of the ambient property that changed. If this parameter is DISPID_UNKNOWN, it indicates that multiple properties changed. In this case, the control should check all the ambient properties of interest to obtain their current values.</param>
			/// <returns>This method returns S_OK in all cases.</returns>
			/// <remarks>
			/// <para><h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> S_OK is returned in all cases even when the control does not support ambient properties or some other failure has occurred. The caller sending the notification cannot attempt to use an error code (such as E_NOTIMPL) to determine whether to send the notification in the future. Such semantics are not part of this interface.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-iolecontrol-onambientpropertychange#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT OnAmbientPropertyChange(int dispID)
			{
				return ((delegate *unmanaged [Stdcall]<IOleControl*,int ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IOleControl*)Unsafe.AsPointer(ref this), dispID);
			}

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

			/// <summary>Indicates whether the container is ignoring or accepting events from the control.</summary>
			/// <param name="bFreeze">Indicates whether the container will ignore (<b>TRUE</b>) or now process (<b>FALSE</b>) events from the control.</param>
			/// <returns>This method returns S_OK in all cases.</returns>
			/// <remarks>
			/// <para>The control is not required to stop sending events when <i>bFreeze</i> is <b>TRUE</b>. However, the container is not going to process them in this case. If a control depends on the container's processing -- as with request events that return information from the container -- the control must either discard the event or queue the event to send later when <i>bFreeze</i> is <b>FALSE</b>. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> As with <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-iolecontrol-onambientpropertychange">IOleControl::OnAmbientPropertyChange</a>, S_OK is returned in all cases in order to prevent a container from making assumptions about a control's behavior based on return values.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-iolecontrol-freezeevents#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT FreezeEvents(winmdroot.Foundation.BOOL bFreeze)
			{
				return ((delegate *unmanaged [Stdcall]<IOleControl*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IOleControl*)Unsafe.AsPointer(ref this), bFreeze);
			}

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

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

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

				internal delegate *unmanaged [Stdcall]<IOleControl*,winmdroot.System.Ole.CONTROLINFO* ,winmdroot.Foundation.HRESULT> GetControlInfo_4;

				internal delegate *unmanaged [Stdcall]<IOleControl*,winmdroot.UI.WindowsAndMessaging.MSG* ,winmdroot.Foundation.HRESULT> OnMnemonic_5;

				internal delegate *unmanaged [Stdcall]<IOleControl*,int ,winmdroot.Foundation.HRESULT> OnAmbientPropertyChange_6;

				internal delegate *unmanaged [Stdcall]<IOleControl*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> FreezeEvents_7;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->GetControlInfo_4 = &GetControlInfo;
				vtable->OnMnemonic_5 = &OnMnemonic;
				vtable->OnAmbientPropertyChange_6 = &OnAmbientPropertyChange;
				vtable->FreezeEvents_7 = &FreezeEvents;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{b196b288-bab4-101a-b69c-00aa00341d07}</value>
			internal static readonly Guid IID_Guid = new Guid(0xB196B288, 0xBAB4, 0x101A, 0xB6, 0x9C, 0x00, 0xAA, 0x00, 0x34, 0x1D, 0x07);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0x88,0xB2,0x96,0xB1,0xB4,0xBA,0x1A,0x10,0xB6,0x9C,0x00,0xAA,0x00,0x34,0x1D,0x07					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("B196B288-BAB4-101A-B69C-00AA00341D07"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.0")]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetControlInfo(winmdroot.System.Ole.CONTROLINFO* pCI);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT OnMnemonic(winmdroot.UI.WindowsAndMessaging.MSG* pMsg);

								[PreserveSig()]
winmdroot.Foundation.HRESULT OnAmbientPropertyChange(int dispID);

								[PreserveSig()]
winmdroot.Foundation.HRESULT FreezeEvents(winmdroot.Foundation.BOOL bFreeze);
			}
		}
	}
}