// ------------------------------------------------------------------------------
// <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.Direct3D12;

/// <include file='../Direct3D12.xml' path='doc/member[@name="ID3D12VirtualizationGuestDevice"]/*' />
/// <unmanaged>ID3D12VirtualizationGuestDevice</unmanaged>
[Guid("bc66d368-7373-4943-8757-fc87dc79e476")]
[NativeTypeName("struct ID3D12VirtualizationGuestDevice : IUnknown")]
[NativeInheritance("IUnknown")]
public unsafe partial struct ID3D12VirtualizationGuestDevice : ID3D12VirtualizationGuestDevice.Interface, INativeGuid
{
	public static ref readonly Guid IID_ID3D12VirtualizationGuestDevice
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		get
		{
			ReadOnlySpan<byte> data = new byte[] {
				0x68, 0xD3, 0x66, 0xBC,
				0x73, 0x73,
				0x43, 0x49,
				0x87,
				0x57,
				0xFC,
				0x87,
				0xDC,
				0x79,
				0xE4,
				0x76
			};

			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_ID3D12VirtualizationGuestDevice));

	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]<ID3D12VirtualizationGuestDevice*, Guid*, void**, int>)(lpVtbl[0]))((ID3D12VirtualizationGuestDevice*)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]<ID3D12VirtualizationGuestDevice*, uint>)(lpVtbl[1]))((ID3D12VirtualizationGuestDevice*)Unsafe.AsPointer(ref this));
	}

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

	/// <include file='../Direct3D12.xml' path='doc/member[@name="ID3D12VirtualizationGuestDevice::ShareWithHost"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(3)]
	public HResult ShareWithHost(ID3D12DeviceChild* pObject, Handle* pHandle)
	{
		return ((delegate* unmanaged[MemberFunction]<ID3D12VirtualizationGuestDevice*, ID3D12DeviceChild*, Handle*, int>)(lpVtbl[3]))((ID3D12VirtualizationGuestDevice*)Unsafe.AsPointer(ref this), pObject, pHandle);
	}

	/// <include file='../Direct3D12.xml' path='doc/member[@name="ID3D12VirtualizationGuestDevice::CreateFenceFd"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(4)]
	public HResult CreateFenceFd(ID3D12Fence* pFence, ulong FenceValue, int* pFenceFd)
	{
		return ((delegate* unmanaged[MemberFunction]<ID3D12VirtualizationGuestDevice*, ID3D12Fence*, ulong, int*, int>)(lpVtbl[4]))((ID3D12VirtualizationGuestDevice*)Unsafe.AsPointer(ref this), pFence, FenceValue, pFenceFd);
	}

	public interface Interface : IUnknown.Interface
	{
		[VtblIndex(3)]
		HResult ShareWithHost(ID3D12DeviceChild* pObject, Handle* pHandle);

		[VtblIndex(4)]
		HResult CreateFenceFd(ID3D12Fence* pFence, ulong FenceValue, int* pFenceFd);
	}
}

