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 `ID3D12DeviceConfiguration1_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 `ID3D12DeviceConfiguration1` in vtable order. The defaults forward to the wrapped object [`Configuration12Methods::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 `ID3D12DeviceConfiguration1`.
pub unsafe trait Configuration12Methods: Sized {
    /// The wrapped object, an `ID3D12DeviceConfiguration1`.
    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 GetDesc(&self, a0: *mut windows::Win32::Graphics::Direct3D12::D3D12_DEVICE_CONFIGURATION_DESC) {
        unsafe { real::GetDesc(self.inner(), a0) }
    }
    unsafe fn GetEnabledExperimentalFeatures(
        &self,
        a0: *mut windows::core::GUID,
        a1: u32,
    ) -> windows::core::HRESULT {
        unsafe { real::GetEnabledExperimentalFeatures(self.inner(), a0, a1) }
    }
    unsafe fn SerializeVersionedRootSignature(
        &self,
        a0: *const windows::Win32::Graphics::Direct3D12::D3D12_VERSIONED_ROOT_SIGNATURE_DESC,
        a1: *mut *mut core::ffi::c_void,
        a2: *mut *mut core::ffi::c_void,
    ) -> windows::core::HRESULT {
        unsafe { real::SerializeVersionedRootSignature(self.inner(), a0, a1, a2) }
    }
    unsafe fn CreateVersionedRootSignatureDeserializer(
        &self,
        a0: *const core::ffi::c_void,
        a1: usize,
        a2: *const windows::core::GUID,
        a3: *mut *mut core::ffi::c_void,
    ) -> windows::core::HRESULT {
        unsafe { real::CreateVersionedRootSignatureDeserializer(self.inner(), a0, a1, a2, a3) }
    }
    unsafe fn CreateVersionedRootSignatureDeserializerFromSubobjectInLibrary(
        &self,
        a0: *const core::ffi::c_void,
        a1: usize,
        a2: windows::core::PCWSTR,
        a3: *const windows::core::GUID,
        a4: *mut *mut core::ffi::c_void,
    ) -> windows::core::HRESULT {
        unsafe {
            real::CreateVersionedRootSignatureDeserializerFromSubobjectInLibrary(
                self.inner(),
                a0,
                a1,
                a2,
                a3,
                a4,
            )
        }
    }
}

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

    /// `GetDesc` on the real object.
    pub unsafe fn GetDesc(
        inner: *mut c_void,
        a0: *mut windows::Win32::Graphics::Direct3D12::D3D12_DEVICE_CONFIGURATION_DESC,
    ) {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12DeviceConfiguration1_Vtbl)))
                .base__
                .GetDesc)(inner, a0)
        }
    }
    /// `GetEnabledExperimentalFeatures` on the real object.
    pub unsafe fn GetEnabledExperimentalFeatures(
        inner: *mut c_void,
        a0: *mut windows::core::GUID,
        a1: u32,
    ) -> windows::core::HRESULT {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12DeviceConfiguration1_Vtbl)))
                .base__
                .GetEnabledExperimentalFeatures)(inner, a0, a1)
        }
    }
    /// `SerializeVersionedRootSignature` on the real object.
    pub unsafe fn SerializeVersionedRootSignature(
        inner: *mut c_void,
        a0: *const windows::Win32::Graphics::Direct3D12::D3D12_VERSIONED_ROOT_SIGNATURE_DESC,
        a1: *mut *mut core::ffi::c_void,
        a2: *mut *mut core::ffi::c_void,
    ) -> windows::core::HRESULT {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12DeviceConfiguration1_Vtbl)))
                .base__
                .SerializeVersionedRootSignature)(inner, a0, a1, a2)
        }
    }
    /// `CreateVersionedRootSignatureDeserializer` on the real object.
    pub unsafe fn CreateVersionedRootSignatureDeserializer(
        inner: *mut c_void,
        a0: *const core::ffi::c_void,
        a1: usize,
        a2: *const windows::core::GUID,
        a3: *mut *mut core::ffi::c_void,
    ) -> windows::core::HRESULT {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12DeviceConfiguration1_Vtbl)))
                .base__
                .CreateVersionedRootSignatureDeserializer)(inner, a0, a1, a2, a3)
        }
    }
    /// `CreateVersionedRootSignatureDeserializerFromSubobjectInLibrary` on the real object.
    pub unsafe fn CreateVersionedRootSignatureDeserializerFromSubobjectInLibrary(
        inner: *mut c_void,
        a0: *const core::ffi::c_void,
        a1: usize,
        a2: windows::core::PCWSTR,
        a3: *const windows::core::GUID,
        a4: *mut *mut core::ffi::c_void,
    ) -> windows::core::HRESULT {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12DeviceConfiguration1_Vtbl)))
                .CreateVersionedRootSignatureDeserializerFromSubobjectInLibrary)(
                inner, a0, a1, a2, a3, a4
            )
        }
    }
}

