#![allow(
non_snake_case,
clippy::too_many_arguments,
clippy::missing_safety_doc,
dead_code
)]
use core::ffi::c_void;
pub unsafe trait LifetimeOwner12Methods: 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 LifetimeStateUpdated(&self, a0: windows::Win32::Graphics::Direct3D12::D3D12_LIFETIME_STATE) {
unsafe { real::LifetimeStateUpdated(self.inner(), a0) }
}
}
pub mod real {
use core::ffi::c_void;
pub unsafe fn LifetimeStateUpdated(
inner: *mut c_void,
a0: windows::Win32::Graphics::Direct3D12::D3D12_LIFETIME_STATE,
) {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Direct3D12::ID3D12LifetimeOwner_Vtbl)))
.LifetimeStateUpdated)(inner, a0)
}
}
}
unsafe extern "system" fn QueryInterface<T: LifetimeOwner12Methods>(
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: LifetimeOwner12Methods>(this: *mut c_void) -> u32 {
unsafe { (*(this as *const T)).AddRef() }
}
unsafe extern "system" fn Release<T: LifetimeOwner12Methods>(this: *mut c_void) -> u32 {
unsafe { (*(this as *const T)).Release() }
}
unsafe extern "system" fn LifetimeStateUpdated<T: LifetimeOwner12Methods>(
this: *mut c_void,
a0: windows::Win32::Graphics::Direct3D12::D3D12_LIFETIME_STATE,
) {
unsafe { (*(this as *const T)).LifetimeStateUpdated(a0) }
}
#[allow(clippy::let_and_return)] unsafe impl LifetimeOwner12Methods 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 LifetimeStateUpdated(&self, a0: windows::Win32::Graphics::Direct3D12::D3D12_LIFETIME_STATE) {
unsafe {
real::LifetimeStateUpdated(self.real(), a0);
}
}
}
pub const fn vtable<T: LifetimeOwner12Methods>()
-> windows::Win32::Graphics::Direct3D12::ID3D12LifetimeOwner_Vtbl {
windows::Win32::Graphics::Direct3D12::ID3D12LifetimeOwner_Vtbl {
base__: windows::core::IUnknown_Vtbl {
QueryInterface: QueryInterface::<T>,
AddRef: AddRef::<T>,
Release: Release::<T>,
},
LifetimeStateUpdated: LifetimeStateUpdated::<T>,
}
}