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 `ID3D12DeviceRemovedExtendedDataSettings2_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 `ID3D12DeviceRemovedExtendedDataSettings2` in vtable order. The defaults forward to the wrapped object [`DredSettings12Methods::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 `ID3D12DeviceRemovedExtendedDataSettings2`.
pub unsafe trait DredSettings12Methods: Sized {
    /// The wrapped object, an `ID3D12DeviceRemovedExtendedDataSettings2`.
    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 SetAutoBreadcrumbsEnablement(
        &self,
        a0: windows::Win32::Graphics::Direct3D12::D3D12_DRED_ENABLEMENT,
    ) {
        unsafe { real::SetAutoBreadcrumbsEnablement(self.inner(), a0) }
    }
    unsafe fn SetPageFaultEnablement(&self, a0: windows::Win32::Graphics::Direct3D12::D3D12_DRED_ENABLEMENT) {
        unsafe { real::SetPageFaultEnablement(self.inner(), a0) }
    }
    unsafe fn SetWatsonDumpEnablement(
        &self,
        a0: windows::Win32::Graphics::Direct3D12::D3D12_DRED_ENABLEMENT,
    ) {
        unsafe { real::SetWatsonDumpEnablement(self.inner(), a0) }
    }
    unsafe fn SetBreadcrumbContextEnablement(
        &self,
        a0: windows::Win32::Graphics::Direct3D12::D3D12_DRED_ENABLEMENT,
    ) {
        unsafe { real::SetBreadcrumbContextEnablement(self.inner(), a0) }
    }
    unsafe fn UseMarkersOnlyAutoBreadcrumbs(&self, a0: windows::core::BOOL) {
        unsafe { real::UseMarkersOnlyAutoBreadcrumbs(self.inner(), a0) }
    }
}

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

    /// `SetAutoBreadcrumbsEnablement` on the real object.
    pub unsafe fn SetAutoBreadcrumbsEnablement(
        inner: *mut c_void,
        a0: windows::Win32::Graphics::Direct3D12::D3D12_DRED_ENABLEMENT,
    ) {
        unsafe {
            ((*(*(inner as *const *const windows::Win32::Graphics::Direct3D12::ID3D12DeviceRemovedExtendedDataSettings2_Vtbl))).base__.base__.SetAutoBreadcrumbsEnablement)(inner, a0)
        }
    }
    /// `SetPageFaultEnablement` on the real object.
    pub unsafe fn SetPageFaultEnablement(
        inner: *mut c_void,
        a0: windows::Win32::Graphics::Direct3D12::D3D12_DRED_ENABLEMENT,
    ) {
        unsafe {
            ((*(*(inner as *const *const windows::Win32::Graphics::Direct3D12::ID3D12DeviceRemovedExtendedDataSettings2_Vtbl))).base__.base__.SetPageFaultEnablement)(inner, a0)
        }
    }
    /// `SetWatsonDumpEnablement` on the real object.
    pub unsafe fn SetWatsonDumpEnablement(
        inner: *mut c_void,
        a0: windows::Win32::Graphics::Direct3D12::D3D12_DRED_ENABLEMENT,
    ) {
        unsafe {
            ((*(*(inner as *const *const windows::Win32::Graphics::Direct3D12::ID3D12DeviceRemovedExtendedDataSettings2_Vtbl))).base__.base__.SetWatsonDumpEnablement)(inner, a0)
        }
    }
    /// `SetBreadcrumbContextEnablement` on the real object.
    pub unsafe fn SetBreadcrumbContextEnablement(
        inner: *mut c_void,
        a0: windows::Win32::Graphics::Direct3D12::D3D12_DRED_ENABLEMENT,
    ) {
        unsafe {
            ((*(*(inner as *const *const windows::Win32::Graphics::Direct3D12::ID3D12DeviceRemovedExtendedDataSettings2_Vtbl))).base__.SetBreadcrumbContextEnablement)(inner, a0)
        }
    }
    /// `UseMarkersOnlyAutoBreadcrumbs` on the real object.
    pub unsafe fn UseMarkersOnlyAutoBreadcrumbs(inner: *mut c_void, a0: windows::core::BOOL) {
        unsafe {
            ((*(*(inner as *const *const windows::Win32::Graphics::Direct3D12::ID3D12DeviceRemovedExtendedDataSettings2_Vtbl))).UseMarkersOnlyAutoBreadcrumbs)(inner, a0)
        }
    }
}

