|
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
#pragma warning disable CS1591,CS1573,CS0465,CS0649,CS8019,CS1570,CS1584,CS1658,CS0436,CS8981
using global::System;
using global::System.Diagnostics;
using global::System.Diagnostics.CodeAnalysis;
using global::System.Runtime.CompilerServices;
using global::System.Runtime.InteropServices;
using global::System.Runtime.Versioning;
using winmdroot = global::Windows.Win32;
namespace Windows.Win32
{
namespace System.Ole
{
[Guid("9BFBBC02-EFF1-101A-84ED-00AA00341D07")]
[SupportedOSPlatform("windows5.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal unsafe partial struct IPropertyNotifySink
:IVTable<IPropertyNotifySink,IPropertyNotifySink.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]<IPropertyNotifySink*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IPropertyNotifySink*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
public uint AddRef()
{
return ((delegate *unmanaged [Stdcall]<IPropertyNotifySink*,uint>)lpVtbl[1])((IPropertyNotifySink*)Unsafe.AsPointer(ref this));
}
public uint Release()
{
return ((delegate *unmanaged [Stdcall]<IPropertyNotifySink*,uint>)lpVtbl[2])((IPropertyNotifySink*)Unsafe.AsPointer(ref this));
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT OnChanged(IPropertyNotifySink* pThis, int dispID)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.OnChanged(dispID);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Notifies a sink that a bindable property has changed.</summary>
/// <param name="dispID">The dispatch identifier of the property that changed, or DISPID_UNKNOWN if multiple properties have changed. The client (owner of the sink) should retrieve the current value of each property of interest from the object that generated the notification.</param>
/// <returns>This method returns S_OK in all cases.</returns>
/// <remarks>S_OK is returned in all cases even when the sink does not need [<a href="https://docs.microsoft.com/windows/desktop/Midl/bindable">bindable</a>] properties or when some other failure has occurred. In short, the calling object simply sends the notification and cannot attempt to use an error code (such as E_NOTIMPL) to determine whether to not send the notification in the future. Such semantics are not part of this interface.</remarks>
public winmdroot.Foundation.HRESULT OnChanged(int dispID)
{
return ((delegate *unmanaged [Stdcall]<IPropertyNotifySink*,int ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IPropertyNotifySink*)Unsafe.AsPointer(ref this), dispID);
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT OnRequestEdit(IPropertyNotifySink* pThis, int dispID)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.OnRequestEdit(dispID);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Notifies a sink that a requestedit property is about to change.</summary>
/// <param name="dispID">The dispatch identifier of the property that is about to change or DISPID_UNKNOWN if multiple properties are about to change.</param>
/// <returns>
/// <para>This method can return the following values. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>The sink may choose to allow or disallow the change to take place. For example, the sink may enforce a read-only state on the property. DISPID_UNKNOWN is a valid parameter to this method to indicate that multiple properties are about to change. In this case, the sink can enforce a global read-only state for all [<a href="https://docs.microsoft.com/windows/desktop/Midl/requestedit">requestedit</a>] properties in the object, including any specific ones that the sink otherwise recognizes. If the sink allows changes, the object must also make <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ipropertynotifysink-onchanged">IPropertyNotifySink::OnChanged</a> notifications for any properties that are marked [<a href="https://docs.microsoft.com/windows/desktop/Midl/bindable">bindable</a>] in addition to [<a href="https://docs.microsoft.com/windows/desktop/Midl/requestedit">requestedit</a>].</para>
/// <para>This method cannot be used to implement any sort of data validation. At the time of the call, the desired new value of the property is unavailable and thus cannot be validated. This method's only purpose is to allow the sink to enforce a read-only state on a property.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ipropertynotifysink-onrequestedit#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public winmdroot.Foundation.HRESULT OnRequestEdit(int dispID)
{
return ((delegate *unmanaged [Stdcall]<IPropertyNotifySink*,int ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IPropertyNotifySink*)Unsafe.AsPointer(ref this), dispID);
}
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]<IPropertyNotifySink*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;
internal delegate *unmanaged [Stdcall]<IPropertyNotifySink*,uint> AddRef_2;
internal delegate *unmanaged [Stdcall]<IPropertyNotifySink*,uint> Release_3;
internal delegate *unmanaged [Stdcall]<IPropertyNotifySink*,int ,winmdroot.Foundation.HRESULT> OnChanged_4;
internal delegate *unmanaged [Stdcall]<IPropertyNotifySink*,int ,winmdroot.Foundation.HRESULT> OnRequestEdit_5;
}
public static void PopulateVTable(Vtbl* vtable)
{
vtable->OnChanged_4 = &OnChanged;
vtable->OnRequestEdit_5 = &OnRequestEdit;
}
private void** lpVtbl;
/// <summary>The IID guid for this interface.</summary>
/// <value>{9bfbbc02-eff1-101a-84ed-00aa00341d07}</value>
internal static readonly Guid IID_Guid = new Guid(0x9BFBBC02, 0xEFF1, 0x101A, 0x84, 0xED, 0x00, 0xAA, 0x00, 0x34, 0x1D, 0x07);
static ref readonly Guid IComIID.Guid {
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[] {
0x02,0xBC,0xFB,0x9B,0xF1,0xEF,0x1A,0x10,0x84,0xED,0x00,0xAA,0x00,0x34,0x1D,0x07 };
return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
}
}
[Guid("9BFBBC02-EFF1-101A-84ED-00AA00341D07"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
[SupportedOSPlatform("windows5.0")]
internal interface Interface
{
[PreserveSig()]
winmdroot.Foundation.HRESULT OnChanged(int dispID);
[PreserveSig()]
winmdroot.Foundation.HRESULT OnRequestEdit(int dispID);
}
}
}
}
|