|
// ------------------------------------------------------------------------------
// <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("0000010F-0000-0000-C000-000000000046")]
[SupportedOSPlatform("windows5.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal unsafe partial struct IAdviseSink
:IVTable<IAdviseSink,IAdviseSink.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]<IAdviseSink*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IAdviseSink*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
public uint AddRef()
{
return ((delegate *unmanaged [Stdcall]<IAdviseSink*,uint>)lpVtbl[1])((IAdviseSink*)Unsafe.AsPointer(ref this));
}
public uint Release()
{
return ((delegate *unmanaged [Stdcall]<IAdviseSink*,uint>)lpVtbl[2])((IAdviseSink*)Unsafe.AsPointer(ref this));
}
/// <inheritdoc cref="OnDataChange(winmdroot.System.Com.FORMATETC*, winmdroot.System.Com.STGMEDIUM*)"/>
internal unsafe void OnDataChange(in winmdroot.System.Com.FORMATETC pFormatetc, in winmdroot.System.Com.STGMEDIUM pStgmed)
{
fixed (winmdroot.System.Com.STGMEDIUM* pStgmedLocal = &pStgmed)
{
fixed (winmdroot.System.Com.FORMATETC* pFormatetcLocal = &pFormatetc)
{
this.OnDataChange(pFormatetcLocal, pStgmedLocal);
}
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static void OnDataChange(IAdviseSink* pThis, winmdroot.System.Com.FORMATETC* pFormatetc, winmdroot.System.Com.STGMEDIUM* pStgmed)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
__hr.ThrowOnFailure();
__object.OnDataChange(pFormatetc, pStgmed);
}
catch (Exception ex)
{
global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex);
throw;
}
}
/// <summary>Called by the server to notify a data object's currently registered advise sinks that data in the object has changed.</summary>
/// <param name="pFormatetc">A pointer to a <a href="https://docs.microsoft.com/windows/desktop/api/objidl/ns-objidl-formatetc">FORMATETC</a> structure, which describes the format, target device, rendering, and storage information of the calling data object.</param>
/// <param name="pStgmed">A pointer to a <a href="https://docs.microsoft.com/windows/win32/api/objidl/ns-objidl-ustgmedium-r1">STGMEDIUM</a> structure, which defines the storage medium (global memory, disk file, storage object, stream object, GDI object, or undefined) and ownership of that medium for the calling data object.</param>
/// <remarks>
/// <para>Object handlers and containers of link objects implement <b>IAdviseSink::OnDataChange</b> to take appropriate steps when notified that data in the object has changed. They also must call <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-idataobject-dadvise">IDataObject::DAdvise</a> to set up advisory connections with the objects in whose data they are interested. Containers that take advantage of OLE's caching support do not need to register for data-change notifications, because the information necessary to update the container's presentation of the object, including any changes in its data, are maintained in the object's cache. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> If you implement <b>IAdviseSink::OnDataChange</b> for a container, remember that this method is asynchronous and that making synchronous calls within asynchronous methods is not valid. Therefore, you cannot call <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-idataobject-getdata">IDataObject::GetData</a> to obtain the data you need to update your object. Instead, you either post an internal message, or invalidate the rectangle for the changed data by calling <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-invalidaterect">InvalidateRect</a> and waiting for a <a href="https://docs.microsoft.com/windows/desktop/gdi/wm-paint">WM_PAINT</a> message, at which point you are free to get the data and update the object. The data itself, which is valid only for the duration of the call, is passed using the storage medium pointed to by <i>pStgmed</i>. Since the caller owns the medium, the advise sink should not free it. Also, if <i>pStgmed</i> points to an <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-istorage">IStorage</a> or <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-istream">IStream</a> interface, the sink must not increment the reference count.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-iadvisesink-ondatachange#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void OnDataChange(winmdroot.System.Com.FORMATETC* pFormatetc, winmdroot.System.Com.STGMEDIUM* pStgmed)
{
((delegate *unmanaged [Stdcall]<IAdviseSink*,winmdroot.System.Com.FORMATETC* ,winmdroot.System.Com.STGMEDIUM* ,void>)lpVtbl[3])((IAdviseSink*)Unsafe.AsPointer(ref this), pFormatetc, pStgmed);
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static void OnViewChange(IAdviseSink* pThis, uint dwAspect, int lindex)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
__hr.ThrowOnFailure();
__object.OnViewChange(dwAspect, lindex);
}
catch (Exception ex)
{
global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex);
throw;
}
}
/// <summary>Notifies an object's registered advise sinks that its view has changed.</summary>
/// <param name="dwAspect">The aspect, or view, of the object. Contains a value taken from the <a href="https://docs.microsoft.com/windows/desktop/api/wtypes/ne-wtypes-dvaspect">DVASPECT</a> enumeration.</param>
/// <param name="lindex">The portion of the view that has changed. Currently only -1 is valid.</param>
/// <remarks>
/// <para>Containers register to be notified when an object's view changes by calling <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-iviewobject-setadvise">IViewObject::SetAdvise</a>. After it is registered, the object will call the sink's <b>IAdviseSink::OnViewChange</b> method when appropriate. <b>OnViewChange</b> can be called when the object is in either the loaded or running state. Even though <a href="https://docs.microsoft.com/windows/desktop/api/wtypes/ne-wtypes-dvaspect">DVASPECT</a> values are individual flag bits, <i>dwAspect</i> may represent only one value. That is, <i>dwAspect</i> cannot contain the result of an OR operation combining two or more <b>DVASPECT</b> values. The <i>lindex</i> parameter represents the part of the aspect that is of interest. The value of <i>lindex</i> depends on the value of <i>dwAspect</i>. If <i>dwAspect</i> is either DVASPECT_THUMBNAIL or DVASPECT_ICON, <i>lindex</i> is ignored. If <i>dwAspect</i> is DVASPECT_CONTENT, <i>lindex</i> must be -1, which indicates that the entire view is of interest and is the only value that is currently valid.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-iadvisesink-onviewchange#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public void OnViewChange(uint dwAspect, int lindex)
{
((delegate *unmanaged [Stdcall]<IAdviseSink*,uint ,int ,void>)lpVtbl[4])((IAdviseSink*)Unsafe.AsPointer(ref this), dwAspect, lindex);
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static void OnRename(IAdviseSink* pThis, winmdroot.System.Com.IMoniker* pmk)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
__hr.ThrowOnFailure();
__object.OnRename(pmk);
}
catch (Exception ex)
{
global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex);
throw;
}
}
/// <summary>Called by the server to notify all registered advisory sinks that the object has been renamed.</summary>
/// <param name="pmk">A pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imoniker">IMoniker</a> interface on the new full moniker of the object.</param>
/// <remarks>OLE link objects normally implement <b>IAdviseSink::OnRename</b> to receive notification of a change in the name of a link source or its container. The object serving as the link source calls <b>OnRename</b> and passes its new full moniker to the object handler, which forwards the notification to the link object. In response, the link object must update its moniker. The link object, in turn, forwards the notification to its own container.</remarks>
public unsafe void OnRename(winmdroot.System.Com.IMoniker* pmk)
{
((delegate *unmanaged [Stdcall]<IAdviseSink*,winmdroot.System.Com.IMoniker* ,void>)lpVtbl[5])((IAdviseSink*)Unsafe.AsPointer(ref this), pmk);
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static void OnSave(IAdviseSink* pThis)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
__hr.ThrowOnFailure();
__object.OnSave();
}
catch (Exception ex)
{
global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex);
throw;
}
}
/// <summary>Called by the server to notify all registered advisory sinks that the object has been saved.</summary>
/// <remarks>Object handlers and link objects normally implement <b>IAdviseSink::OnSave</b> to receive notifications of when an object is saved to disk, either to its original storage (through a <b>Save</b> operation) or to new storage (through a <b>Save As</b> operation). Object Handlers and link objects register to be notified when an object is saved for the purpose of updating their caches, but then only if the advise flag passed during registration specifies ADVFCACHE_ONSAVE. Object handlers and link objects forward these notifications to their containers.</remarks>
public void OnSave()
{
((delegate *unmanaged [Stdcall]<IAdviseSink*,void>)lpVtbl[6])((IAdviseSink*)Unsafe.AsPointer(ref this));
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static void OnClose(IAdviseSink* pThis)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
__hr.ThrowOnFailure();
__object.OnClose();
}
catch (Exception ex)
{
global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex);
throw;
}
}
/// <summary>Called by the server to notify all registered advisory sinks that the object has changed from the running to the loaded state.</summary>
/// <remarks>
/// <para>The <b>OnClose</b> notification indicates that an object is making the transition from the running to the loaded state, so its container can take appropriate measures to ensure an orderly shutdown. For example, an object handler must release its pointer to the object. If the object that is closing is the last open object supported by its OLE server application, the application can also shut down. In the case of a link object, the notification that the object is closing should always be interpreted to mean that the connection to the link source has broken.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-iadvisesink-onclose#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public void OnClose()
{
((delegate *unmanaged [Stdcall]<IAdviseSink*,void>)lpVtbl[7])((IAdviseSink*)Unsafe.AsPointer(ref this));
}
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]<IAdviseSink*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;
internal delegate *unmanaged [Stdcall]<IAdviseSink*,uint> AddRef_2;
internal delegate *unmanaged [Stdcall]<IAdviseSink*,uint> Release_3;
internal delegate *unmanaged [Stdcall]<IAdviseSink*,winmdroot.System.Com.FORMATETC* ,winmdroot.System.Com.STGMEDIUM* ,void> OnDataChange_4;
internal delegate *unmanaged [Stdcall]<IAdviseSink*,uint ,int ,void> OnViewChange_5;
internal delegate *unmanaged [Stdcall]<IAdviseSink*,winmdroot.System.Com.IMoniker* ,void> OnRename_6;
internal delegate *unmanaged [Stdcall]<IAdviseSink*,void> OnSave_7;
internal delegate *unmanaged [Stdcall]<IAdviseSink*,void> OnClose_8;
}
public static void PopulateVTable(Vtbl* vtable)
{
vtable->OnDataChange_4 = &OnDataChange;
vtable->OnViewChange_5 = &OnViewChange;
vtable->OnRename_6 = &OnRename;
vtable->OnSave_7 = &OnSave;
vtable->OnClose_8 = &OnClose;
}
private void** lpVtbl;
/// <summary>The IID guid for this interface.</summary>
/// <value>{0000010f-0000-0000-c000-000000000046}</value>
internal static readonly Guid IID_Guid = new Guid(0x0000010F, 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[] {
0x0F,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("0000010F-0000-0000-C000-000000000046"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
[SupportedOSPlatform("windows5.0")]
internal interface Interface
{
[PreserveSig()]
unsafe void OnDataChange(winmdroot.System.Com.FORMATETC* pFormatetc, winmdroot.System.Com.STGMEDIUM* pStgmed);
[PreserveSig()]
void OnViewChange(uint dwAspect, int lindex);
[PreserveSig()]
unsafe void OnRename(winmdroot.System.Com.IMoniker* pmk);
[PreserveSig()]
void OnSave();
[PreserveSig()]
void OnClose();
}
}
}
}
|