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

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

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

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

			/// <summary>Creates an enumerator object to iterate through all the connection points supported in the connectable object, one connection point per outgoing IID.</summary>
			/// <param name="ppEnum">A pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ienumconnectionpoints">IEnumConnectionPoints</a> interface pointer variable that receives the pointer to the newly created enumerator.</param>
			/// <returns>
			/// <para>This method can return the standard return values E_OUTOFMEMORY and E_UNEXPECTED, as well as the following values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>Because <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ienumconnectionpoints">IEnumConnectionPoints</a> enumerates pointers to <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-iconnectionpoint">IConnectionPoint</a>, the caller must use <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-iconnectionpoint-getconnectioninterface">IConnectionPoint::GetConnectionInterface</a> to determine the interface identifier of the outgoing interface that the connection point supports. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> The caller is responsible for calling <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">Release</a> when the enumerator is no longer needed. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> Returning E_NOTIMPL is specifically disallowed because, with the exception of type information, there would be no other means through which a caller could find the IIDs of the outgoing interfaces. Since a connectable object typically has a fixed set of known outgoing interfaces, it is straightforward to implement the enumerator on top of a fixed length array of IIDs known at compile time.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-iconnectionpointcontainer-enumconnectionpoints#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT EnumConnectionPoints(winmdroot.System.Com.IEnumConnectionPoints** ppEnum)
			{
				return ((delegate *unmanaged [Stdcall]<IConnectionPointContainer*,winmdroot.System.Com.IEnumConnectionPoints** ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IConnectionPointContainer*)Unsafe.AsPointer(ref this), ppEnum);
			}

			/// <inheritdoc cref="FindConnectionPoint(global::System.Guid*, winmdroot.System.Com.IConnectionPoint**)"/>
			internal unsafe winmdroot.Foundation.HRESULT FindConnectionPoint(in global::System.Guid riid, winmdroot.System.Com.IConnectionPoint** ppCP)
			{
				fixed (global::System.Guid* riidLocal = &riid)
				{
					winmdroot.Foundation.HRESULT __result = this.FindConnectionPoint(riidLocal, ppCP);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT FindConnectionPoint(IConnectionPointContainer* pThis, global::System.Guid* riid, winmdroot.System.Com.IConnectionPoint** ppCP)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.FindConnectionPoint(riid, ppCP);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Returns a pointer to the IConnectionPoint interface of a connection point for a specified IID, if that IID describes a supported outgoing interface.</summary>
			/// <param name="riid">Interface identifier of the outgoing interface whose connection point object is being requested.</param>
			/// <param name="ppCP">The address of an <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-iconnectionpoint">IConnectionPoint</a> interface pointer variable that receives the pointer to the connection point that supports the <i>riid</i> interface. If an error occurs, the implementation sets the value to <b>NULL</b>.</param>
			/// <returns>
			/// <para>This method can return the standard return values E_OUTOFMEMORY and E_UNEXPECTED, as well as the following values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>This method is the <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-queryinterface(q)">QueryInterface</a> equivalent for an object's outgoing interfaces, where the outgoing interface is specified with <i>riid</i> and where the interface pointer returned is always that of a connection point. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> If the call is successful, the caller is responsible for releasing the connection point by calling <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">Release</a> when the connection point is no longer needed. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> E_NOTIMPL is not allowed as a return value for this method. Any implementation of <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-iconnectionpointcontainer">IConnectionPointContainer</a> must implement this method for the connectable object's outgoing interfaces.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-iconnectionpointcontainer-findconnectionpoint#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT FindConnectionPoint(global::System.Guid* riid, winmdroot.System.Com.IConnectionPoint** ppCP)
			{
				return ((delegate *unmanaged [Stdcall]<IConnectionPointContainer*,global::System.Guid* ,winmdroot.System.Com.IConnectionPoint** ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IConnectionPointContainer*)Unsafe.AsPointer(ref this), riid, ppCP);
			}

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

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

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

				internal delegate *unmanaged [Stdcall]<IConnectionPointContainer*,winmdroot.System.Com.IEnumConnectionPoints** ,winmdroot.Foundation.HRESULT> EnumConnectionPoints_4;

				internal delegate *unmanaged [Stdcall]<IConnectionPointContainer*,global::System.Guid* ,winmdroot.System.Com.IConnectionPoint** ,winmdroot.Foundation.HRESULT> FindConnectionPoint_5;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->EnumConnectionPoints_4 = &EnumConnectionPoints;
				vtable->FindConnectionPoint_5 = &FindConnectionPoint;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{b196b284-bab4-101a-b69c-00aa00341d07}</value>
			internal static readonly Guid IID_Guid = new Guid(0xB196B284, 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[]					{
0x84,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("B196B284-BAB4-101A-B69C-00AA00341D07"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.0")]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT EnumConnectionPoints(winmdroot.System.Com.IEnumConnectionPoints** ppEnum);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT FindConnectionPoint(global::System.Guid* riid, winmdroot.System.Com.IConnectionPoint** ppCP);
			}
		}
	}
}