#![allow(
non_snake_case,
clippy::too_many_arguments,
clippy::missing_safety_doc,
dead_code
)]
use core::ffi::c_void;
pub unsafe trait AdapterMethods: 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 SetPrivateData(
&self,
a0: *const windows::core::GUID,
a1: u32,
a2: *const core::ffi::c_void,
) -> windows::core::HRESULT {
unsafe { real::SetPrivateData(self.inner(), a0, a1, a2) }
}
unsafe fn SetPrivateDataInterface(
&self,
a0: *const windows::core::GUID,
a1: *mut core::ffi::c_void,
) -> windows::core::HRESULT {
unsafe { real::SetPrivateDataInterface(self.inner(), a0, a1) }
}
unsafe fn GetPrivateData(
&self,
a0: *const windows::core::GUID,
a1: *mut u32,
a2: *mut core::ffi::c_void,
) -> windows::core::HRESULT {
unsafe { real::GetPrivateData(self.inner(), a0, a1, a2) }
}
unsafe fn GetParent(
&self,
a0: *const windows::core::GUID,
a1: *mut *mut core::ffi::c_void,
) -> windows::core::HRESULT {
unsafe { real::GetParent(self.inner(), a0, a1) }
}
unsafe fn EnumOutputs(&self, a0: u32, a1: *mut *mut core::ffi::c_void) -> windows::core::HRESULT {
unsafe { real::EnumOutputs(self.inner(), a0, a1) }
}
unsafe fn GetDesc(
&self,
a0: *mut windows::Win32::Graphics::Dxgi::DXGI_ADAPTER_DESC,
) -> windows::core::HRESULT {
unsafe { real::GetDesc(self.inner(), a0) }
}
unsafe fn CheckInterfaceSupport(
&self,
a0: *const windows::core::GUID,
a1: *mut i64,
) -> windows::core::HRESULT {
unsafe { real::CheckInterfaceSupport(self.inner(), a0, a1) }
}
unsafe fn GetDesc1(
&self,
a0: *mut windows::Win32::Graphics::Dxgi::DXGI_ADAPTER_DESC1,
) -> windows::core::HRESULT {
unsafe { real::GetDesc1(self.inner(), a0) }
}
unsafe fn GetDesc2(
&self,
a0: *mut windows::Win32::Graphics::Dxgi::DXGI_ADAPTER_DESC2,
) -> windows::core::HRESULT {
unsafe { real::GetDesc2(self.inner(), a0) }
}
unsafe fn RegisterHardwareContentProtectionTeardownStatusEvent(
&self,
a0: windows::Win32::Foundation::HANDLE,
a1: *mut u32,
) -> windows::core::HRESULT {
unsafe { real::RegisterHardwareContentProtectionTeardownStatusEvent(self.inner(), a0, a1) }
}
unsafe fn UnregisterHardwareContentProtectionTeardownStatus(&self, a0: u32) {
unsafe { real::UnregisterHardwareContentProtectionTeardownStatus(self.inner(), a0) }
}
unsafe fn QueryVideoMemoryInfo(
&self,
a0: u32,
a1: windows::Win32::Graphics::Dxgi::DXGI_MEMORY_SEGMENT_GROUP,
a2: *mut windows::Win32::Graphics::Dxgi::DXGI_QUERY_VIDEO_MEMORY_INFO,
) -> windows::core::HRESULT {
unsafe { real::QueryVideoMemoryInfo(self.inner(), a0, a1, a2) }
}
unsafe fn SetVideoMemoryReservation(
&self,
a0: u32,
a1: windows::Win32::Graphics::Dxgi::DXGI_MEMORY_SEGMENT_GROUP,
a2: u64,
) -> windows::core::HRESULT {
unsafe { real::SetVideoMemoryReservation(self.inner(), a0, a1, a2) }
}
unsafe fn RegisterVideoMemoryBudgetChangeNotificationEvent(
&self,
a0: windows::Win32::Foundation::HANDLE,
a1: *mut u32,
) -> windows::core::HRESULT {
unsafe { real::RegisterVideoMemoryBudgetChangeNotificationEvent(self.inner(), a0, a1) }
}
unsafe fn UnregisterVideoMemoryBudgetChangeNotification(&self, a0: u32) {
unsafe { real::UnregisterVideoMemoryBudgetChangeNotification(self.inner(), a0) }
}
unsafe fn GetDesc3(
&self,
a0: *mut windows::Win32::Graphics::Dxgi::DXGI_ADAPTER_DESC3,
) -> windows::core::HRESULT {
unsafe { real::GetDesc3(self.inner(), a0) }
}
}
pub mod real {
use core::ffi::c_void;
pub unsafe fn SetPrivateData(
inner: *mut c_void,
a0: *const windows::core::GUID,
a1: u32,
a2: *const core::ffi::c_void,
) -> windows::core::HRESULT {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl)))
.base__
.base__
.base__
.base__
.base__
.SetPrivateData)(inner, a0, a1, a2)
}
}
pub unsafe fn SetPrivateDataInterface(
inner: *mut c_void,
a0: *const windows::core::GUID,
a1: *mut core::ffi::c_void,
) -> windows::core::HRESULT {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl)))
.base__
.base__
.base__
.base__
.base__
.SetPrivateDataInterface)(inner, a0, a1)
}
}
pub unsafe fn GetPrivateData(
inner: *mut c_void,
a0: *const windows::core::GUID,
a1: *mut u32,
a2: *mut core::ffi::c_void,
) -> windows::core::HRESULT {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl)))
.base__
.base__
.base__
.base__
.base__
.GetPrivateData)(inner, a0, a1, a2)
}
}
pub unsafe fn GetParent(
inner: *mut c_void,
a0: *const windows::core::GUID,
a1: *mut *mut core::ffi::c_void,
) -> windows::core::HRESULT {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl)))
.base__
.base__
.base__
.base__
.base__
.GetParent)(inner, a0, a1)
}
}
pub unsafe fn EnumOutputs(
inner: *mut c_void,
a0: u32,
a1: *mut *mut core::ffi::c_void,
) -> windows::core::HRESULT {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl)))
.base__
.base__
.base__
.base__
.EnumOutputs)(inner, a0, a1)
}
}
pub unsafe fn GetDesc(
inner: *mut c_void,
a0: *mut windows::Win32::Graphics::Dxgi::DXGI_ADAPTER_DESC,
) -> windows::core::HRESULT {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl)))
.base__
.base__
.base__
.base__
.GetDesc)(inner, a0)
}
}
pub unsafe fn CheckInterfaceSupport(
inner: *mut c_void,
a0: *const windows::core::GUID,
a1: *mut i64,
) -> windows::core::HRESULT {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl)))
.base__
.base__
.base__
.base__
.CheckInterfaceSupport)(inner, a0, a1)
}
}
pub unsafe fn GetDesc1(
inner: *mut c_void,
a0: *mut windows::Win32::Graphics::Dxgi::DXGI_ADAPTER_DESC1,
) -> windows::core::HRESULT {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl)))
.base__
.base__
.base__
.GetDesc1)(inner, a0)
}
}
pub unsafe fn GetDesc2(
inner: *mut c_void,
a0: *mut windows::Win32::Graphics::Dxgi::DXGI_ADAPTER_DESC2,
) -> windows::core::HRESULT {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl)))
.base__
.base__
.GetDesc2)(inner, a0)
}
}
pub unsafe fn RegisterHardwareContentProtectionTeardownStatusEvent(
inner: *mut c_void,
a0: windows::Win32::Foundation::HANDLE,
a1: *mut u32,
) -> windows::core::HRESULT {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl)))
.base__
.RegisterHardwareContentProtectionTeardownStatusEvent)(inner, a0, a1)
}
}
pub unsafe fn UnregisterHardwareContentProtectionTeardownStatus(inner: *mut c_void, a0: u32) {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl)))
.base__
.UnregisterHardwareContentProtectionTeardownStatus)(inner, a0)
}
}
pub unsafe fn QueryVideoMemoryInfo(
inner: *mut c_void,
a0: u32,
a1: windows::Win32::Graphics::Dxgi::DXGI_MEMORY_SEGMENT_GROUP,
a2: *mut windows::Win32::Graphics::Dxgi::DXGI_QUERY_VIDEO_MEMORY_INFO,
) -> windows::core::HRESULT {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl)))
.base__
.QueryVideoMemoryInfo)(inner, a0, a1, a2)
}
}
pub unsafe fn SetVideoMemoryReservation(
inner: *mut c_void,
a0: u32,
a1: windows::Win32::Graphics::Dxgi::DXGI_MEMORY_SEGMENT_GROUP,
a2: u64,
) -> windows::core::HRESULT {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl)))
.base__
.SetVideoMemoryReservation)(inner, a0, a1, a2)
}
}
pub unsafe fn RegisterVideoMemoryBudgetChangeNotificationEvent(
inner: *mut c_void,
a0: windows::Win32::Foundation::HANDLE,
a1: *mut u32,
) -> windows::core::HRESULT {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl)))
.base__
.RegisterVideoMemoryBudgetChangeNotificationEvent)(inner, a0, a1)
}
}
pub unsafe fn UnregisterVideoMemoryBudgetChangeNotification(inner: *mut c_void, a0: u32) {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl)))
.base__
.UnregisterVideoMemoryBudgetChangeNotification)(inner, a0)
}
}
pub unsafe fn GetDesc3(
inner: *mut c_void,
a0: *mut windows::Win32::Graphics::Dxgi::DXGI_ADAPTER_DESC3,
) -> windows::core::HRESULT {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl))).GetDesc3)(
inner, a0,
)
}
}
}
unsafe extern "system" fn QueryInterface<T: AdapterMethods>(
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: AdapterMethods>(this: *mut c_void) -> u32 {
unsafe { (*(this as *const T)).AddRef() }
}
unsafe extern "system" fn Release<T: AdapterMethods>(this: *mut c_void) -> u32 {
unsafe { (*(this as *const T)).Release() }
}
unsafe extern "system" fn SetPrivateData<T: AdapterMethods>(
this: *mut c_void,
a0: *const windows::core::GUID,
a1: u32,
a2: *const core::ffi::c_void,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).SetPrivateData(a0, a1, a2) }
}
unsafe extern "system" fn SetPrivateDataInterface<T: AdapterMethods>(
this: *mut c_void,
a0: *const windows::core::GUID,
a1: *mut core::ffi::c_void,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).SetPrivateDataInterface(a0, a1) }
}
unsafe extern "system" fn GetPrivateData<T: AdapterMethods>(
this: *mut c_void,
a0: *const windows::core::GUID,
a1: *mut u32,
a2: *mut core::ffi::c_void,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).GetPrivateData(a0, a1, a2) }
}
unsafe extern "system" fn GetParent<T: AdapterMethods>(
this: *mut c_void,
a0: *const windows::core::GUID,
a1: *mut *mut core::ffi::c_void,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).GetParent(a0, a1) }
}
unsafe extern "system" fn EnumOutputs<T: AdapterMethods>(
this: *mut c_void,
a0: u32,
a1: *mut *mut core::ffi::c_void,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).EnumOutputs(a0, a1) }
}
unsafe extern "system" fn GetDesc<T: AdapterMethods>(
this: *mut c_void,
a0: *mut windows::Win32::Graphics::Dxgi::DXGI_ADAPTER_DESC,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).GetDesc(a0) }
}
unsafe extern "system" fn CheckInterfaceSupport<T: AdapterMethods>(
this: *mut c_void,
a0: *const windows::core::GUID,
a1: *mut i64,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).CheckInterfaceSupport(a0, a1) }
}
unsafe extern "system" fn GetDesc1<T: AdapterMethods>(
this: *mut c_void,
a0: *mut windows::Win32::Graphics::Dxgi::DXGI_ADAPTER_DESC1,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).GetDesc1(a0) }
}
unsafe extern "system" fn GetDesc2<T: AdapterMethods>(
this: *mut c_void,
a0: *mut windows::Win32::Graphics::Dxgi::DXGI_ADAPTER_DESC2,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).GetDesc2(a0) }
}
unsafe extern "system" fn RegisterHardwareContentProtectionTeardownStatusEvent<T: AdapterMethods>(
this: *mut c_void,
a0: windows::Win32::Foundation::HANDLE,
a1: *mut u32,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).RegisterHardwareContentProtectionTeardownStatusEvent(a0, a1) }
}
unsafe extern "system" fn UnregisterHardwareContentProtectionTeardownStatus<T: AdapterMethods>(
this: *mut c_void,
a0: u32,
) {
unsafe { (*(this as *const T)).UnregisterHardwareContentProtectionTeardownStatus(a0) }
}
unsafe extern "system" fn QueryVideoMemoryInfo<T: AdapterMethods>(
this: *mut c_void,
a0: u32,
a1: windows::Win32::Graphics::Dxgi::DXGI_MEMORY_SEGMENT_GROUP,
a2: *mut windows::Win32::Graphics::Dxgi::DXGI_QUERY_VIDEO_MEMORY_INFO,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).QueryVideoMemoryInfo(a0, a1, a2) }
}
unsafe extern "system" fn SetVideoMemoryReservation<T: AdapterMethods>(
this: *mut c_void,
a0: u32,
a1: windows::Win32::Graphics::Dxgi::DXGI_MEMORY_SEGMENT_GROUP,
a2: u64,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).SetVideoMemoryReservation(a0, a1, a2) }
}
unsafe extern "system" fn RegisterVideoMemoryBudgetChangeNotificationEvent<T: AdapterMethods>(
this: *mut c_void,
a0: windows::Win32::Foundation::HANDLE,
a1: *mut u32,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).RegisterVideoMemoryBudgetChangeNotificationEvent(a0, a1) }
}
unsafe extern "system" fn UnregisterVideoMemoryBudgetChangeNotification<T: AdapterMethods>(
this: *mut c_void,
a0: u32,
) {
unsafe { (*(this as *const T)).UnregisterVideoMemoryBudgetChangeNotification(a0) }
}
unsafe extern "system" fn GetDesc3<T: AdapterMethods>(
this: *mut c_void,
a0: *mut windows::Win32::Graphics::Dxgi::DXGI_ADAPTER_DESC3,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).GetDesc3(a0) }
}
pub const fn vtable<T: AdapterMethods>() -> windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl {
windows::Win32::Graphics::Dxgi::IDXGIAdapter4_Vtbl {
base__: windows::Win32::Graphics::Dxgi::IDXGIAdapter3_Vtbl {
base__: windows::Win32::Graphics::Dxgi::IDXGIAdapter2_Vtbl {
base__: windows::Win32::Graphics::Dxgi::IDXGIAdapter1_Vtbl {
base__: windows::Win32::Graphics::Dxgi::IDXGIAdapter_Vtbl {
base__: windows::Win32::Graphics::Dxgi::IDXGIObject_Vtbl {
base__: windows::core::IUnknown_Vtbl {
QueryInterface: QueryInterface::<T>,
AddRef: AddRef::<T>,
Release: Release::<T>,
},
SetPrivateData: SetPrivateData::<T>,
SetPrivateDataInterface: SetPrivateDataInterface::<T>,
GetPrivateData: GetPrivateData::<T>,
GetParent: GetParent::<T>,
},
EnumOutputs: EnumOutputs::<T>,
GetDesc: GetDesc::<T>,
CheckInterfaceSupport: CheckInterfaceSupport::<T>,
},
GetDesc1: GetDesc1::<T>,
},
GetDesc2: GetDesc2::<T>,
},
RegisterHardwareContentProtectionTeardownStatusEvent:
RegisterHardwareContentProtectionTeardownStatusEvent::<T>,
UnregisterHardwareContentProtectionTeardownStatus:
UnregisterHardwareContentProtectionTeardownStatus::<T>,
QueryVideoMemoryInfo: QueryVideoMemoryInfo::<T>,
SetVideoMemoryReservation: SetVideoMemoryReservation::<T>,
RegisterVideoMemoryBudgetChangeNotificationEvent:
RegisterVideoMemoryBudgetChangeNotificationEvent::<T>,
UnregisterVideoMemoryBudgetChangeNotification: UnregisterVideoMemoryBudgetChangeNotification::<T>,
},
GetDesc3: GetDesc3::<T>,
}
}