|
// ------------------------------------------------------------------------------
// <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("37D84F60-42CB-11CE-8135-00AA004BB851")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal unsafe partial struct IPersistPropertyBag
:IVTable<IPersistPropertyBag,IPersistPropertyBag.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]<IPersistPropertyBag*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IPersistPropertyBag*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
public uint AddRef()
{
return ((delegate *unmanaged [Stdcall]<IPersistPropertyBag*,uint>)lpVtbl[1])((IPersistPropertyBag*)Unsafe.AsPointer(ref this));
}
public uint Release()
{
return ((delegate *unmanaged [Stdcall]<IPersistPropertyBag*,uint>)lpVtbl[2])((IPersistPropertyBag*)Unsafe.AsPointer(ref this));
}
/// <inheritdoc cref="GetClassID(global::System.Guid*)"/>
internal unsafe void GetClassID(out global::System.Guid pClassID)
{
fixed (global::System.Guid* pClassIDLocal = &pClassID)
{
this.GetClassID(pClassIDLocal);
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetClassID(IPersistPropertyBag* pThis, global::System.Guid* pClassID)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetClassID(pClassID);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
public unsafe void GetClassID(global::System.Guid* pClassID)
{
((delegate *unmanaged [Stdcall]<IPersistPropertyBag*,global::System.Guid* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IPersistPropertyBag*)Unsafe.AsPointer(ref this), pClassID).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT InitNew(IPersistPropertyBag* pThis)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.InitNew();
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Informs the object that it is being initialized as a newly created object.</summary>
/// <returns></returns>
/// <remarks>E_NOTIMPL should not be returned. Return S_OK, even if the object does not perform any function in this method.</remarks>
public winmdroot.Foundation.HRESULT InitNew()
{
return ((delegate *unmanaged [Stdcall]<IPersistPropertyBag*,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IPersistPropertyBag*)Unsafe.AsPointer(ref this));
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Load(IPersistPropertyBag* pThis, winmdroot.System.Com.StructuredStorage.IPropertyBag* pPropBag, winmdroot.System.Com.IErrorLog* pErrorLog)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Load(pPropBag, pErrorLog);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Instructs the object to initialize itself using the properties available in the property bag, and to notify the provided error log object when errors occur.</summary>
/// <param name="pPropBag">The address of the caller's property bag, through which the object can read properties. This cannot be NULL.</param>
/// <param name="pErrorLog">The address of the caller's error log, in which the object stores any errors that occur during initialization. This can be NULL; in which case, the caller does not receive errors.</param>
/// <returns></returns>
/// <remarks>
/// <para>All property loading must take place in the **IPersistPropertyBag::Load** function call, because the object cannot hold the IPropertyBag pointer. E_NOTIMPL is not a valid return code, because any object that implements this interface must support the entire functionality of the interface.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ipersistpropertybag-load#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT Load(winmdroot.System.Com.StructuredStorage.IPropertyBag* pPropBag, winmdroot.System.Com.IErrorLog* pErrorLog)
{
return ((delegate *unmanaged [Stdcall]<IPersistPropertyBag*,winmdroot.System.Com.StructuredStorage.IPropertyBag* ,winmdroot.System.Com.IErrorLog* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IPersistPropertyBag*)Unsafe.AsPointer(ref this), pPropBag, pErrorLog);
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Save(IPersistPropertyBag* pThis, winmdroot.System.Com.StructuredStorage.IPropertyBag* pPropBag, winmdroot.Foundation.BOOL fClearDirty, winmdroot.Foundation.BOOL fSaveAllProperties)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Save(pPropBag, fClearDirty, fSaveAllProperties);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Instructs the object to save its properties to the given property bag, and optionally, to clear the object's dirty flag.</summary>
/// <param name="pPropBag">The address of the caller's property bag, through which the object can write properties. This cannot be NULL.</param>
/// <param name="fClearDirty">A flag indicating whether the object should clear its dirty flag when the "Save" operation is complete. TRUE means clear the flag, and FALSE means leave the flag unaffected. FALSE is used when the caller performs a "Save Copy As" operation.</param>
/// <param name="fSaveAllProperties">A flag indicating whether the object should save all its properties (TRUE), or save only those properties that have changed from the default value (FALSE).</param>
/// <returns></returns>
/// <remarks>
/// <para>The caller can request that the object save all properties, or save only those properties that have changed. E_NOTIMPL is not a valid return code, because any object that implements this interface must support the entire functionality of the interface.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ipersistpropertybag-save#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT Save(winmdroot.System.Com.StructuredStorage.IPropertyBag* pPropBag, winmdroot.Foundation.BOOL fClearDirty, winmdroot.Foundation.BOOL fSaveAllProperties)
{
return ((delegate *unmanaged [Stdcall]<IPersistPropertyBag*,winmdroot.System.Com.StructuredStorage.IPropertyBag* ,winmdroot.Foundation.BOOL ,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IPersistPropertyBag*)Unsafe.AsPointer(ref this), pPropBag, fClearDirty, fSaveAllProperties);
}
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]<IPersistPropertyBag*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;
internal delegate *unmanaged [Stdcall]<IPersistPropertyBag*,uint> AddRef_2;
internal delegate *unmanaged [Stdcall]<IPersistPropertyBag*,uint> Release_3;
internal delegate *unmanaged [Stdcall]<IPersistPropertyBag*,global::System.Guid* ,winmdroot.Foundation.HRESULT> GetClassID_4;
internal delegate *unmanaged [Stdcall]<IPersistPropertyBag*,winmdroot.Foundation.HRESULT> InitNew_5;
internal delegate *unmanaged [Stdcall]<IPersistPropertyBag*,winmdroot.System.Com.StructuredStorage.IPropertyBag* ,winmdroot.System.Com.IErrorLog* ,winmdroot.Foundation.HRESULT> Load_6;
internal delegate *unmanaged [Stdcall]<IPersistPropertyBag*,winmdroot.System.Com.StructuredStorage.IPropertyBag* ,winmdroot.Foundation.BOOL ,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> Save_7;
}
public static void PopulateVTable(Vtbl* vtable)
{
vtable->GetClassID_4 = &GetClassID;
vtable->InitNew_5 = &InitNew;
vtable->Load_6 = &Load;
vtable->Save_7 = &Save;
}
private void** lpVtbl;
/// <summary>The IID guid for this interface.</summary>
/// <value>{37d84f60-42cb-11ce-8135-00aa004bb851}</value>
internal static readonly Guid IID_Guid = new Guid(0x37D84F60, 0x42CB, 0x11CE, 0x81, 0x35, 0x00, 0xAA, 0x00, 0x4B, 0xB8, 0x51);
static ref readonly Guid IComIID.Guid {
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[] {
0x60,0x4F,0xD8,0x37,0xCB,0x42,0xCE,0x11,0x81,0x35,0x00,0xAA,0x00,0x4B,0xB8,0x51 };
return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
}
}
[Guid("37D84F60-42CB-11CE-8135-00AA004BB851"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
internal interface Interface
:winmdroot.System.Com.IPersist.Interface {
[PreserveSig()]
unsafe new winmdroot.Foundation.HRESULT GetClassID(global::System.Guid* pClassID);
[PreserveSig()]
winmdroot.Foundation.HRESULT InitNew();
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Load(winmdroot.System.Com.StructuredStorage.IPropertyBag* pPropBag, winmdroot.System.Com.IErrorLog* pErrorLog);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Save(winmdroot.System.Com.StructuredStorage.IPropertyBag* pPropBag, winmdroot.Foundation.BOOL fClearDirty, winmdroot.Foundation.BOOL fSaveAllProperties);
}
}
}
}
|