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

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

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

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

			/// <summary>Registers an object with the bind context to ensure that the object remains active until the bind context is released.</summary>
			/// <param name="punk">A pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nn-unknwn-iunknown">IUnknown</a> interface on the object that is being registered as bound.</param>
			/// <returns>This method can return the standard return values E_OUTOFMEMORY and S_OK.</returns>
			/// <remarks>
			/// <para>Those writing a new moniker class (through an implementation of the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imoniker">IMoniker</a> interface) should call this method whenever the implementation activates an object. This happens most often in the course of binding a moniker, but it can also happen while retrieving a moniker's display name, parsing a display name into a moniker, or retrieving the time that an object was last modified. <b>RegisterObjectBound</b> calls <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-addref">AddRef</a> to create an additional reference to the object. You must, however, still release your own copy of the pointer. Calling this method twice for the same object creates two references to that object. You can release a reference obtained through a call to this method by calling <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-ibindctx-revokeobjectbound">IBindCtx::RevokeObjectBound</a>. All references held by the bind context are released when the bind context itself is released. Calling <b>RegisterObjectBound</b> to register an object with a bind context keeps the object active until the bind context is released. Reusing a bind context in a subsequent binding operation (either for another piece of the same composite moniker or for a different moniker) can make the subsequent binding operation more efficient because it doesn't have to reload that object. This, however, improves performance only if the subsequent binding operation requires some of the same objects as the original one, so you need to balance the possible performance improvement of reusing a bind context against the costs of keeping objects activated unnecessarily.</para>
			/// <para><a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-ibindctx">IBindCtx</a> does not provide a method to retrieve a pointer to an object registered using <b>RegisterObjectBound</b>. Assuming the object has registered itself with the running object table, moniker implementations can call <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-irunningobjecttable-getobject">IRunningObjectTable::GetObject</a> to retrieve a pointer to the object.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-ibindctx-registerobjectbound#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT RegisterObjectBound(winmdroot.System.Com.IUnknown* punk)
			{
				return ((delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.System.Com.IUnknown* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IBindCtx*)Unsafe.AsPointer(ref this), punk);
			}

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

			/// <summary>Removes the object from the bind context, undoing a previous call to RegisterObjectBound.</summary>
			/// <param name="punk">A pointer to the <a href="https://docs.microsoft.com/windows/desktop/com/iunknown-and-interface-inheritance">IUnknown</a> interface on the object to be removed.</param>
			/// <returns>
			/// <para>This method can return the following values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>You would rarely call this method. It is documented primarily for completeness.</remarks>
			public unsafe winmdroot.Foundation.HRESULT RevokeObjectBound(winmdroot.System.Com.IUnknown* punk)
			{
				return ((delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.System.Com.IUnknown* ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IBindCtx*)Unsafe.AsPointer(ref this), punk);
			}

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

			/// <summary>Releases all pointers to all objects that were previously registered by calls to RegisterObjectBound.</summary>
			/// <returns>If this method succeeds, it returns <b>S_OK</b>. Otherwise, it returns an <b>HRESULT</b> error code.</returns>
			/// <remarks>
			/// <para>You rarely call this method directly. The system's <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-ibindctx">IBindCtx</a> implementation calls this method when the pointer to the <b>IBindCtx</b> interface on the bind context is released (the bind context is released). If a bind context is not released, all of the registered objects remain active. If the same object has been registered more than once, this method calls the <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">Release</a> method on the object the number of times it was registered.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-ibindctx-releaseboundobjects#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT ReleaseBoundObjects()
			{
				return ((delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IBindCtx*)Unsafe.AsPointer(ref this));
			}

			/// <inheritdoc cref="SetBindOptions(winmdroot.System.Com.BIND_OPTS*)"/>
			internal unsafe winmdroot.Foundation.HRESULT SetBindOptions(in winmdroot.System.Com.BIND_OPTS pbindopts)
			{
				fixed (winmdroot.System.Com.BIND_OPTS* pbindoptsLocal = &pbindopts)
				{
					winmdroot.Foundation.HRESULT __result = this.SetBindOptions(pbindoptsLocal);
					return __result;
				}
			}

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

			/// <summary>Sets new values for the binding parameters stored in the bind context.</summary>
			/// <param name="pbindopts">A pointer to a [BIND_OPTS3](/windows/win32/api/objidl/ns-objidl-bind_opts3-r1) structure containing the binding parameters.</param>
			/// <returns>This method can return the standard return values E_OUTOFMEMORY and S_OK.</returns>
			/// <remarks>
			/// <para>A bind context contains a block of parameters that are common to most <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imoniker">IMoniker</a> operations. These parameters do not change as the operation moves from piece to piece of a composite moniker. Subsequent binding operations can call <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-ibindctx-getbindoptions">IBindCtx::GetBindOptions</a> to retrieve these parameters. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> This method can be called by moniker clients (those who use monikers to acquire interface pointers to objects). When you first create a bind context by using the <a href="https://docs.microsoft.com/windows/desktop/api/objbase/nf-objbase-createbindctx">CreateBindCtx</a> function, the fields of the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/ns-objidl-bind_opts">BIND_OPTS</a> structure are initialized to the following values:</para>
			/// <para></para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-ibindctx-setbindoptions#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT SetBindOptions(winmdroot.System.Com.BIND_OPTS* pbindopts)
			{
				return ((delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.System.Com.BIND_OPTS* ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IBindCtx*)Unsafe.AsPointer(ref this), pbindopts);
			}

			/// <inheritdoc cref="GetBindOptions(winmdroot.System.Com.BIND_OPTS*)"/>
			internal unsafe winmdroot.Foundation.HRESULT GetBindOptions(ref winmdroot.System.Com.BIND_OPTS pbindopts)
			{
				fixed (winmdroot.System.Com.BIND_OPTS* pbindoptsLocal = &pbindopts)
				{
					winmdroot.Foundation.HRESULT __result = this.GetBindOptions(pbindoptsLocal);
					return __result;
				}
			}

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

			/// <summary>Retrieves the binding options stored in this bind context.</summary>
			/// <param name="pbindopts">A pointer to an initialized structure that receives the current binding parameters on return. See [BIND_OPTS3](/windows/win32/api/objidl/ns-objidl-bind_opts3-r1).</param>
			/// <returns>This method can return the standard return values E_UNEXPECTED and S_OK.</returns>
			/// <remarks>
			/// <para>A bind context contains a block of parameters that are common to most <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imoniker">IMoniker</a> operations and that do not change as the operation moves from piece to piece of a composite moniker. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> You typically call this method if you are writing your own moniker class. (This requires that you implement the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imoniker">IMoniker</a> interface.) You call this method to retrieve the parameters specified by the moniker client. You must initialize the structure that is filled in by this method. Before calling this method, you must initialize the <b>cbStruct</b> member to the size of the structure.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-ibindctx-getbindoptions#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetBindOptions(winmdroot.System.Com.BIND_OPTS* pbindopts)
			{
				return ((delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.System.Com.BIND_OPTS* ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IBindCtx*)Unsafe.AsPointer(ref this), pbindopts);
			}

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

			/// <summary>Retrieves an interface pointer to the running object table (ROT) for the computer on which this bind context is running.</summary>
			/// <param name="pprot">The address of a <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-irunningobjecttable">IRunningObjectTable</a>* pointer variable that receives the interface pointer to the running object table. If an error occurs, *<i>pprot</i> is set to <b>NULL</b>. If *<i>pprot</i> is non-<b>NULL</b>, the implementation calls <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-addref">AddRef</a> on the running table object; it is the caller's responsibility to call <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">Release</a>.</param>
			/// <returns>This method can return the standard return values E_OUTOFMEMORY, E_UNEXPECTED, and S_OK.</returns>
			/// <remarks>
			/// <para>The running object table is a globally accessible table on each computer. It keeps track of all the objects that are currently running on the computer. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> Typically, those implementing a new moniker class (through an implementation of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imoniker">IMoniker</a> interface) call <b>GetRunningObjectTable</b>. It is useful to call this method in an implementation of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-imoniker-bindtoobject">IMoniker::BindToObject</a> or <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-imoniker-isrunning">IMoniker::IsRunning</a> to check whether an object is currently running. You can also call this method in the implementation of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-imoniker-gettimeoflastchange">IMoniker::GetTimeOfLastChange</a> to learn when a running object was last modified. Moniker implementations should call this method instead of using the <b>GetRunningObjectTable</b> function. This makes it possible for future implementations of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-ibindctx">IBindCtx</a> to modify binding behavior.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-ibindctx-getrunningobjecttable#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetRunningObjectTable(winmdroot.System.Com.IRunningObjectTable** pprot)
			{
				return ((delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.System.Com.IRunningObjectTable** ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IBindCtx*)Unsafe.AsPointer(ref this), pprot);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT RegisterObjectParam(IBindCtx* pThis, winmdroot.Foundation.PWSTR pszKey, winmdroot.System.Com.IUnknown* punk)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.RegisterObjectParam(pszKey, punk);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Associates an object with a string key in the bind context's string-keyed table of pointers.</summary>
			/// <param name="pszKey">The <a href="https://docs.microsoft.com/windows/desktop/shell/str-constants">bind context string key</a> under which the object is being registered. Key string comparison is case-sensitive.</param>
			/// <param name="punk">
			/// <para>A pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nn-unknwn-iunknown">IUnknown</a> interface on the object that is to be registered. The method calls <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-addref">AddRef</a> on the pointer.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-ibindctx-registerobjectparam#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <returns>This method can return the standard return values E_OUTOFMEMORY and S_OK.</returns>
			/// <remarks>
			/// <para>A bind context maintains a table of interface pointers, each associated with a string key. This enables communication between a moniker implementation and the caller that initiated the binding operation. One party can store an interface pointer under a string known to both parties so that the other party can later retrieve it from the bind context. Binding operations subsequent to the use of this method can use <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-ibindctx-getobjectparam">IBindCtx::GetObjectParam</a> to retrieve the stored pointer. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> <b>RegisterObjectParam</b> is useful to those implementing a new moniker class (through an implementation of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imoniker">IMoniker</a>) and to moniker clients (those who use monikers to bind to objects). In implementing a new moniker class, you call this method when an error occurs during moniker binding to inform the caller of the cause of the error. The key that you would obtain with a call to this method would depend on the error condition. Following is a list of common moniker binding errors, describing for each the keys that would be appropriate: </para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-ibindctx-registerobjectparam#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT RegisterObjectParam(winmdroot.Foundation.PWSTR pszKey, winmdroot.System.Com.IUnknown* punk)
			{
				return ((delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.Foundation.PWSTR ,winmdroot.System.Com.IUnknown* ,winmdroot.Foundation.HRESULT>)lpVtbl[9])((IBindCtx*)Unsafe.AsPointer(ref this), pszKey, punk);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetObjectParam(IBindCtx* pThis, winmdroot.Foundation.PWSTR pszKey, winmdroot.System.Com.IUnknown** ppunk)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetObjectParam(pszKey, ppunk);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves an interface pointer to the object associated with the specified key in the bind context's string-keyed table of pointers.</summary>
			/// <param name="pszKey">The <a href="https://docs.microsoft.com/windows/desktop/shell/str-constants">bind context string key</a> to be searched for. Key string comparison is case-sensitive.</param>
			/// <param name="ppunk">The address of an <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nn-unknwn-iunknown">IUnknown</a>* pointer variable that receives the interface pointer to the object associated with <i>pszKey</i>. When successful, the implementation calls <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-addref">AddRef</a> on *<i>ppunk</i>. It is the caller's responsibility to call <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">Release</a>. If an error occurs, the implementation sets *<i>ppunk</i> to <b>NULL</b>.</param>
			/// <returns>If the method succeeds, the return value is S_OK. Otherwise, it is E_FAIL.</returns>
			/// <remarks>
			/// <para>A bind context maintains a table of interface pointers, each associated with a string key. This enables communication between a moniker implementation and the caller that initiated the binding operation. One party can store an interface pointer under a string known to both parties so that the other party can later retrieve it from the bind context. The pointer this method retrieves must have previously been inserted into the table using the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-ibindctx-registerobjectparam">IBindCtx::RegisterObjectParam</a> method. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> Objects using monikers to locate other objects can call this method when a binding operation fails to get specific information about the error that occurred. Depending on the error, it may be possible to correct the situation and retry the binding operation. See <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-ibindctx-registerobjectparam">IBindCtx::RegisterObjectParam</a> for more information. Moniker implementations can call this method to handle situations where a caller initiates a binding operation and requests specific information. By convention, the implementer should use key names that begin with the string form of the CLSID of a moniker class. (See the <a href="https://docs.microsoft.com/windows/desktop/api/combaseapi/nf-combaseapi-stringfromclsid">StringFromCLSID</a> function.)</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-ibindctx-getobjectparam#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetObjectParam(winmdroot.Foundation.PWSTR pszKey, winmdroot.System.Com.IUnknown** ppunk)
			{
				return ((delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.Foundation.PWSTR ,winmdroot.System.Com.IUnknown** ,winmdroot.Foundation.HRESULT>)lpVtbl[10])((IBindCtx*)Unsafe.AsPointer(ref this), pszKey, ppunk);
			}

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

			/// <summary>Retrieves a pointer to an interface that can be used to enumerate the keys of the bind context's string-keyed table of pointers.</summary>
			/// <param name="ppenum">The address of an <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-ienumstring">IEnumString</a>* pointer variable that receives the interface pointer to the enumerator. If an error occurs, *<i>ppenum</i> is set to <b>NULL</b>. If *<i>ppenum</i> is non-<b>NULL</b>, the implementation calls <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-addref">AddRef</a> on *<i>ppenum</i>; it is the caller's responsibility to call <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">Release</a>.</param>
			/// <returns>This method can return the standard return values E_OUTOFMEMORY and S_OK.</returns>
			/// <remarks>
			/// <para>The keys returned by the enumerator are the ones previously specified in calls to <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-ibindctx-registerobjectparam">IBindCtx::RegisterObjectParam</a>. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> A bind context maintains a table of interface pointers, each associated with a string key. This enables communication between a moniker implementation and the caller that initiated the binding operation. One party can store an interface pointer under a string known to both parties so that the other party can later retrieve it from the bind context. In the system implementation of the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-ibindctx">IBindCtx</a> interface, this method is not implemented. Therefore, calling this method results in a return value of E_NOTIMPL.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-ibindctx-enumobjectparam#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT EnumObjectParam(winmdroot.System.Com.IEnumString** ppenum)
			{
				return ((delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.System.Com.IEnumString** ,winmdroot.Foundation.HRESULT>)lpVtbl[11])((IBindCtx*)Unsafe.AsPointer(ref this), ppenum);
			}

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

			/// <summary>Removes the specified key and its associated pointer from the bind context's string-keyed table of objects. The key must have previously been inserted into the table with a call to RegisterObjectParam.</summary>
			/// <param name="pszKey">The <a href="https://docs.microsoft.com/windows/desktop/shell/str-constants">bind context string key</a> to be removed. Key string comparison is case-sensitive.</param>
			/// <returns>
			/// <para>This method can return the following values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>A bind context maintains a table of interface pointers, each associated with a string key. This enables communication between a moniker implementation and the caller that initiated the binding operation. One party can store an interface pointer under a string known to both parties so that the other party can later retrieve it from the bind context. This method is used to remove an entry from the table. If the specified key is found, the bind context also releases its reference to the object.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-ibindctx-revokeobjectparam#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT RevokeObjectParam(winmdroot.Foundation.PWSTR pszKey)
			{
				return ((delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.Foundation.PWSTR ,winmdroot.Foundation.HRESULT>)lpVtbl[12])((IBindCtx*)Unsafe.AsPointer(ref this), pszKey);
			}

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

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

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

				internal delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.System.Com.IUnknown* ,winmdroot.Foundation.HRESULT> RegisterObjectBound_4;

				internal delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.System.Com.IUnknown* ,winmdroot.Foundation.HRESULT> RevokeObjectBound_5;

				internal delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.Foundation.HRESULT> ReleaseBoundObjects_6;

				internal delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.System.Com.BIND_OPTS* ,winmdroot.Foundation.HRESULT> SetBindOptions_7;

				internal delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.System.Com.BIND_OPTS* ,winmdroot.Foundation.HRESULT> GetBindOptions_8;

				internal delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.System.Com.IRunningObjectTable** ,winmdroot.Foundation.HRESULT> GetRunningObjectTable_9;

				internal delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.Foundation.PWSTR ,winmdroot.System.Com.IUnknown* ,winmdroot.Foundation.HRESULT> RegisterObjectParam_10;

				internal delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.Foundation.PWSTR ,winmdroot.System.Com.IUnknown** ,winmdroot.Foundation.HRESULT> GetObjectParam_11;

				internal delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.System.Com.IEnumString** ,winmdroot.Foundation.HRESULT> EnumObjectParam_12;

				internal delegate *unmanaged [Stdcall]<IBindCtx*,winmdroot.Foundation.PWSTR ,winmdroot.Foundation.HRESULT> RevokeObjectParam_13;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->RegisterObjectBound_4 = &RegisterObjectBound;
				vtable->RevokeObjectBound_5 = &RevokeObjectBound;
				vtable->ReleaseBoundObjects_6 = &ReleaseBoundObjects;
				vtable->SetBindOptions_7 = &SetBindOptions;
				vtable->GetBindOptions_8 = &GetBindOptions;
				vtable->GetRunningObjectTable_9 = &GetRunningObjectTable;
				vtable->RegisterObjectParam_10 = &RegisterObjectParam;
				vtable->GetObjectParam_11 = &GetObjectParam;
				vtable->EnumObjectParam_12 = &EnumObjectParam;
				vtable->RevokeObjectParam_13 = &RevokeObjectParam;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{0000000e-0000-0000-c000-000000000046}</value>
			internal static readonly Guid IID_Guid = new Guid(0x0000000E, 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[]					{
0x0E,0x00,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("0000000E-0000-0000-C000-000000000046"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.0")]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT RegisterObjectBound(winmdroot.System.Com.IUnknown* punk);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT RevokeObjectBound(winmdroot.System.Com.IUnknown* punk);

								[PreserveSig()]
winmdroot.Foundation.HRESULT ReleaseBoundObjects();

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT SetBindOptions(winmdroot.System.Com.BIND_OPTS* pbindopts);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetBindOptions(winmdroot.System.Com.BIND_OPTS* pbindopts);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetRunningObjectTable(winmdroot.System.Com.IRunningObjectTable** pprot);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT RegisterObjectParam(winmdroot.Foundation.PWSTR pszKey, winmdroot.System.Com.IUnknown* punk);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetObjectParam(winmdroot.Foundation.PWSTR pszKey, winmdroot.System.Com.IUnknown** ppunk);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT EnumObjectParam(winmdroot.System.Com.IEnumString** ppenum);

								[PreserveSig()]
winmdroot.Foundation.HRESULT RevokeObjectParam(winmdroot.Foundation.PWSTR pszKey);
			}
		}
	}
}