|
// ------------------------------------------------------------------------------
// <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("0C733A30-2A1C-11CE-ADE5-00AA0044773D")]
[SupportedOSPlatform("windows5.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal unsafe partial struct ISequentialStream
:IVTable<ISequentialStream,ISequentialStream.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]<ISequentialStream*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((ISequentialStream*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
public uint AddRef()
{
return ((delegate *unmanaged [Stdcall]<ISequentialStream*,uint>)lpVtbl[1])((ISequentialStream*)Unsafe.AsPointer(ref this));
}
public uint Release()
{
return ((delegate *unmanaged [Stdcall]<ISequentialStream*,uint>)lpVtbl[2])((ISequentialStream*)Unsafe.AsPointer(ref this));
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Read(ISequentialStream* pThis, void* pv, uint cb, [Optional] uint* pcbRead)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Read(pv, cb, pcbRead);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Reads a specified number of bytes from the stream object into memory, starting at the current seek pointer.</summary>
/// <param name="pv">A pointer to the buffer which the stream data is read into.</param>
/// <param name="cb">The number of bytes of data to read from the stream object.</param>
/// <param name="pcbRead">
/// <para>A pointer to a <b>ULONG</b> variable that receives the actual number of bytes read from the stream object. <div class="alert"><b>Note</b> The number of bytes read may be zero.</div> <div> </div></para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-isequentialstream-read#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | All of the requested data was successfully read from the stream object; the number of bytes requested in *cb* is the same as the number of bytes returned in *pcbRead*.| |S_FALSE | The value returned in *pcbRead* is less than the number of bytes requested in *cb*. This indicates the end of the stream has been reached. The number of bytes read indicates how much of the *pv* buffer has been filled.| |E_PENDING | Asynchronous storage only: Part or all of the data to be read is currently unavailable. | |STG_E_ACCESSDENIED | The caller does not have permissions required to read this stream object.| |STG_E_INVALIDPOINTER | One of the pointer values is invalid.| |STG_E_REVERTED | The object has been invalidated by a revert operation above it in the transaction tree.|</para>
/// </returns>
/// <remarks>
/// <para>This method reads bytes from this stream object into memory. The stream object must be opened in <b>STGM_READ</b> mode. This method adjusts the seek pointer by the actual number of bytes read. The number of bytes actually read is also returned in the <i>pcbRead</i> parameter. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> The actual number of bytes read can be less than the number of bytes requested if an error occurs or if the end of the stream is reached during the read operation. The number of bytes returned should always be compared to the number of bytes requested. If the number of bytes returned is less than the number of bytes requested, it usually means the <b>Read</b> method attempted to read past the end of the stream. The application should handle both a returned error and <b>S_OK</b> return values on end-of-stream read operations.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-isequentialstream-read#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT Read(void* pv, uint cb, [Optional] uint* pcbRead)
{
return ((delegate *unmanaged [Stdcall]<ISequentialStream*,void* ,uint ,uint* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((ISequentialStream*)Unsafe.AsPointer(ref this), pv, cb, pcbRead);
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Write(ISequentialStream* pThis, void* pv, uint cb, [Optional] uint* pcbWritten)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Write(pv, cb, pcbWritten);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Writes a specified number of bytes into the stream object starting at the current seek pointer.</summary>
/// <param name="pv">A pointer to the buffer that contains the data that is to be written to the stream. A valid pointer must be provided for this parameter even when <i>cb</i> is zero.</param>
/// <param name="cb">The number of bytes of data to attempt to write into the stream. This value can be zero.</param>
/// <param name="pcbWritten">A pointer to a <b>ULONG</b> variable where this method writes the actual number of bytes written to the stream object. The caller can set this pointer to <b>NULL</b>, in which case this method does not provide the actual number of bytes written.</param>
/// <returns>
/// <para>This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The data was successfully written to the stream object.| |E_PENDING | Asynchronous Storage only: Part or all of the data to be written is currently unavailable.| |STG_E_MEDIUMFULL | The write operation failed because there is no space left on the storage device.| |STG_E_ACCESSDENIED | The caller does not have the required permissions for writing to this stream object.| |STG_E_CANTSAVE | Data cannot be written for reasons other than improper access or insufficient space.| |STG_E_INVALIDPOINTER | One of the pointer values is not valid. The *pv* parameter must contain a valid pointer even if *cb* is zero.| |STG_E_REVERTED | The object has been invalidated by a revert operation above it in the transaction tree.| |STG_E_WRITEFAULT | The write operation failed due to a disk error. This value is also returned when this method attempts to write to a stream that was opened in simple mode (using the STGM_SIMPLE flag).|</para>
/// </returns>
/// <remarks>
/// <para><b>ISequentialStream::Write</b> writes the specified data to a stream object. The seek pointer is adjusted for the number of bytes actually written. The number of bytes actually written is returned in the <i>pcbWritten</i> parameter. If the byte count is zero bytes, the write operation has no effect. If the seek pointer is currently past the end of the stream and the byte count is nonzero, this method increases the size of the stream to the seek pointer and writes the specified bytes starting at the seek pointer. The fill bytes written to the stream are not initialized to any particular value. This is the same as the end-of-file behavior in the MS-DOS FAT file system. With a zero byte count and a seek pointer past the end of the stream, this method does not create the fill bytes to increase the stream to the seek pointer. In this case, you must call the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-istream-setsize">IStream::SetSize</a> method to increase the size of the stream and write the fill bytes. The <i>pcbWritten</i> parameter can have a value even if an error occurs. In the COM-provided implementation, stream objects are not sparse. Any fill bytes are eventually allocated on the disk and assigned to the stream.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-isequentialstream-write#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT Write(void* pv, uint cb, [Optional] uint* pcbWritten)
{
return ((delegate *unmanaged [Stdcall]<ISequentialStream*,void* ,uint ,uint* ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((ISequentialStream*)Unsafe.AsPointer(ref this), pv, cb, pcbWritten);
}
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]<ISequentialStream*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;
internal delegate *unmanaged [Stdcall]<ISequentialStream*,uint> AddRef_2;
internal delegate *unmanaged [Stdcall]<ISequentialStream*,uint> Release_3;
internal delegate *unmanaged [Stdcall]<ISequentialStream*,void* ,uint ,uint* ,winmdroot.Foundation.HRESULT> Read_4;
internal delegate *unmanaged [Stdcall]<ISequentialStream*,void* ,uint ,uint* ,winmdroot.Foundation.HRESULT> Write_5;
}
public static void PopulateVTable(Vtbl* vtable)
{
vtable->Read_4 = &Read;
vtable->Write_5 = &Write;
}
private void** lpVtbl;
/// <summary>The IID guid for this interface.</summary>
/// <value>{0c733a30-2a1c-11ce-ade5-00aa0044773d}</value>
internal static readonly Guid IID_Guid = new Guid(0x0C733A30, 0x2A1C, 0x11CE, 0xAD, 0xE5, 0x00, 0xAA, 0x00, 0x44, 0x77, 0x3D);
static ref readonly Guid IComIID.Guid {
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[] {
0x30,0x3A,0x73,0x0C,0x1C,0x2A,0xCE,0x11,0xAD,0xE5,0x00,0xAA,0x00,0x44,0x77,0x3D };
return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
}
}
[Guid("0C733A30-2A1C-11CE-ADE5-00AA0044773D"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
[SupportedOSPlatform("windows5.0")]
internal interface Interface
{
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Read(void* pv, uint cb, [Optional] uint* pcbRead);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Write(void* pv, uint cb, [Optional] uint* pcbWritten);
}
}
}
}
|