// ------------------------------------------------------------------------------
// <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.Media.Audio.XAudio2;

/// <include file='../XAudio2.xml' path='doc/member[@name="IXAudio2Extension"]/*' />
/// <unmanaged>IXAudio2Extension</unmanaged>
[Guid("84ac29bb-d619-44d2-b197-e4acf7df3ed6")]
[NativeTypeName("struct IXAudio2Extension : IUnknown")]
[NativeInheritance("IUnknown")]
public unsafe partial struct IXAudio2Extension : IXAudio2Extension.Interface, INativeGuid
{
	public static ref readonly Guid IID_IXAudio2Extension
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		get
		{
			ReadOnlySpan<byte> data = new byte[] {
				0xBB, 0x29, 0xAC, 0x84,
				0x19, 0xD6,
				0xD2, 0x44,
				0xB1,
				0x97,
				0xE4,
				0xAC,
				0xF7,
				0xDF,
				0x3E,
				0xD6
			};

			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_IXAudio2Extension));
#else
	public static Guid* NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IXAudio2Extension));
#endif

	public void** lpVtbl;

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

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

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

	/// <include file='../XAudio2.xml' path='doc/member[@name="IXAudio2Extension::GetProcessingQuantum"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(3)]
	public void GetProcessingQuantum(uint* quantumNumerator, uint* quantumDenominator)
	{
#if NET6_0_OR_GREATER
		((delegate* unmanaged<IXAudio2Extension*, uint*, uint*, void>)(lpVtbl[3]))((IXAudio2Extension*)Unsafe.AsPointer(ref this), quantumNumerator, quantumDenominator);
#else
		((delegate* unmanaged[Stdcall]<IXAudio2Extension*, uint*, uint*, void>)(lpVtbl[3]))((IXAudio2Extension*)Unsafe.AsPointer(ref this), quantumNumerator, quantumDenominator);
#endif
	}

	/// <include file='../XAudio2.xml' path='doc/member[@name="IXAudio2Extension::GetProcessor"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(4)]
	public void GetProcessor(uint* processor)
	{
#if NET6_0_OR_GREATER
		((delegate* unmanaged<IXAudio2Extension*, uint*, void>)(lpVtbl[4]))((IXAudio2Extension*)Unsafe.AsPointer(ref this), processor);
#else
		((delegate* unmanaged[Stdcall]<IXAudio2Extension*, uint*, void>)(lpVtbl[4]))((IXAudio2Extension*)Unsafe.AsPointer(ref this), processor);
#endif
	}

	public interface Interface : IUnknown.Interface
	{
		[VtblIndex(3)]
		void GetProcessingQuantum(uint* quantumNumerator, uint* quantumDenominator);

		[VtblIndex(4)]
		void GetProcessor(uint* processor);
	}
}

