locum 0.1.4

Captures everything a Direct3D 11 game draws in a frame, to look at, query, change and replay: d3d11.dll and dxgi.dll beside the game that watch every call on its way to the real runtime.
Documentation
//! Generated by `cargo xtask gen` from the `windows` crate's `ID3D12GBVDiagnostics_Vtbl`; do not edit.

#![allow(
    non_snake_case,
    clippy::too_many_arguments,
    clippy::missing_safety_doc,
    dead_code
)]

use core::ffi::c_void;

/// Every method of `ID3D12GBVDiagnostics` in vtable order. The defaults forward to the wrapped object [`Gbv12Methods::inner`].
///
/// # Safety
/// The implementing type must be `#[repr(C)]` with a pointer to [`vtable`]'s table as its first field,
/// and `inner` must return a live `ID3D12GBVDiagnostics`.
pub unsafe trait Gbv12Methods: Sized {
    /// The wrapped object, an `ID3D12GBVDiagnostics`.
    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 GetGBVEntireSubresourceStatesData(
        &self,
        a0: *mut core::ffi::c_void,
        a1: *mut i32,
        a2: u32,
    ) -> windows::core::HRESULT {
        unsafe { real::GetGBVEntireSubresourceStatesData(self.inner(), a0, a1, a2) }
    }
    unsafe fn GetGBVSubresourceState(
        &self,
        a0: *mut core::ffi::c_void,
        a1: u32,
        a2: *mut i32,
    ) -> windows::core::HRESULT {
        unsafe { real::GetGBVSubresourceState(self.inner(), a0, a1, a2) }
    }
    unsafe fn GetGBVResourceUniformState(
        &self,
        a0: *mut core::ffi::c_void,
        a1: *mut i32,
    ) -> windows::core::HRESULT {
        unsafe { real::GetGBVResourceUniformState(self.inner(), a0, a1) }
    }
    unsafe fn GetGBVResourceInfo(
        &self,
        a0: *mut core::ffi::c_void,
        a1: *const windows::Win32::Graphics::Direct3D12::D3D12_RESOURCE_DESC,
        a2: *const u32,
        a3: *const u32,
    ) -> windows::core::HRESULT {
        unsafe { real::GetGBVResourceInfo(self.inner(), a0, a1, a2, a3) }
    }
    unsafe fn GBVReserved0(&self) {
        unsafe { real::GBVReserved0(self.inner()) }
    }
    unsafe fn GBVReserved1(&self) {
        unsafe { real::GBVReserved1(self.inner()) }
    }
}

/// Each method called on the real (wrapped) object: the trait's defaults, and overrides that still want the
/// real behaviour.
pub mod real {
    use core::ffi::c_void;

    /// `GetGBVEntireSubresourceStatesData` on the real object.
    pub unsafe fn GetGBVEntireSubresourceStatesData(
        inner: *mut c_void,
        a0: *mut core::ffi::c_void,
        a1: *mut i32,
        a2: u32,
    ) -> windows::core::HRESULT {
        unsafe {
            ((*(*(inner as *const *const windows::Win32::Graphics::Direct3D12::ID3D12GBVDiagnostics_Vtbl)))
                .GetGBVEntireSubresourceStatesData)(inner, a0, a1, a2)
        }
    }
    /// `GetGBVSubresourceState` on the real object.
    pub unsafe fn GetGBVSubresourceState(
        inner: *mut c_void,
        a0: *mut core::ffi::c_void,
        a1: u32,
        a2: *mut i32,
    ) -> windows::core::HRESULT {
        unsafe {
            ((*(*(inner as *const *const windows::Win32::Graphics::Direct3D12::ID3D12GBVDiagnostics_Vtbl)))
                .GetGBVSubresourceState)(inner, a0, a1, a2)
        }
    }
    /// `GetGBVResourceUniformState` on the real object.
    pub unsafe fn GetGBVResourceUniformState(
        inner: *mut c_void,
        a0: *mut core::ffi::c_void,
        a1: *mut i32,
    ) -> windows::core::HRESULT {
        unsafe {
            ((*(*(inner as *const *const windows::Win32::Graphics::Direct3D12::ID3D12GBVDiagnostics_Vtbl)))
                .GetGBVResourceUniformState)(inner, a0, a1)
        }
    }
    /// `GetGBVResourceInfo` on the real object.
    pub unsafe fn GetGBVResourceInfo(
        inner: *mut c_void,
        a0: *mut core::ffi::c_void,
        a1: *const windows::Win32::Graphics::Direct3D12::D3D12_RESOURCE_DESC,
        a2: *const u32,
        a3: *const u32,
    ) -> windows::core::HRESULT {
        unsafe {
            ((*(*(inner as *const *const windows::Win32::Graphics::Direct3D12::ID3D12GBVDiagnostics_Vtbl)))
                .GetGBVResourceInfo)(inner, a0, a1, a2, a3)
        }
    }
    /// `GBVReserved0` on the real object.
    pub unsafe fn GBVReserved0(inner: *mut c_void) {
        unsafe {
            ((*(*(inner as *const *const windows::Win32::Graphics::Direct3D12::ID3D12GBVDiagnostics_Vtbl)))
                .GBVReserved0)(inner)
        }
    }
    /// `GBVReserved1` on the real object.
    pub unsafe fn GBVReserved1(inner: *mut c_void) {
        unsafe {
            ((*(*(inner as *const *const windows::Win32::Graphics::Direct3D12::ID3D12GBVDiagnostics_Vtbl)))
                .GBVReserved1)(inner)
        }
    }
}

