#![allow(
non_snake_case,
clippy::too_many_arguments,
clippy::missing_safety_doc,
dead_code
)]
use core::ffi::c_void;
pub unsafe trait Guest12Methods: Sized {
fn inner(&self) -> *mut c_void;
unsafe fn QueryInterface(
&self,
iid: *const windows::core::GUID,
out: *mut *mut c_void,
) -> windows::core::HRESULT;
unsafe fn AddRef(&self) -> u32;
unsafe fn Release(&self) -> u32;
unsafe fn ShareWithHost(
&self,
a0: *mut core::ffi::c_void,
a1: *mut windows::Win32::Foundation::HANDLE,
) -> windows::core::HRESULT {
unsafe { real::ShareWithHost(self.inner(), a0, a1) }
}
unsafe fn CreateFenceFd(
&self,
a0: *mut core::ffi::c_void,
a1: u64,
a2: *mut i32,
) -> windows::core::HRESULT {
unsafe { real::CreateFenceFd(self.inner(), a0, a1, a2) }
}
}
pub mod real {
use core::ffi::c_void;
pub unsafe fn ShareWithHost(
inner: *mut c_void,
a0: *mut core::ffi::c_void,
a1: *mut windows::Win32::Foundation::HANDLE,
) -> windows::core::HRESULT {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Direct3D12::ID3D12VirtualizationGuestDevice_Vtbl))).ShareWithHost)(inner, a0, a1)
}
}
pub unsafe fn CreateFenceFd(
inner: *mut c_void,
a0: *mut core::ffi::c_void,
a1: u64,
a2: *mut i32,
) -> windows::core::HRESULT {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Direct3D12::ID3D12VirtualizationGuestDevice_Vtbl))).CreateFenceFd)(inner, a0, a1, a2)
}
}
}
unsafe extern "system" fn QueryInterface<T: Guest12Methods>(
this: *mut c_void,
iid: *const windows::core::GUID,
out: *mut *mut c_void,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).QueryInterface(iid, out) }
}
unsafe extern "system" fn AddRef<T: Guest12Methods>(this: *mut c_void) -> u32 {
unsafe { (*(this as *const T)).AddRef() }
}
unsafe extern "system" fn Release<T: Guest12Methods>(this: *mut c_void) -> u32 {
unsafe { (*(this as *const T)).Release() }
}
unsafe extern "system" fn ShareWithHost<T: Guest12Methods>(
this: *mut c_void,
a0: *mut core::ffi::c_void,
a1: *mut windows::Win32::Foundation::HANDLE,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).ShareWithHost(a0, a1) }
}
unsafe extern "system" fn CreateFenceFd<T: Guest12Methods>(
this: *mut c_void,
a0: *mut core::ffi::c_void,
a1: u64,
a2: *mut i32,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).CreateFenceFd(a0, a1, a2) }
}
#[allow(clippy::let_and_return)] unsafe impl Guest12Methods for crate::d3d12::Object {
fn inner(&self) -> *mut c_void {
self.real()
}
unsafe fn QueryInterface(
&self,
iid: *const windows::core::GUID,
out: *mut *mut c_void,
) -> windows::core::HRESULT {
unsafe { self.query(iid, out) }
}
unsafe fn AddRef(&self) -> u32 {
self.add_ref()
}
unsafe fn Release(&self) -> u32 {
unsafe { self.release() }
}
unsafe fn ShareWithHost(
&self,
a0: *mut core::ffi::c_void,
a1: *mut windows::Win32::Foundation::HANDLE,
) -> windows::core::HRESULT {
unsafe {
let result = real::ShareWithHost(self.real(), crate::d3d12::unwrap(a0), a1);
result
}
}
unsafe fn CreateFenceFd(
&self,
a0: *mut core::ffi::c_void,
a1: u64,
a2: *mut i32,
) -> windows::core::HRESULT {
unsafe {
let result = real::CreateFenceFd(self.real(), crate::d3d12::unwrap(a0), a1, a2);
result
}
}
}
pub const fn vtable<T: Guest12Methods>()
-> windows::Win32::Graphics::Direct3D12::ID3D12VirtualizationGuestDevice_Vtbl {
windows::Win32::Graphics::Direct3D12::ID3D12VirtualizationGuestDevice_Vtbl {
base__: windows::core::IUnknown_Vtbl {
QueryInterface: QueryInterface::<T>,
AddRef: AddRef::<T>,
Release: Release::<T>,
},
ShareWithHost: ShareWithHost::<T>,
CreateFenceFd: CreateFenceFd::<T>,
}
}