|
// ------------------------------------------------------------------------------
// <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("00000010-0000-0000-C000-000000000046")]
[SupportedOSPlatform("windows5.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal unsafe partial struct IRunningObjectTable
:IVTable<IRunningObjectTable,IRunningObjectTable.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]<IRunningObjectTable*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IRunningObjectTable*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
public uint AddRef()
{
return ((delegate *unmanaged [Stdcall]<IRunningObjectTable*,uint>)lpVtbl[1])((IRunningObjectTable*)Unsafe.AsPointer(ref this));
}
public uint Release()
{
return ((delegate *unmanaged [Stdcall]<IRunningObjectTable*,uint>)lpVtbl[2])((IRunningObjectTable*)Unsafe.AsPointer(ref this));
}
/// <inheritdoc cref="Register(winmdroot.System.Com.ROT_FLAGS, winmdroot.System.Com.IUnknown*, winmdroot.System.Com.IMoniker*, uint*)"/>
internal unsafe winmdroot.Foundation.HRESULT Register(winmdroot.System.Com.ROT_FLAGS grfFlags, winmdroot.System.Com.IUnknown* punkObject, winmdroot.System.Com.IMoniker* pmkObjectName, out uint pdwRegister)
{
fixed (uint* pdwRegisterLocal = &pdwRegister)
{
winmdroot.Foundation.HRESULT __result = this.Register(grfFlags, punkObject, pmkObjectName, pdwRegisterLocal);
return __result;
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Register(IRunningObjectTable* pThis, winmdroot.System.Com.ROT_FLAGS grfFlags, winmdroot.System.Com.IUnknown* punkObject, winmdroot.System.Com.IMoniker* pmkObjectName, uint* pdwRegister)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Register(grfFlags, punkObject, pmkObjectName, pdwRegister);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Registers an object and its identifying moniker in the running object table (ROT).</summary>
/// <param name="grfFlags">
/// <para>Specifies whether the ROT's reference to punkObject is weak or strong and controls access to the object through its entry in the ROT. For details, see the Remarks section. </para>
/// <para>This doc was truncated.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-irunningobjecttable-register#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="punkObject">A pointer to the object that is being registered as running.</param>
/// <param name="pmkObjectName">A pointer to the moniker that identifies <i>punkObject</i>.</param>
/// <param name="pdwRegister">An identifier for this ROT entry that can be used in subsequent calls to <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-irunningobjecttable-revoke">IRunningObjectTable::Revoke</a> or <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-irunningobjecttable-notechangetime">IRunningObjectTable::NoteChangeTime</a>. The caller cannot specify <b>NULL</b> for this parameter. If an error occurs, *<i>pdwRegister</i> is set to zero.</param>
/// <returns>
/// <para>This method can return the standard return values E_INVALIDARG and E_OUTOFMEMORY, as well as the following values. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>This method registers a pointer to an object under a moniker that identifies the object. The moniker is used as the key when the table is searched with <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-irunningobjecttable-getobject">IRunningObjectTable::GetObject</a>. When an object is registered, the ROT always calls <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-addref">AddRef</a> on the object. For a weak registration (ROTFLAGS_REGISTRATIONKEEPSALIVE not set), the ROT will release the object whenever the last strong reference to the object is released. For a strong registration (ROTFLAGS_REGISTRATIONKEEPSALIVE set), the ROT prevents the object from being destroyed until the object's registration is explicitly revoked. A server registered as either LocalService or RunAs can set the ROTFLAGS_ALLOWANYCLIENT flag in its call to <b>Register</b> to allow any client to connect to it. A server setting this bit must have its executable name in the AppID section of the registry that refers to the AppID for the executable. An "activate as activator" server (not registered as LocalService or RunAs) must not set this flag in its call to <b>Register</b>. For details on installing services, see <a href="https://docs.microsoft.com/windows/desktop/com/installing-as-a-service-application">Installing as a Service Application</a>. Registering a second object with the same moniker, or re-registering the same object with the same moniker, creates a second entry in the ROT. In this case, <b>Register</b> returns MK_S_MONIKERALREADYREGISTERED. Each call to <b>Register</b> must be matched by a call to <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-irunningobjecttable-revoke">IRunningObjectTable::Revoke</a> because even duplicate entries have different <i>pdwRegister</i> identifiers. A problem with duplicate registrations is that there is no way to determine which object will be returned if the moniker is specified in a subsequent call to <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-irunningobjecttable-isrunning">IRunningObjectTable::IsRunning</a>. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> If you are a moniker provider (that is, you hand out monikers identifying your objects to make them accessible to others), you must call the <b>Register</b> method to register your objects when they begin running. You must also call this method if you rename your objects while they are loaded.</para>
/// <para>The most common type of moniker provider is a compound-document link source. This includes server applications that support linking to their documents (or portions of a document) and container applications that support linking to embeddings within their documents. Server applications that do not support linking can also use the ROT to cooperate with container applications that support linking to embeddings.</para>
/// <para>If you are writing a server application, you should register an object with the ROT when it begins running, typically in your implementation of <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-doverb">IOleObject::DoVerb</a>. The object must be registered under its full moniker, which requires getting the moniker of its container document using <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleclientsite-getmoniker">IOleClientSite::GetMoniker</a>. You should also revoke and re-register the object in your implementation of <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-setmoniker">IOleObject::SetMoniker</a>, which is called if the container document is renamed. If you are writing a container application that supports linking to embeddings, you should register your document with the ROT when it is loaded. If your document is renamed, you should revoke and re-register it with the ROT and call <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-setmoniker">IOleObject::SetMoniker</a> for any embedded objects in the document to give them an opportunity to re-register themselves. Objects registered in the ROT must be explicitly revoked when the object is no longer running or when its moniker changes. This revocation is important because there is no way for the system to automatically remove entries from the ROT. You must cache the identifier that is written through pdwRegister and use it in a call to <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-irunningobjecttable-revoke">IRunningObjectTable::Revoke</a> to revoke the registration. For a strong registration, a strong reference is released when the objects registration is revoked. As of Windows Server 2003, if there are stale entries that remain in the ROT due to unexpected server problems, COM will automatically remove these stale entries from the ROT. The system's implementation of <b>Register</b> calls <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-imoniker-reduce">IMoniker::Reduce</a> on the <i>pmkObjectName</i> parameter to ensure that the moniker is fully reduced before registration. If an object is known by more than one fully reduced moniker, it should be registered under all such monikers.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-irunningobjecttable-register#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT Register(winmdroot.System.Com.ROT_FLAGS grfFlags, winmdroot.System.Com.IUnknown* punkObject, winmdroot.System.Com.IMoniker* pmkObjectName, uint* pdwRegister)
{
return ((delegate *unmanaged [Stdcall]<IRunningObjectTable*,winmdroot.System.Com.ROT_FLAGS ,winmdroot.System.Com.IUnknown* ,winmdroot.System.Com.IMoniker* ,uint* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IRunningObjectTable*)Unsafe.AsPointer(ref this), grfFlags, punkObject, pmkObjectName, pdwRegister);
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Revoke(IRunningObjectTable* pThis, uint dwRegister)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Revoke(dwRegister);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Removes an entry from the running object table (ROT) that was previously registered by a call to IRunningObjectTable::Register.</summary>
/// <param name="dwRegister">The identifier of the ROT entry to be revoked.</param>
/// <returns>This method can return the standard return values E_INVALIDARG and S_OK.</returns>
/// <remarks>
/// <para>This method undoes the effect of a call to <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-irunningobjecttable-register">IRunningObjectTable::Register</a>, removing both the moniker and the pointer to the object identified by that moniker. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> A moniker provider (hands out monikers identifying its objects to make them accessible to others) must call the <b>Revoke</b> method to revoke the registration of its objects when it stops running. It must have previously called <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-irunningobjecttable-register">IRunningObjectTable::Register</a> and stored the identifier returned by that method; it uses that identifier when calling <b>Revoke</b>. The most common type of moniker provider is a compound-document link source. This includes server applications that support linking to their documents (or portions of a document) and container applications that support linking to embeddings within their documents. Server applications that do not support linking can also use the ROT to cooperate with container applications that support linking to embeddings. If you are writing a container application, you must revoke a document's registration when the document is closed. You must also revoke a document's registration before re-registering it when it is renamed.</para>
/// <para>If you are writing a server application, you must revoke an object's registration when the object is closed. You must also revoke an object's registration before re-registering it when its container document is renamed (see <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-setmoniker">IOleObject::SetMoniker</a>).</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-irunningobjecttable-revoke#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public winmdroot.Foundation.HRESULT Revoke(uint dwRegister)
{
return ((delegate *unmanaged [Stdcall]<IRunningObjectTable*,uint ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IRunningObjectTable*)Unsafe.AsPointer(ref this), dwRegister);
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT IsRunning(IRunningObjectTable* pThis, winmdroot.System.Com.IMoniker* pmkObjectName)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.IsRunning(pmkObjectName);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Determines whether the object identified by the specified moniker is currently running.</summary>
/// <param name="pmkObjectName">A pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imoniker">IMoniker</a> interface on the moniker.</param>
/// <returns>If the object is in the running state, the return value is <b>TRUE</b>. Otherwise, it is <b>FALSE</b>.</returns>
/// <remarks>
/// <para>This method simply indicates whether a object is running. To retrieve a pointer to a running object, use the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-irunningobjecttable-getobject">IRunningObjectTable::GetObject</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> Generally, you call the <b>IsRunning</b> method only if you are writing your own moniker class (that is, implementing the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imoniker">IMoniker</a> interface). You typically call this method from your implementation of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-imoniker-isrunning">IMoniker::IsRunning</a>. However, you should do so only if the <i>pmkToLeft</i> parameter of <b>IMoniker::IsRunning</b> is <b>NULL</b>. Otherwise, you should call <b>IMoniker::IsRunning</b> on your <i>pmkToLeft</i> parameter instead.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-irunningobjecttable-isrunning#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT IsRunning(winmdroot.System.Com.IMoniker* pmkObjectName)
{
return ((delegate *unmanaged [Stdcall]<IRunningObjectTable*,winmdroot.System.Com.IMoniker* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IRunningObjectTable*)Unsafe.AsPointer(ref this), pmkObjectName);
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetObject(IRunningObjectTable* pThis, winmdroot.System.Com.IMoniker* pmkObjectName, winmdroot.System.Com.IUnknown** ppunkObject)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetObject(pmkObjectName, ppunkObject);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Determines whether the object identified by the specified moniker is running, and if it is, retrieves a pointer to that object.</summary>
/// <param name="pmkObjectName">A pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imoniker">IMoniker</a> interface on the moniker.</param>
/// <param name="ppunkObject">A pointer to 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 running object. When successful, the implementation calls <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-addref">AddRef</a> on the 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>. If the object is not running or if an error occurs, the implementation sets *<i>ppunkObject</i> to <b>NULL</b>.</param>
/// <returns>
/// <para>This method can return the following values. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>This method checks the ROT for the moniker specified by <i>pmkObjectName</i>. If that moniker had previously been registered with a call to <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-irunningobjecttable-register">IRunningObjectTable::Register</a>, this method returns the pointer that was registered at that time. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> Generally, you call the <b>IRunningObjectTable::GetObject</b> method only if you are writing your own moniker class (that is, implementing the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imoniker">IMoniker</a> interface). You typically call this method from your implementation of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-imoniker-bindtoobject">IMoniker::BindToObject</a>. However, note that not all implementations of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-imoniker-bindtoobject">IMoniker::BindToObject</a> need to call this method. If you expect your moniker to have a prefix (indicated by a non-<b>NULL</b><i>pmkToLeft</i> parameter to <b>IMoniker::BindToObject</b>), you should not check the ROT. The reason for this is that only complete monikers are registered with the ROT, and if your moniker has a prefix, your moniker is part of a composite and thus not complete. Instead, your moniker should request services from the object identified by the prefix (for example, the container of the object identified by your moniker).</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-irunningobjecttable-getobject#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT GetObject(winmdroot.System.Com.IMoniker* pmkObjectName, winmdroot.System.Com.IUnknown** ppunkObject)
{
return ((delegate *unmanaged [Stdcall]<IRunningObjectTable*,winmdroot.System.Com.IMoniker* ,winmdroot.System.Com.IUnknown** ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IRunningObjectTable*)Unsafe.AsPointer(ref this), pmkObjectName, ppunkObject);
}
/// <inheritdoc cref="NoteChangeTime(uint, global::System.Runtime.InteropServices.ComTypes.FILETIME*)"/>
internal unsafe winmdroot.Foundation.HRESULT NoteChangeTime(uint dwRegister, in global::System.Runtime.InteropServices.ComTypes.FILETIME pfiletime)
{
fixed (global::System.Runtime.InteropServices.ComTypes.FILETIME* pfiletimeLocal = &pfiletime)
{
winmdroot.Foundation.HRESULT __result = this.NoteChangeTime(dwRegister, pfiletimeLocal);
return __result;
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT NoteChangeTime(IRunningObjectTable* pThis, uint dwRegister, global::System.Runtime.InteropServices.ComTypes.FILETIME* pfiletime)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.NoteChangeTime(dwRegister, pfiletime);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Records the time that a running object was last modified. The object must have previously been registered with the running object table (ROT). This method stores the time of last change in the ROT.</summary>
/// <param name="dwRegister">The identifier of the ROT entry of the changed object. This value was previously returned by <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-irunningobjecttable-register">IRunningObjectTable::Register</a>.</param>
/// <param name="pfiletime">A pointer to a <a href="https://docs.microsoft.com/windows/desktop/api/minwinbase/ns-minwinbase-filetime">FILETIME</a> structure containing the object's last change time.</param>
/// <returns>This method can return the standard return values E_INVALIDARG and S_OK.</returns>
/// <remarks>
/// <para>The time recorded by this method can be retrieved by calling <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-irunningobjecttable-gettimeoflastchange">IRunningObjectTable::GetTimeOfLastChange</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 moniker provider (hands out monikers identifying its objects to make them accessible to others) must call the <b>NoteChangeTime</b> method whenever its objects are modified. It must have previously called <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-irunningobjecttable-register">IRunningObjectTable::Register</a> and stored the identifier returned by that method; it uses that identifier when calling <b>NoteChangeTime</b>.</para>
/// <para>The most common type of moniker provider is a compound-document link source. This includes server applications that support linking to their documents (or portions of a document) and container applications that support linking to embeddings within their documents. Server applications that do not support linking can also use the ROT to cooperate with container applications that support linking to embeddings.</para>
/// <para>When an object is first registered in the ROT, the ROT records its last change time as the value returned by calling <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-imoniker-gettimeoflastchange">IMoniker::GetTimeOfLastChange</a> on the moniker being registered.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-irunningobjecttable-notechangetime#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT NoteChangeTime(uint dwRegister, global::System.Runtime.InteropServices.ComTypes.FILETIME* pfiletime)
{
return ((delegate *unmanaged [Stdcall]<IRunningObjectTable*,uint ,global::System.Runtime.InteropServices.ComTypes.FILETIME* ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IRunningObjectTable*)Unsafe.AsPointer(ref this), dwRegister, pfiletime);
}
/// <inheritdoc cref="GetTimeOfLastChange(winmdroot.System.Com.IMoniker*, global::System.Runtime.InteropServices.ComTypes.FILETIME*)"/>
internal unsafe winmdroot.Foundation.HRESULT GetTimeOfLastChange(winmdroot.System.Com.IMoniker* pmkObjectName, out global::System.Runtime.InteropServices.ComTypes.FILETIME pfiletime)
{
fixed (global::System.Runtime.InteropServices.ComTypes.FILETIME* pfiletimeLocal = &pfiletime)
{
winmdroot.Foundation.HRESULT __result = this.GetTimeOfLastChange(pmkObjectName, pfiletimeLocal);
return __result;
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetTimeOfLastChange(IRunningObjectTable* pThis, winmdroot.System.Com.IMoniker* pmkObjectName, global::System.Runtime.InteropServices.ComTypes.FILETIME* pfiletime)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetTimeOfLastChange(pmkObjectName, pfiletime);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Retrieves the time that an object was last modified.</summary>
/// <param name="pmkObjectName">A pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imoniker">IMoniker</a> interface on the moniker.</param>
/// <param name="pfiletime">A pointer to a <a href="https://docs.microsoft.com/windows/desktop/api/minwinbase/ns-minwinbase-filetime">FILETIME</a> structure that receives the object's last change time.</param>
/// <returns>
/// <para>This method can return the following values. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>This method returns the change time that was last reported for this object by a call to <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-irunningobjecttable-notechangetime">IRunningObjectTable::NoteChangeTime</a>. If <b>NoteChangeTime</b> has not been called previously, the method returns the time that was recorded when the object was registered. This method is provided to enable checking whether a connection between two objects (represented by one object holding a moniker that identifies the other) is up-to-date. For example, if one object is holding cached information about the other object, this method can be used to check whether the object has been modified since the cache was last updated. See <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-imoniker-gettimeoflastchange">IMoniker::GetTimeOfLastChange</a>. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> Generally, you call <b>GetTimeOfLastChange</b> only if you are writing your own moniker class (that is, implementing the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imoniker">IMoniker</a> interface). You typically call this method from your implementation of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-imoniker-gettimeoflastchange">IMoniker::GetTimeOfLastChange</a>. However, you should do so only if the <i>pmkToLeft</i> parameter of <b>IMoniker::GetTimeOfLastChange</b> is <b>NULL</b>. Otherwise, you should call <b>IMoniker::GetTimeOfLastChange</b> on your <i>pmkToLeft</i> parameter instead.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-irunningobjecttable-gettimeoflastchange#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT GetTimeOfLastChange(winmdroot.System.Com.IMoniker* pmkObjectName, global::System.Runtime.InteropServices.ComTypes.FILETIME* pfiletime)
{
return ((delegate *unmanaged [Stdcall]<IRunningObjectTable*,winmdroot.System.Com.IMoniker* ,global::System.Runtime.InteropServices.ComTypes.FILETIME* ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IRunningObjectTable*)Unsafe.AsPointer(ref this), pmkObjectName, pfiletime);
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT EnumRunning(IRunningObjectTable* pThis, winmdroot.System.Com.IEnumMoniker** ppenumMoniker)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.EnumRunning(ppenumMoniker);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Creates and returns a pointer to an enumerator that can list the monikers of all the objects currently registered in the running object table (ROT).</summary>
/// <param name="ppenumMoniker">A pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-ienummoniker">IEnumMoniker</a> pointer variable that receives the interface pointer to the new enumerator for the ROT. When successful, the implementation calls <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-addref">AddRef</a> on the enumerator; 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>ppenumMoniker</i> to <b>NULL</b>.</param>
/// <returns>This method can return the standard return values E_OUTOFMEMORY and S_OK.</returns>
/// <remarks>
/// <para><b>IRunningObjectTable::EnumRunning</b> must create and return a pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-ienummoniker">IEnumMoniker</a> interface on an enumerator object. The standard enumerator methods can then be called to enumerate the monikers currently registered in the registry. The enumerator cannot be used to enumerate monikers that are registered in the ROT after the enumerator has been created. The <b>EnumRunning</b> method is intended primarily for the use by the system in implementing the alert object table. Note that OLE 2 does not include an implementation of the alert object table.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-irunningobjecttable-enumrunning#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT EnumRunning(winmdroot.System.Com.IEnumMoniker** ppenumMoniker)
{
return ((delegate *unmanaged [Stdcall]<IRunningObjectTable*,winmdroot.System.Com.IEnumMoniker** ,winmdroot.Foundation.HRESULT>)lpVtbl[9])((IRunningObjectTable*)Unsafe.AsPointer(ref this), ppenumMoniker);
}
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]<IRunningObjectTable*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;
internal delegate *unmanaged [Stdcall]<IRunningObjectTable*,uint> AddRef_2;
internal delegate *unmanaged [Stdcall]<IRunningObjectTable*,uint> Release_3;
internal delegate *unmanaged [Stdcall]<IRunningObjectTable*,winmdroot.System.Com.ROT_FLAGS ,winmdroot.System.Com.IUnknown* ,winmdroot.System.Com.IMoniker* ,uint* ,winmdroot.Foundation.HRESULT> Register_4;
internal delegate *unmanaged [Stdcall]<IRunningObjectTable*,uint ,winmdroot.Foundation.HRESULT> Revoke_5;
internal delegate *unmanaged [Stdcall]<IRunningObjectTable*,winmdroot.System.Com.IMoniker* ,winmdroot.Foundation.HRESULT> IsRunning_6;
internal delegate *unmanaged [Stdcall]<IRunningObjectTable*,winmdroot.System.Com.IMoniker* ,winmdroot.System.Com.IUnknown** ,winmdroot.Foundation.HRESULT> GetObject_7;
internal delegate *unmanaged [Stdcall]<IRunningObjectTable*,uint ,global::System.Runtime.InteropServices.ComTypes.FILETIME* ,winmdroot.Foundation.HRESULT> NoteChangeTime_8;
internal delegate *unmanaged [Stdcall]<IRunningObjectTable*,winmdroot.System.Com.IMoniker* ,global::System.Runtime.InteropServices.ComTypes.FILETIME* ,winmdroot.Foundation.HRESULT> GetTimeOfLastChange_9;
internal delegate *unmanaged [Stdcall]<IRunningObjectTable*,winmdroot.System.Com.IEnumMoniker** ,winmdroot.Foundation.HRESULT> EnumRunning_10;
}
public static void PopulateVTable(Vtbl* vtable)
{
vtable->Register_4 = &Register;
vtable->Revoke_5 = &Revoke;
vtable->IsRunning_6 = &IsRunning;
vtable->GetObject_7 = &GetObject;
vtable->NoteChangeTime_8 = &NoteChangeTime;
vtable->GetTimeOfLastChange_9 = &GetTimeOfLastChange;
vtable->EnumRunning_10 = &EnumRunning;
}
private void** lpVtbl;
/// <summary>The IID guid for this interface.</summary>
/// <value>{00000010-0000-0000-c000-000000000046}</value>
internal static readonly Guid IID_Guid = new Guid(0x00000010, 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[] {
0x10,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("00000010-0000-0000-C000-000000000046"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
[SupportedOSPlatform("windows5.0")]
internal interface Interface
{
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Register(winmdroot.System.Com.ROT_FLAGS grfFlags, winmdroot.System.Com.IUnknown* punkObject, winmdroot.System.Com.IMoniker* pmkObjectName, uint* pdwRegister);
[PreserveSig()]
winmdroot.Foundation.HRESULT Revoke(uint dwRegister);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT IsRunning(winmdroot.System.Com.IMoniker* pmkObjectName);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetObject(winmdroot.System.Com.IMoniker* pmkObjectName, winmdroot.System.Com.IUnknown** ppunkObject);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT NoteChangeTime(uint dwRegister, global::System.Runtime.InteropServices.ComTypes.FILETIME* pfiletime);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetTimeOfLastChange(winmdroot.System.Com.IMoniker* pmkObjectName, global::System.Runtime.InteropServices.ComTypes.FILETIME* pfiletime);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT EnumRunning(winmdroot.System.Com.IEnumMoniker** ppenumMoniker);
}
}
}
}
|