unsafe extern "system" fn QueryInterface<T: DredSettings12Methods>(
    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: DredSettings12Methods>(this: *mut c_void) -> u32 {
    unsafe { (*(this as *const T)).AddRef() }
}
unsafe extern "system" fn Release<T: DredSettings12Methods>(this: *mut c_void) -> u32 {
    unsafe { (*(this as *const T)).Release() }
}
unsafe extern "system" fn SetAutoBreadcrumbsEnablement<T: DredSettings12Methods>(
    this: *mut c_void,
    a0: windows::Win32::Graphics::Direct3D12::D3D12_DRED_ENABLEMENT,
) {
    unsafe { (*(this as *const T)).SetAutoBreadcrumbsEnablement(a0) }
}
unsafe extern "system" fn SetPageFaultEnablement<T: DredSettings12Methods>(
    this: *mut c_void,
    a0: windows::Win32::Graphics::Direct3D12::D3D12_DRED_ENABLEMENT,
) {
    unsafe { (*(this as *const T)).SetPageFaultEnablement(a0) }
}
unsafe extern "system" fn SetWatsonDumpEnablement<T: DredSettings12Methods>(
    this: *mut c_void,
    a0: windows::Win32::Graphics::Direct3D12::D3D12_DRED_ENABLEMENT,
) {
    unsafe { (*(this as *const T)).SetWatsonDumpEnablement(a0) }
}
unsafe extern "system" fn SetBreadcrumbContextEnablement<T: DredSettings12Methods>(
    this: *mut c_void,
    a0: windows::Win32::Graphics::Direct3D12::D3D12_DRED_ENABLEMENT,
) {
    unsafe { (*(this as *const T)).SetBreadcrumbContextEnablement(a0) }
}
unsafe extern "system" fn UseMarkersOnlyAutoBreadcrumbs<T: DredSettings12Methods>(
    this: *mut c_void,
    a0: windows::core::BOOL,
) {
    unsafe { (*(this as *const T)).UseMarkersOnlyAutoBreadcrumbs(a0) }
}

#[allow(clippy::let_and_return)] // Uniform post-call interception in generated methods.
unsafe impl DredSettings12Methods 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 SetAutoBreadcrumbsEnablement(
        &self,
        a0: windows::Win32::Graphics::Direct3D12::D3D12_DRED_ENABLEMENT,
    ) {
        unsafe {
            real::SetAutoBreadcrumbsEnablement(self.real(), a0);
        }
    }
    unsafe fn SetPageFaultEnablement(&self, a0: windows::Win32::Graphics::Direct3D12::D3D12_DRED_ENABLEMENT) {
        unsafe {
            real::SetPageFaultEnablement(self.real(), a0);
        }
    }
    unsafe fn SetWatsonDumpEnablement(
        &self,
        a0: windows::Win32::Graphics::Direct3D12::D3D12_DRED_ENABLEMENT,
    ) {
        unsafe {
            real::SetWatsonDumpEnablement(self.real(), a0);
        }
    }
    unsafe fn SetBreadcrumbContextEnablement(
        &self,
        a0: windows::Win32::Graphics::Direct3D12::D3D12_DRED_ENABLEMENT,
    ) {
        unsafe {
            real::SetBreadcrumbContextEnablement(self.real(), a0);
        }
    }
    unsafe fn UseMarkersOnlyAutoBreadcrumbs(&self, a0: windows::core::BOOL) {
        unsafe {
            real::UseMarkersOnlyAutoBreadcrumbs(self.real(), a0);
        }
    }
}

/// The `ID3D12DeviceRemovedExtendedDataSettings2` vtable whose entries call `T`'s methods.
pub const fn vtable<T: DredSettings12Methods>()
-> windows::Win32::Graphics::Direct3D12::ID3D12DeviceRemovedExtendedDataSettings2_Vtbl {
    windows::Win32::Graphics::Direct3D12::ID3D12DeviceRemovedExtendedDataSettings2_Vtbl {
        base__: windows::Win32::Graphics::Direct3D12::ID3D12DeviceRemovedExtendedDataSettings1_Vtbl {
            base__: windows::Win32::Graphics::Direct3D12::ID3D12DeviceRemovedExtendedDataSettings_Vtbl {
                base__: windows::core::IUnknown_Vtbl {
                    QueryInterface: QueryInterface::<T>,
                    AddRef: AddRef::<T>,
                    Release: Release::<T>,
                },
                SetAutoBreadcrumbsEnablement: SetAutoBreadcrumbsEnablement::<T>,
                SetPageFaultEnablement: SetPageFaultEnablement::<T>,
                SetWatsonDumpEnablement: SetWatsonDumpEnablement::<T>,
            },
            SetBreadcrumbContextEnablement: SetBreadcrumbContextEnablement::<T>,
        },
        UseMarkersOnlyAutoBreadcrumbs: UseMarkersOnlyAutoBreadcrumbs::<T>,
    }
}