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

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

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

			/// <inheritdoc cref="GetWindow(winmdroot.Foundation.HWND*)"/>
			internal unsafe winmdroot.Foundation.HRESULT GetWindow(out winmdroot.Foundation.HWND phwnd)
			{
				fixed (winmdroot.Foundation.HWND* phwndLocal = &phwnd)
				{
					winmdroot.Foundation.HRESULT __result = this.GetWindow(phwndLocal);
					return __result;
				}
			}

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

			/// <summary>Retrieves a handle to one of the windows participating in in-place activation (frame, document, parent, or in-place object window).</summary>
			/// <param name="phwnd">A pointer to a variable that receives the window handle.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>Five types of windows comprise the windows hierarchy. When a object is active in place, it has access to some or all of these windows. </para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-iolewindow-getwindow#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetWindow(winmdroot.Foundation.HWND* phwnd)
			{
				return ((delegate *unmanaged [Stdcall]<IOleWindow*,winmdroot.Foundation.HWND* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IOleWindow*)Unsafe.AsPointer(ref this), phwnd);
			}

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

			/// <summary>Determines whether context-sensitive help mode should be entered during an in-place activation session.</summary>
			/// <param name="fEnterMode"><b>TRUE</b> if help mode should be entered; <b>FALSE</b> if it should be exited.</param>
			/// <returns>
			/// <para>This method returns S_OK if the help mode was entered or exited successfully, depending on the value passed in <i>fEnterMode</i>. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>Applications can invoke context-sensitive help when the user: </para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-iolewindow-contextsensitivehelp#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT ContextSensitiveHelp(winmdroot.Foundation.BOOL fEnterMode)
			{
				return ((delegate *unmanaged [Stdcall]<IOleWindow*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IOleWindow*)Unsafe.AsPointer(ref this), fEnterMode);
			}

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

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

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

				internal delegate *unmanaged [Stdcall]<IOleWindow*,winmdroot.Foundation.HWND* ,winmdroot.Foundation.HRESULT> GetWindow_4;

				internal delegate *unmanaged [Stdcall]<IOleWindow*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> ContextSensitiveHelp_5;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->GetWindow_4 = &GetWindow;
				vtable->ContextSensitiveHelp_5 = &ContextSensitiveHelp;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{00000114-0000-0000-c000-000000000046}</value>
			internal static readonly Guid IID_Guid = new Guid(0x00000114, 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[]					{
0x14,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("00000114-0000-0000-C000-000000000046"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.0")]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetWindow(winmdroot.Foundation.HWND* phwnd);

								[PreserveSig()]
winmdroot.Foundation.HRESULT ContextSensitiveHelp(winmdroot.Foundation.BOOL fEnterMode);
			}
		}
	}
}