|
// ------------------------------------------------------------------------------
// <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("7FD52380-4E07-101B-AE2D-08002B2EC713")]
[SupportedOSPlatform("windows5.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal unsafe partial struct IPersistStreamInit
:IVTable<IPersistStreamInit,IPersistStreamInit.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]<IPersistStreamInit*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IPersistStreamInit*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
public uint AddRef()
{
return ((delegate *unmanaged [Stdcall]<IPersistStreamInit*,uint>)lpVtbl[1])((IPersistStreamInit*)Unsafe.AsPointer(ref this));
}
public uint Release()
{
return ((delegate *unmanaged [Stdcall]<IPersistStreamInit*,uint>)lpVtbl[2])((IPersistStreamInit*)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(IPersistStreamInit* 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]<IPersistStreamInit*,global::System.Guid* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IPersistStreamInit*)Unsafe.AsPointer(ref this), pClassID).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT IsDirty(IPersistStreamInit* pThis)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.IsDirty();
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Determines whether an object has changed since it was last saved to its stream. (IPersistStreamInit.IsDirty)</summary>
/// <returns>This method returns S_OK to indicate that the object has changed. Otherwise, it returns S_FALSE.</returns>
/// <remarks>
/// <para>Use this method to determine whether an object should be saved before closing it. The dirty flag for an object is conditionally cleared in the <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ipersiststreaminit-save">IPersistStreamInit::Save</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> You should treat any error return codes as an indication that the object has changed. Unless this method explicitly returns S_FALSE, assume that the object must be saved. Note that the OLE-provided implementations of the <b>IPersistStreamInit::IsDirty</b> method in the OLE-provided moniker interfaces always return S_FALSE because their internal state never changes.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ipersiststreaminit-isdirty#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public winmdroot.Foundation.HRESULT IsDirty()
{
return ((delegate *unmanaged [Stdcall]<IPersistStreamInit*,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IPersistStreamInit*)Unsafe.AsPointer(ref this));
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Load(IPersistStreamInit* pThis, winmdroot.System.Com.IStream* pStm)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Load(pStm);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Initializes an object from the stream where it was saved previously. (IPersistStreamInit.Load)</summary>
/// <param name="pStm">An <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-istream">IStream</a> pointer to the stream from which the object should be loaded.</param>
/// <returns>
/// <para>This method can return the following values. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>If the object has already been initialized with <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ipersiststreaminit-initnew">IPersistStreamInit::InitNew</a>, then this method must return E_UNEXPECTED. This method loads an object from its associated stream. The seek pointer is set as it was in the most recent <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ipersiststreaminit-save">IPersistStreamInit::Save</a> method. This method can seek and read from the stream, but cannot write to it.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ipersiststreaminit-load#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT Load(winmdroot.System.Com.IStream* pStm)
{
return ((delegate *unmanaged [Stdcall]<IPersistStreamInit*,winmdroot.System.Com.IStream* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IPersistStreamInit*)Unsafe.AsPointer(ref this), pStm);
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Save(IPersistStreamInit* pThis, winmdroot.System.Com.IStream* pStm, winmdroot.Foundation.BOOL fClearDirty)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Save(pStm, fClearDirty);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Saves an object to the specified stream. (IPersistStreamInit.Save)</summary>
/// <param name="pStm">An <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-istream">IStream</a> pointer to the stream into which the object should be saved.</param>
/// <param name="fClearDirty">Indicates whether to clear the dirty flag after the save is complete. If <b>TRUE</b>, the flag should be cleared. If <b>FALSE</b>, the flag should be left unchanged.</param>
/// <returns>
/// <para>This method can return the following values. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para><b>IPersistStreamInit::Save</b> saves an object into the specified stream and indicates whether the object should reset its dirty flag. The seek pointer is positioned at the location in the stream at which the object should begin writing its data. The object calls the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-isequentialstream-write">ISequentialStream::Write</a> method to write its data. On exit, the seek pointer must be positioned immediately past the object data. The position of the seek pointer is undefined if an error returns. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> The <b>IPersistStreamInit::Save</b> method does not write the CLSID to the stream. The caller is responsible for writing the CLSID. The <b>IPersistStreamInit::Save</b> method can read from, write to, and seek in the stream; but it must not seek to a location in the stream before that of the seek pointer on entry.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ipersiststreaminit-save#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT Save(winmdroot.System.Com.IStream* pStm, winmdroot.Foundation.BOOL fClearDirty)
{
return ((delegate *unmanaged [Stdcall]<IPersistStreamInit*,winmdroot.System.Com.IStream* ,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IPersistStreamInit*)Unsafe.AsPointer(ref this), pStm, fClearDirty);
}
/// <inheritdoc cref="GetSizeMax(ulong*)"/>
internal unsafe void GetSizeMax(out ulong pCbSize)
{
fixed (ulong* pCbSizeLocal = &pCbSize)
{
this.GetSizeMax(pCbSizeLocal);
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetSizeMax(IPersistStreamInit* pThis, ulong* pCbSize)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetSizeMax(pCbSize);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Retrieves the size of the stream needed to save the object. (IPersistStreamInit.GetSizeMax)</summary>
/// <param name="pCbSize">The size in bytes of the stream needed to save this object, in bytes.</param>
/// <returns>This method returns S_OK to indicate that the size was retrieved successfully.</returns>
/// <remarks>
/// <para>This method returns the size needed to save an object. You can call this method to determine the size and set the necessary buffers before calling the <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ipersiststreaminit-save">IPersistStreamInit::Save</a> method. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> The <b>GetSizeMax</b> implementation should return a conservative estimate of the necessary size because the caller might call the <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ipersiststreaminit-save">IPersistStreamInit::Save</a> method with a non-growable stream.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ipersiststreaminit-getsizemax#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void GetSizeMax(ulong* pCbSize)
{
((delegate *unmanaged [Stdcall]<IPersistStreamInit*,ulong* ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IPersistStreamInit*)Unsafe.AsPointer(ref this), pCbSize).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT InitNew(IPersistStreamInit* 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>Initializes an object to a default state. This method is to be called instead of IPersistStreamInit::Load.</summary>
/// <returns>
/// <para>This method can return the standard return valuesE_OUTOFMEMORY and E_UNEXPECTED, as well as the following values. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>If the object has already been initialized with <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ipersiststreaminit-load">IPersistStreamInit::Load</a>, then this method must return E_UNEXPECTED.</remarks>
public winmdroot.Foundation.HRESULT InitNew()
{
return ((delegate *unmanaged [Stdcall]<IPersistStreamInit*,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IPersistStreamInit*)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]<IPersistStreamInit*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;
internal delegate *unmanaged [Stdcall]<IPersistStreamInit*,uint> AddRef_2;
internal delegate *unmanaged [Stdcall]<IPersistStreamInit*,uint> Release_3;
internal delegate *unmanaged [Stdcall]<IPersistStreamInit*,global::System.Guid* ,winmdroot.Foundation.HRESULT> GetClassID_4;
internal delegate *unmanaged [Stdcall]<IPersistStreamInit*,winmdroot.Foundation.HRESULT> IsDirty_5;
internal delegate *unmanaged [Stdcall]<IPersistStreamInit*,winmdroot.System.Com.IStream* ,winmdroot.Foundation.HRESULT> Load_6;
internal delegate *unmanaged [Stdcall]<IPersistStreamInit*,winmdroot.System.Com.IStream* ,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> Save_7;
internal delegate *unmanaged [Stdcall]<IPersistStreamInit*,ulong* ,winmdroot.Foundation.HRESULT> GetSizeMax_8;
internal delegate *unmanaged [Stdcall]<IPersistStreamInit*,winmdroot.Foundation.HRESULT> InitNew_9;
}
public static void PopulateVTable(Vtbl* vtable)
{
vtable->GetClassID_4 = &GetClassID;
vtable->IsDirty_5 = &IsDirty;
vtable->Load_6 = &Load;
vtable->Save_7 = &Save;
vtable->GetSizeMax_8 = &GetSizeMax;
vtable->InitNew_9 = &InitNew;
}
private void** lpVtbl;
/// <summary>The IID guid for this interface.</summary>
/// <value>{7fd52380-4e07-101b-ae2d-08002b2ec713}</value>
internal static readonly Guid IID_Guid = new Guid(0x7FD52380, 0x4E07, 0x101B, 0xAE, 0x2D, 0x08, 0x00, 0x2B, 0x2E, 0xC7, 0x13);
static ref readonly Guid IComIID.Guid {
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[] {
0x80,0x23,0xD5,0x7F,0x07,0x4E,0x1B,0x10,0xAE,0x2D,0x08,0x00,0x2B,0x2E,0xC7,0x13 };
return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
}
}
[Guid("7FD52380-4E07-101B-AE2D-08002B2EC713"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
[SupportedOSPlatform("windows5.0")]
internal interface Interface
:winmdroot.System.Com.IPersist.Interface {
[PreserveSig()]
unsafe new winmdroot.Foundation.HRESULT GetClassID(global::System.Guid* pClassID);
[PreserveSig()]
winmdroot.Foundation.HRESULT IsDirty();
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Load(winmdroot.System.Com.IStream* pStm);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Save(winmdroot.System.Com.IStream* pStm, winmdroot.Foundation.BOOL fClearDirty);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetSizeMax(ulong* pCbSize);
[PreserveSig()]
winmdroot.Foundation.HRESULT InitNew();
}
}
}
}
|