unsafe extern "system" fn QueryInterface<T: Gbv12Methods>(
    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: Gbv12Methods>(this: *mut c_void) -> u32 {
    unsafe { (*(this as *const T)).AddRef() }
}
unsafe extern "system" fn Release<T: Gbv12Methods>(this: *mut c_void) -> u32 {
    unsafe { (*(this as *const T)).Release() }
}
unsafe extern "system" fn GetGBVEntireSubresourceStatesData<T: Gbv12Methods>(
    this: *mut c_void,
    a0: *mut core::ffi::c_void,
    a1: *mut i32,
    a2: u32,
) -> windows::core::HRESULT {
    unsafe { (*(this as *const T)).GetGBVEntireSubresourceStatesData(a0, a1, a2) }
}
unsafe extern "system" fn GetGBVSubresourceState<T: Gbv12Methods>(
    this: *mut c_void,
    a0: *mut core::ffi::c_void,
    a1: u32,
    a2: *mut i32,
) -> windows::core::HRESULT {
    unsafe { (*(this as *const T)).GetGBVSubresourceState(a0, a1, a2) }
}
unsafe extern "system" fn GetGBVResourceUniformState<T: Gbv12Methods>(
    this: *mut c_void,
    a0: *mut core::ffi::c_void,
    a1: *mut i32,
) -> windows::core::HRESULT {
    unsafe { (*(this as *const T)).GetGBVResourceUniformState(a0, a1) }
}
unsafe extern "system" fn GetGBVResourceInfo<T: Gbv12Methods>(
    this: *mut c_void,
    a0: *mut core::ffi::c_void,
    a1: *const windows::Win32::Graphics::Direct3D12::D3D12_RESOURCE_DESC,
    a2: *const u32,
    a3: *const u32,
) -> windows::core::HRESULT {
    unsafe { (*(this as *const T)).GetGBVResourceInfo(a0, a1, a2, a3) }
}
unsafe extern "system" fn GBVReserved0<T: Gbv12Methods>(this: *mut c_void) {
    unsafe { (*(this as *const T)).GBVReserved0() }
}
unsafe extern "system" fn GBVReserved1<T: Gbv12Methods>(this: *mut c_void) {
    unsafe { (*(this as *const T)).GBVReserved1() }
}

#[allow(clippy::let_and_return)] // Uniform post-call interception in generated methods.
unsafe impl Gbv12Methods 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 GetGBVEntireSubresourceStatesData(
        &self,
        a0: *mut core::ffi::c_void,
        a1: *mut i32,
        a2: u32,
    ) -> windows::core::HRESULT {
        unsafe {
            let result =
                real::GetGBVEntireSubresourceStatesData(self.real(), crate::d3d12::unwrap(a0), a1, a2);
            result
        }
    }
    unsafe fn GetGBVSubresourceState(
        &self,
        a0: *mut core::ffi::c_void,
        a1: u32,
        a2: *mut i32,
    ) -> windows::core::HRESULT {
        unsafe {
            let result = real::GetGBVSubresourceState(self.real(), crate::d3d12::unwrap(a0), a1, a2);
            result
        }
    }
    unsafe fn GetGBVResourceUniformState(
        &self,
        a0: *mut core::ffi::c_void,
        a1: *mut i32,
    ) -> windows::core::HRESULT {
        unsafe {
            let result = real::GetGBVResourceUniformState(self.real(), crate::d3d12::unwrap(a0), a1);
            result
        }
    }
    unsafe fn GetGBVResourceInfo(
        &self,
        a0: *mut core::ffi::c_void,
        a1: *const windows::Win32::Graphics::Direct3D12::D3D12_RESOURCE_DESC,
        a2: *const u32,
        a3: *const u32,
    ) -> windows::core::HRESULT {
        unsafe {
            let result = real::GetGBVResourceInfo(self.real(), crate::d3d12::unwrap(a0), a1, a2, a3);
            result
        }
    }
    unsafe fn GBVReserved0(&self) {
        unsafe {
            real::GBVReserved0(self.real());
        }
    }
    unsafe fn GBVReserved1(&self) {
        unsafe {
            real::GBVReserved1(self.real());
        }
    }
}

/// The `ID3D12GBVDiagnostics` vtable whose entries call `T`'s methods.
pub const fn vtable<T: Gbv12Methods>() -> windows::Win32::Graphics::Direct3D12::ID3D12GBVDiagnostics_Vtbl {
    windows::Win32::Graphics::Direct3D12::ID3D12GBVDiagnostics_Vtbl {
        base__: windows::core::IUnknown_Vtbl {
            QueryInterface: QueryInterface::<T>,
            AddRef: AddRef::<T>,
            Release: Release::<T>,
        },
        GetGBVEntireSubresourceStatesData: GetGBVEntireSubresourceStatesData::<T>,
        GetGBVSubresourceState: GetGBVSubresourceState::<T>,
        GetGBVResourceUniformState: GetGBVResourceUniformState::<T>,
        GetGBVResourceInfo: GetGBVResourceInfo::<T>,
        GBVReserved0: GBVReserved0::<T>,
        GBVReserved1: GBVReserved1::<T>,
    }
}