// ------------------------------------------------------------------------------
// <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="IWICStreamProvider"]/*' />
/// <unmanaged>IWICStreamProvider</unmanaged>
[Guid("449494bc-b468-4927-96d7-ba90d31ab505")]
[NativeTypeName("struct IWICStreamProvider : IUnknown")]
[NativeInheritance("IUnknown")]
public unsafe partial struct IWICStreamProvider : IWICStreamProvider.Interface, INativeGuid
{
	public static ref readonly Guid IID_IWICStreamProvider
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		get
		{
			ReadOnlySpan<byte> data = new byte[] {
				0xBC, 0x94, 0x94, 0x44,
				0x68, 0xB4,
				0x27, 0x49,
				0x96,
				0xD7,
				0xBA,
				0x90,
				0xD3,
				0x1A,
				0xB5,
				0x05
			};

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

#if NET6_0_OR_GREATER
	static Guid* INativeGuid.NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IWICStreamProvider));
#else
	public static Guid* NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IWICStreamProvider));
#endif

	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[Stdcall]<IWICStreamProvider*, Guid*, void**, int>)(lpVtbl[0]))((IWICStreamProvider*)Unsafe.AsPointer(ref this), riid, ppvObject);
	}

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

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

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

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICStreamProvider::GetPersistOptions"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(4)]
	public HResult GetPersistOptions(uint* pdwPersistOptions)
	{
		return ((delegate* unmanaged[Stdcall]<IWICStreamProvider*, uint*, int>)(lpVtbl[4]))((IWICStreamProvider*)Unsafe.AsPointer(ref this), pdwPersistOptions);
	}

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICStreamProvider::GetPreferredVendorGUID"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(5)]
	public HResult GetPreferredVendorGUID(Guid* pguidPreferredVendor)
	{
		return ((delegate* unmanaged[Stdcall]<IWICStreamProvider*, Guid*, int>)(lpVtbl[5]))((IWICStreamProvider*)Unsafe.AsPointer(ref this), pguidPreferredVendor);
	}

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICStreamProvider::RefreshStream"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(6)]
	public HResult RefreshStream()
	{
		return ((delegate* unmanaged[Stdcall]<IWICStreamProvider*, int>)(lpVtbl[6]))((IWICStreamProvider*)Unsafe.AsPointer(ref this));
	}
	public interface Interface : IUnknown.Interface
	{
		[VtblIndex(3)]
		HResult GetStream(Com.IStream** ppIStream);

		[VtblIndex(4)]
		HResult GetPersistOptions(uint* pdwPersistOptions);

		[VtblIndex(5)]
		HResult GetPreferredVendorGUID(Guid* pguidPreferredVendor);

		[VtblIndex(6)]
		HResult RefreshStream();
	}
}

