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 `ID3D12StateObjectProperties1_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 `ID3D12StateObjectProperties1` in vtable order. The defaults forward to the wrapped object [`Properties12Methods::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 `ID3D12StateObjectProperties1`.
pub unsafe trait Properties12Methods: Sized {
    /// The wrapped object, an `ID3D12StateObjectProperties1`.
    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 GetShaderIdentifier(&self, a0: windows::core::PCWSTR) -> *mut core::ffi::c_void {
        unsafe { real::GetShaderIdentifier(self.inner(), a0) }
    }
    unsafe fn GetShaderStackSize(&self, a0: windows::core::PCWSTR) -> u64 {
        unsafe { real::GetShaderStackSize(self.inner(), a0) }
    }
    unsafe fn GetPipelineStackSize(&self) -> u64 {
        unsafe { real::GetPipelineStackSize(self.inner()) }
    }
    unsafe fn SetPipelineStackSize(&self, a0: u64) {
        unsafe { real::SetPipelineStackSize(self.inner(), a0) }
    }
    unsafe fn GetProgramIdentifier(
        &self,
        a0: *mut windows::Win32::Graphics::Direct3D12::D3D12_PROGRAM_IDENTIFIER,
        a1: windows::core::PCWSTR,
    ) {
        unsafe { real::GetProgramIdentifier(self.inner(), a0, a1) }
    }
}

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

    /// `GetShaderIdentifier` on the real object.
    pub unsafe fn GetShaderIdentifier(
        inner: *mut c_void,
        a0: windows::core::PCWSTR,
    ) -> *mut core::ffi::c_void {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12StateObjectProperties1_Vtbl)))
                .base__
                .GetShaderIdentifier)(inner, a0)
        }
    }
    /// `GetShaderStackSize` on the real object.
    pub unsafe fn GetShaderStackSize(inner: *mut c_void, a0: windows::core::PCWSTR) -> u64 {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12StateObjectProperties1_Vtbl)))
                .base__
                .GetShaderStackSize)(inner, a0)
        }
    }
    /// `GetPipelineStackSize` on the real object.
    pub unsafe fn GetPipelineStackSize(inner: *mut c_void) -> u64 {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12StateObjectProperties1_Vtbl)))
                .base__
                .GetPipelineStackSize)(inner)
        }
    }
    /// `SetPipelineStackSize` on the real object.
    pub unsafe fn SetPipelineStackSize(inner: *mut c_void, a0: u64) {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12StateObjectProperties1_Vtbl)))
                .base__
                .SetPipelineStackSize)(inner, a0)
        }
    }
    /// `GetProgramIdentifier` on the real object.
    pub unsafe fn GetProgramIdentifier(
        inner: *mut c_void,
        a0: *mut windows::Win32::Graphics::Direct3D12::D3D12_PROGRAM_IDENTIFIER,
        a1: windows::core::PCWSTR,
    ) {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12StateObjectProperties1_Vtbl)))
                .GetProgramIdentifier)(inner, a0, a1)
        }
    }
}

unsafe extern "system" fn QueryInterface<T: Properties12Methods>(
    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: Properties12Methods>(this: *mut c_void) -> u32 {
    unsafe { (*(this as *const T)).AddRef() }
}
unsafe extern "system" fn Release<T: Properties12Methods>(this: *mut c_void) -> u32 {
    unsafe { (*(this as *const T)).Release() }
}
unsafe extern "system" fn GetShaderIdentifier<T: Properties12Methods>(
    this: *mut c_void,
    a0: windows::core::PCWSTR,
) -> *mut core::ffi::c_void {
    unsafe { (*(this as *const T)).GetShaderIdentifier(a0) }
}
unsafe extern "system" fn GetShaderStackSize<T: Properties12Methods>(
    this: *mut c_void,
    a0: windows::core::PCWSTR,
) -> u64 {
    unsafe { (*(this as *const T)).GetShaderStackSize(a0) }
}
unsafe extern "system" fn GetPipelineStackSize<T: Properties12Methods>(this: *mut c_void) -> u64 {
    unsafe { (*(this as *const T)).GetPipelineStackSize() }
}
unsafe extern "system" fn SetPipelineStackSize<T: Properties12Methods>(this: *mut c_void, a0: u64) {
    unsafe { (*(this as *const T)).SetPipelineStackSize(a0) }
}
unsafe extern "system" fn GetProgramIdentifier<T: Properties12Methods>(
    this: *mut c_void,
    a0: *mut windows::Win32::Graphics::Direct3D12::D3D12_PROGRAM_IDENTIFIER,
    a1: windows::core::PCWSTR,
) {
    unsafe { (*(this as *const T)).GetProgramIdentifier(a0, a1) }
}

#[allow(clippy::let_and_return)] // Uniform post-call interception in generated methods.
unsafe impl Properties12Methods 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 GetShaderIdentifier(&self, a0: windows::core::PCWSTR) -> *mut core::ffi::c_void {
        unsafe {
            let result = real::GetShaderIdentifier(self.real(), a0);
            result
        }
    }
    unsafe fn GetShaderStackSize(&self, a0: windows::core::PCWSTR) -> u64 {
        unsafe {
            let result = real::GetShaderStackSize(self.real(), a0);
            result
        }
    }
    unsafe fn GetPipelineStackSize(&self) -> u64 {
        unsafe {
            let result = real::GetPipelineStackSize(self.real());
            result
        }
    }
    unsafe fn SetPipelineStackSize(&self, a0: u64) {
        unsafe {
            real::SetPipelineStackSize(self.real(), a0);
        }
    }
    unsafe fn GetProgramIdentifier(
        &self,
        a0: *mut windows::Win32::Graphics::Direct3D12::D3D12_PROGRAM_IDENTIFIER,
        a1: windows::core::PCWSTR,
    ) {
        unsafe {
            real::GetProgramIdentifier(self.real(), a0, a1);
        }
    }
}

/// The `ID3D12StateObjectProperties1` vtable whose entries call `T`'s methods.
pub const fn vtable<T: Properties12Methods>()
-> windows::Win32::Graphics::Direct3D12::ID3D12StateObjectProperties1_Vtbl {
    windows::Win32::Graphics::Direct3D12::ID3D12StateObjectProperties1_Vtbl {
        base__: windows::Win32::Graphics::Direct3D12::ID3D12StateObjectProperties_Vtbl {
            base__: windows::core::IUnknown_Vtbl {
                QueryInterface: QueryInterface::<T>,
                AddRef: AddRef::<T>,
                Release: Release::<T>,
            },
            GetShaderIdentifier: GetShaderIdentifier::<T>,
            GetShaderStackSize: GetShaderStackSize::<T>,
            GetPipelineStackSize: GetPipelineStackSize::<T>,
            SetPipelineStackSize: SetPipelineStackSize::<T>,
        },
        GetProgramIdentifier: GetProgramIdentifier::<T>,
    }
}