unsafe extern "system" fn QueryInterface<T: Configuration12Methods>(
    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: Configuration12Methods>(this: *mut c_void) -> u32 {
    unsafe { (*(this as *const T)).AddRef() }
}
unsafe extern "system" fn Release<T: Configuration12Methods>(this: *mut c_void) -> u32 {
    unsafe { (*(this as *const T)).Release() }
}
unsafe extern "system" fn GetDesc<T: Configuration12Methods>(
    this: *mut c_void,
    a0: *mut windows::Win32::Graphics::Direct3D12::D3D12_DEVICE_CONFIGURATION_DESC,
) {
    unsafe { (*(this as *const T)).GetDesc(a0) }
}
unsafe extern "system" fn GetEnabledExperimentalFeatures<T: Configuration12Methods>(
    this: *mut c_void,
    a0: *mut windows::core::GUID,
    a1: u32,
) -> windows::core::HRESULT {
    unsafe { (*(this as *const T)).GetEnabledExperimentalFeatures(a0, a1) }
}
unsafe extern "system" fn SerializeVersionedRootSignature<T: Configuration12Methods>(
    this: *mut c_void,
    a0: *const windows::Win32::Graphics::Direct3D12::D3D12_VERSIONED_ROOT_SIGNATURE_DESC,
    a1: *mut *mut core::ffi::c_void,
    a2: *mut *mut core::ffi::c_void,
) -> windows::core::HRESULT {
    unsafe { (*(this as *const T)).SerializeVersionedRootSignature(a0, a1, a2) }
}
unsafe extern "system" fn CreateVersionedRootSignatureDeserializer<T: Configuration12Methods>(
    this: *mut c_void,
    a0: *const core::ffi::c_void,
    a1: usize,
    a2: *const windows::core::GUID,
    a3: *mut *mut core::ffi::c_void,
) -> windows::core::HRESULT {
    unsafe { (*(this as *const T)).CreateVersionedRootSignatureDeserializer(a0, a1, a2, a3) }
}
unsafe extern "system" fn CreateVersionedRootSignatureDeserializerFromSubobjectInLibrary<
    T: Configuration12Methods,
>(
    this: *mut c_void,
    a0: *const core::ffi::c_void,
    a1: usize,
    a2: windows::core::PCWSTR,
    a3: *const windows::core::GUID,
    a4: *mut *mut core::ffi::c_void,
) -> windows::core::HRESULT {
    unsafe {
        (*(this as *const T))
            .CreateVersionedRootSignatureDeserializerFromSubobjectInLibrary(a0, a1, a2, a3, a4)
    }
}

#[allow(clippy::let_and_return)] // Uniform post-call interception in generated methods.
unsafe impl Configuration12Methods 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 GetDesc(&self, a0: *mut windows::Win32::Graphics::Direct3D12::D3D12_DEVICE_CONFIGURATION_DESC) {
        unsafe {
            real::GetDesc(self.real(), a0);
        }
    }
    unsafe fn GetEnabledExperimentalFeatures(
        &self,
        a0: *mut windows::core::GUID,
        a1: u32,
    ) -> windows::core::HRESULT {
        unsafe {
            let result = real::GetEnabledExperimentalFeatures(self.real(), a0, a1);
            result
        }
    }
    unsafe fn SerializeVersionedRootSignature(
        &self,
        a0: *const windows::Win32::Graphics::Direct3D12::D3D12_VERSIONED_ROOT_SIGNATURE_DESC,
        a1: *mut *mut core::ffi::c_void,
        a2: *mut *mut core::ffi::c_void,
    ) -> windows::core::HRESULT {
        unsafe {
            let result = real::SerializeVersionedRootSignature(self.real(), a0, a1, a2);
            result
        }
    }
    unsafe fn CreateVersionedRootSignatureDeserializer(
        &self,
        a0: *const core::ffi::c_void,
        a1: usize,
        a2: *const windows::core::GUID,
        a3: *mut *mut core::ffi::c_void,
    ) -> windows::core::HRESULT {
        unsafe {
            let result = real::CreateVersionedRootSignatureDeserializer(self.real(), a0, a1, a2, a3);
            crate::d3d12::wrap_output(result, a2, a3);
            result
        }
    }
    unsafe fn CreateVersionedRootSignatureDeserializerFromSubobjectInLibrary(
        &self,
        a0: *const core::ffi::c_void,
        a1: usize,
        a2: windows::core::PCWSTR,
        a3: *const windows::core::GUID,
        a4: *mut *mut core::ffi::c_void,
    ) -> windows::core::HRESULT {
        unsafe {
            let result = real::CreateVersionedRootSignatureDeserializerFromSubobjectInLibrary(
                self.real(),
                a0,
                a1,
                a2,
                a3,
                a4,
            );
            crate::d3d12::wrap_output(result, a3, a4);
            result
        }
    }
}

/// The `ID3D12DeviceConfiguration1` vtable whose entries call `T`'s methods.
pub const fn vtable<T: Configuration12Methods>()
-> windows::Win32::Graphics::Direct3D12::ID3D12DeviceConfiguration1_Vtbl {
    windows::Win32::Graphics::Direct3D12::ID3D12DeviceConfiguration1_Vtbl {
        base__: windows::Win32::Graphics::Direct3D12::ID3D12DeviceConfiguration_Vtbl {
            base__: windows::core::IUnknown_Vtbl {
                QueryInterface: QueryInterface::<T>,
                AddRef: AddRef::<T>,
                Release: Release::<T>,
            },
            GetDesc: GetDesc::<T>,
            GetEnabledExperimentalFeatures: GetEnabledExperimentalFeatures::<T>,
            SerializeVersionedRootSignature: SerializeVersionedRootSignature::<T>,
            CreateVersionedRootSignatureDeserializer: CreateVersionedRootSignatureDeserializer::<T>,
        },
        CreateVersionedRootSignatureDeserializerFromSubobjectInLibrary:
            CreateVersionedRootSignatureDeserializerFromSubobjectInLibrary::<T>,
    }
}