// ------------------------------------------------------------------------------
// <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>
// ------------------------------------------------------------------------------

namespace Win32.Graphics.Imaging;

/// <include file='../Imaging.xml' path='doc/member[@name="IWICStream"]/*' />
/// <unmanaged>IWICStream</unmanaged>
[Guid("135ff860-22b7-4ddf-b0f6-218f4f299a43")]
[NativeTypeName("struct IWICStream : IStream")]
[NativeInheritance("IStream")]
public unsafe partial struct IWICStream : IWICStream.Interface, INativeGuid
{
	public static ref readonly Guid IID_IWICStream
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		get
		{
			ReadOnlySpan<byte> data = new byte[] {
				0x60, 0xF8, 0x5F, 0x13,
				0xB7, 0x22,
				0xDF, 0x4D,
				0xB0,
				0xF6,
				0x21,
				0x8F,
				0x4F,
				0x29,
				0x9A,
				0x43
			};

			Debug.Assert(data.Length == Unsafe.SizeOf<Guid>());
			return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
		}
	}

	static Guid* INativeGuid.NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IWICStream));

	public void** lpVtbl;

	/// <inheritdoc cref="IUnknown.QueryInterface" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(0)]
	public HResult QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject)
	{
		return ((delegate* unmanaged[MemberFunction]<IWICStream*, Guid*, void**, int>)(lpVtbl[0]))((IWICStream*)Unsafe.AsPointer(ref this), riid, ppvObject);
	}

	/// <inheritdoc cref="IUnknown.AddRef" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(1)]
	[return: NativeTypeName("ULONG")]
	public uint AddRef()
	{
		return ((delegate* unmanaged[MemberFunction]<IWICStream*, uint>)(lpVtbl[1]))((IWICStream*)Unsafe.AsPointer(ref this));
	}

	/// <inheritdoc cref="IUnknown.Release" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(2)]
	[return: NativeTypeName("ULONG")]
	public uint Release()
	{
		return ((delegate* unmanaged[MemberFunction]<IWICStream*, uint>)(lpVtbl[2]))((IWICStream*)Unsafe.AsPointer(ref this));
	}

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICStream::InitializeFromIStream"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(14)]
	public HResult InitializeFromIStream(Com.IStream* pIStream)
	{
		return ((delegate* unmanaged[MemberFunction]<IWICStream*, Com.IStream*, int>)(lpVtbl[14]))((IWICStream*)Unsafe.AsPointer(ref this), pIStream);
	}

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICStream::InitializeFromFilename"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(15)]
	public HResult InitializeFromFilename(char* wzFileName, uint dwDesiredAccess)
	{
		return ((delegate* unmanaged[MemberFunction]<IWICStream*, char*, uint, int>)(lpVtbl[15]))((IWICStream*)Unsafe.AsPointer(ref this), wzFileName, dwDesiredAccess);
	}

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICStream::InitializeFromMemory"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(16)]
	public HResult InitializeFromMemory(byte* pbBuffer, uint cbBufferSize)
	{
		return ((delegate* unmanaged[MemberFunction]<IWICStream*, byte*, uint, int>)(lpVtbl[16]))((IWICStream*)Unsafe.AsPointer(ref this), pbBuffer, cbBufferSize);
	}

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICStream::InitializeFromIStreamRegion"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(17)]
	public HResult InitializeFromIStreamRegion(Com.IStream* pIStream, ulong ulOffset, ulong ulMaxSize)
	{
		return ((delegate* unmanaged[MemberFunction]<IWICStream*, Com.IStream*, ulong, ulong, int>)(lpVtbl[17]))((IWICStream*)Unsafe.AsPointer(ref this), pIStream, ulOffset, ulMaxSize);
	}

	public interface Interface : Win32.Com.IStream.Interface
	{
		[VtblIndex(14)]
		HResult InitializeFromIStream(Com.IStream* pIStream);

		[VtblIndex(15)]
		HResult InitializeFromFilename(char* wzFileName, uint dwDesiredAccess);

		[VtblIndex(16)]
		HResult InitializeFromMemory(byte* pbBuffer, uint cbBufferSize);

		[VtblIndex(17)]
		HResult InitializeFromIStreamRegion(Com.IStream* pIStream, ulong ulOffset, ulong ulMaxSize);
	}
}

