#![allow(
non_snake_case,
non_upper_case_globals,
non_camel_case_types,
dead_code,
clippy::all
)]
pub mod Microsoft {
pub mod Direct3D {
pub mod DirectStorage {
#[inline]
pub unsafe fn DStorageCreateCompressionCodec<T>(
format: DSTORAGE_COMPRESSION_FORMAT,
numthreads: u32,
) -> windows_core::Result<T>
where
T: windows_core::Interface,
{
windows_link::link!("dstorage" "system" fn DStorageCreateCompressionCodec(format : DSTORAGE_COMPRESSION_FORMAT, numthreads : u32, riid : *const windows_core::GUID, ppv : *mut *mut core::ffi::c_void) -> windows_core::HRESULT);
let mut result__ = core::ptr::null_mut();
unsafe {
DStorageCreateCompressionCodec(format, numthreads, &T::IID, &mut result__)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[inline]
pub unsafe fn DStorageGetFactory<T>() -> windows_core::Result<T>
where
T: windows_core::Interface,
{
windows_link::link!("dstorage" "system" fn DStorageGetFactory(riid : *const windows_core::GUID, ppv : *mut *mut core::ffi::c_void) -> windows_core::HRESULT);
let mut result__ = core::ptr::null_mut();
unsafe {
DStorageGetFactory(&T::IID, &mut result__)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[inline]
pub unsafe fn DStorageSetConfiguration(
configuration: *const DSTORAGE_CONFIGURATION,
) -> windows_core::Result<()> {
windows_link::link!("dstorage" "system" fn DStorageSetConfiguration(configuration : *const DSTORAGE_CONFIGURATION) -> windows_core::HRESULT);
unsafe { DStorageSetConfiguration(configuration).ok() }
}
#[inline]
pub unsafe fn DStorageSetConfiguration1(
configuration: *const DSTORAGE_CONFIGURATION1,
) -> windows_core::Result<()> {
windows_link::link!("dstorage" "system" fn DStorageSetConfiguration1(configuration : *const DSTORAGE_CONFIGURATION1) -> windows_core::HRESULT);
unsafe { DStorageSetConfiguration1(configuration).ok() }
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct DSTORAGE_COMMAND_TYPE(pub i32);
pub const DSTORAGE_COMMAND_TYPE_EVENT: DSTORAGE_COMMAND_TYPE =
DSTORAGE_COMMAND_TYPE(3i32);
pub const DSTORAGE_COMMAND_TYPE_NONE: DSTORAGE_COMMAND_TYPE =
DSTORAGE_COMMAND_TYPE(-1i32);
pub const DSTORAGE_COMMAND_TYPE_REQUEST: DSTORAGE_COMMAND_TYPE =
DSTORAGE_COMMAND_TYPE(0i32);
pub const DSTORAGE_COMMAND_TYPE_SIGNAL: DSTORAGE_COMMAND_TYPE =
DSTORAGE_COMMAND_TYPE(2i32);
pub const DSTORAGE_COMMAND_TYPE_STATUS: DSTORAGE_COMMAND_TYPE =
DSTORAGE_COMMAND_TYPE(1i32);
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct DSTORAGE_COMPRESSION(pub i32);
pub const DSTORAGE_COMPRESSION_BEST_RATIO: DSTORAGE_COMPRESSION =
DSTORAGE_COMPRESSION(1i32);
pub const DSTORAGE_COMPRESSION_DEFAULT: DSTORAGE_COMPRESSION =
DSTORAGE_COMPRESSION(0i32);
pub const DSTORAGE_COMPRESSION_FASTEST: DSTORAGE_COMPRESSION =
DSTORAGE_COMPRESSION(-1i32);
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct DSTORAGE_COMPRESSION_FORMAT(pub u8);
pub const DSTORAGE_COMPRESSION_FORMAT_GDEFLATE: DSTORAGE_COMPRESSION_FORMAT =
DSTORAGE_COMPRESSION_FORMAT(1u8);
pub const DSTORAGE_COMPRESSION_FORMAT_NONE: DSTORAGE_COMPRESSION_FORMAT =
DSTORAGE_COMPRESSION_FORMAT(0u8);
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct DSTORAGE_COMPRESSION_SUPPORT(pub u32);
impl DSTORAGE_COMPRESSION_SUPPORT {
pub const fn contains(&self, other: Self) -> bool {
self.0 & other.0 == other.0
}
}
impl core::ops::BitOr for DSTORAGE_COMPRESSION_SUPPORT {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl core::ops::BitAnd for DSTORAGE_COMPRESSION_SUPPORT {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
impl core::ops::BitOrAssign for DSTORAGE_COMPRESSION_SUPPORT {
fn bitor_assign(&mut self, other: Self) {
self.0.bitor_assign(other.0)
}
}
impl core::ops::BitAndAssign for DSTORAGE_COMPRESSION_SUPPORT {
fn bitand_assign(&mut self, other: Self) {
self.0.bitand_assign(other.0)
}
}
impl core::ops::Not for DSTORAGE_COMPRESSION_SUPPORT {
type Output = Self;
fn not(self) -> Self {
Self(self.0.not())
}
}
pub const DSTORAGE_COMPRESSION_SUPPORT_CPU_FALLBACK: DSTORAGE_COMPRESSION_SUPPORT =
DSTORAGE_COMPRESSION_SUPPORT(4u32);
pub const DSTORAGE_COMPRESSION_SUPPORT_GPU_FALLBACK: DSTORAGE_COMPRESSION_SUPPORT =
DSTORAGE_COMPRESSION_SUPPORT(2u32);
pub const DSTORAGE_COMPRESSION_SUPPORT_GPU_OPTIMIZED: DSTORAGE_COMPRESSION_SUPPORT =
DSTORAGE_COMPRESSION_SUPPORT(1u32);
pub const DSTORAGE_COMPRESSION_SUPPORT_NONE: DSTORAGE_COMPRESSION_SUPPORT =
DSTORAGE_COMPRESSION_SUPPORT(0u32);
pub const DSTORAGE_COMPRESSION_SUPPORT_USES_COMPUTE_QUEUE:
DSTORAGE_COMPRESSION_SUPPORT = DSTORAGE_COMPRESSION_SUPPORT(8u32);
pub const DSTORAGE_COMPRESSION_SUPPORT_USES_COPY_QUEUE: DSTORAGE_COMPRESSION_SUPPORT =
DSTORAGE_COMPRESSION_SUPPORT(16u32);
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct DSTORAGE_CONFIGURATION {
pub NumSubmitThreads: u32,
pub NumBuiltInCpuDecompressionThreads: i32,
pub ForceMappingLayer: windows_core::BOOL,
pub DisableBypassIO: windows_core::BOOL,
pub DisableTelemetry: windows_core::BOOL,
pub DisableGpuDecompressionMetacommand: windows_core::BOOL,
pub DisableGpuDecompression: windows_core::BOOL,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct DSTORAGE_CONFIGURATION1 {
pub NumSubmitThreads: u32,
pub NumBuiltInCpuDecompressionThreads: i32,
pub ForceMappingLayer: windows_core::BOOL,
pub DisableBypassIO: windows_core::BOOL,
pub DisableTelemetry: windows_core::BOOL,
pub DisableGpuDecompressionMetacommand: windows_core::BOOL,
pub DisableGpuDecompression: windows_core::BOOL,
pub ForceFileBuffering: windows_core::BOOL,
}
pub const DSTORAGE_CUSTOM_COMPRESSION_0: DSTORAGE_COMPRESSION_FORMAT =
DSTORAGE_COMPRESSION_FORMAT(128u8);
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS(pub u32);
impl DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS {
pub const fn contains(&self, other: Self) -> bool {
self.0 & other.0 == other.0
}
}
impl core::ops::BitOr for DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl core::ops::BitAnd for DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
impl core::ops::BitOrAssign for DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS {
fn bitor_assign(&mut self, other: Self) {
self.0.bitor_assign(other.0)
}
}
impl core::ops::BitAndAssign for DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS {
fn bitand_assign(&mut self, other: Self) {
self.0.bitand_assign(other.0)
}
}
impl core::ops::Not for DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS {
type Output = Self;
fn not(self) -> Self {
Self(self.0.not())
}
}
pub const DSTORAGE_CUSTOM_DECOMPRESSION_FLAG_DEST_IN_UPLOAD_HEAP:
DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS = DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS(1u32);
pub const DSTORAGE_CUSTOM_DECOMPRESSION_FLAG_NONE: DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS =
DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS(0u32);
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST {
pub Id: u64,
pub CompressionFormat: DSTORAGE_COMPRESSION_FORMAT,
pub Reserved: [u8; 3],
pub Flags: DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS,
pub SrcSize: u64,
pub SrcBuffer: *const core::ffi::c_void,
pub DstSize: u64,
pub DstBuffer: *mut core::ffi::c_void,
}
impl Default for DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST {
fn default() -> Self {
unsafe { core::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct DSTORAGE_CUSTOM_DECOMPRESSION_RESULT {
pub Id: u64,
pub Result: windows_core::HRESULT,
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct DSTORAGE_DEBUG(pub i32);
impl DSTORAGE_DEBUG {
pub const fn contains(&self, other: Self) -> bool {
self.0 & other.0 == other.0
}
}
impl core::ops::BitOr for DSTORAGE_DEBUG {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl core::ops::BitAnd for DSTORAGE_DEBUG {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
impl core::ops::BitOrAssign for DSTORAGE_DEBUG {
fn bitor_assign(&mut self, other: Self) {
self.0.bitor_assign(other.0)
}
}
impl core::ops::BitAndAssign for DSTORAGE_DEBUG {
fn bitand_assign(&mut self, other: Self) {
self.0.bitand_assign(other.0)
}
}
impl core::ops::Not for DSTORAGE_DEBUG {
type Output = Self;
fn not(self) -> Self {
Self(self.0.not())
}
}
pub const DSTORAGE_DEBUG_BREAK_ON_ERROR: DSTORAGE_DEBUG = DSTORAGE_DEBUG(2i32);
pub const DSTORAGE_DEBUG_NONE: DSTORAGE_DEBUG = DSTORAGE_DEBUG(0i32);
pub const DSTORAGE_DEBUG_RECORD_OBJECT_NAMES: DSTORAGE_DEBUG = DSTORAGE_DEBUG(4i32);
pub const DSTORAGE_DEBUG_SHOW_ERRORS: DSTORAGE_DEBUG = DSTORAGE_DEBUG(1i32);
#[repr(C)]
pub union DSTORAGE_DESTINATION {
pub Memory: DSTORAGE_DESTINATION_MEMORY,
pub Buffer: core::mem::ManuallyDrop<DSTORAGE_DESTINATION_BUFFER>,
pub Texture: core::mem::ManuallyDrop<DSTORAGE_DESTINATION_TEXTURE_REGION>,
pub MultipleSubresources:
core::mem::ManuallyDrop<DSTORAGE_DESTINATION_MULTIPLE_SUBRESOURCES>,
pub Tiles: core::mem::ManuallyDrop<DSTORAGE_DESTINATION_TILES>,
pub MultipleSubresourcesRange:
core::mem::ManuallyDrop<DSTORAGE_DESTINATION_MULTIPLE_SUBRESOURCES_RANGE>,
}
impl Clone for DSTORAGE_DESTINATION {
fn clone(&self) -> Self {
unsafe { core::mem::transmute_copy(self) }
}
}
impl Default for DSTORAGE_DESTINATION {
fn default() -> Self {
unsafe { core::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DSTORAGE_DESTINATION_BUFFER {
pub Resource: core::mem::ManuallyDrop<
Option<windows::Win32::Graphics::Direct3D12::ID3D12Resource>,
>,
pub Offset: u64,
pub Size: u32,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct DSTORAGE_DESTINATION_MEMORY {
pub Buffer: *mut core::ffi::c_void,
pub Size: u32,
}
impl Default for DSTORAGE_DESTINATION_MEMORY {
fn default() -> Self {
unsafe { core::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DSTORAGE_DESTINATION_MULTIPLE_SUBRESOURCES {
pub Resource: core::mem::ManuallyDrop<
Option<windows::Win32::Graphics::Direct3D12::ID3D12Resource>,
>,
pub FirstSubresource: u32,
}
#[repr(C)]
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DSTORAGE_DESTINATION_MULTIPLE_SUBRESOURCES_RANGE {
pub Resource: core::mem::ManuallyDrop<
Option<windows::Win32::Graphics::Direct3D12::ID3D12Resource>,
>,
pub FirstSubresource: u32,
pub NumSubresources: u32,
}
#[repr(C)]
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DSTORAGE_DESTINATION_TEXTURE_REGION {
pub Resource: core::mem::ManuallyDrop<
Option<windows::Win32::Graphics::Direct3D12::ID3D12Resource>,
>,
pub SubresourceIndex: u32,
pub Region: windows::Win32::Graphics::Direct3D12::D3D12_BOX,
}
#[repr(C)]
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DSTORAGE_DESTINATION_TILES {
pub Resource: core::mem::ManuallyDrop<
Option<windows::Win32::Graphics::Direct3D12::ID3D12Resource>,
>,
pub TiledRegionStartCoordinate:
windows::Win32::Graphics::Direct3D12::D3D12_TILED_RESOURCE_COORDINATE,
pub TileRegionSize: windows::Win32::Graphics::Direct3D12::D3D12_TILE_REGION_SIZE,
}
pub const DSTORAGE_DISABLE_BUILTIN_CPU_DECOMPRESSION: i32 = -1i32;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct DSTORAGE_ENQUEUE_REQUEST_FLAGS(pub u32);
pub const DSTORAGE_ENQUEUE_REQUEST_FLAG_FENCE_WAIT_BEFORE_GPU_WORK:
DSTORAGE_ENQUEUE_REQUEST_FLAGS = DSTORAGE_ENQUEUE_REQUEST_FLAGS(1u32);
pub const DSTORAGE_ENQUEUE_REQUEST_FLAG_FENCE_WAIT_BEFORE_SOURCE_ACCESS:
DSTORAGE_ENQUEUE_REQUEST_FLAGS = DSTORAGE_ENQUEUE_REQUEST_FLAGS(2u32);
pub const DSTORAGE_ENQUEUE_REQUEST_FLAG_NONE: DSTORAGE_ENQUEUE_REQUEST_FLAGS =
DSTORAGE_ENQUEUE_REQUEST_FLAGS(0u32);
#[repr(C)]
pub struct DSTORAGE_ERROR_FIRST_FAILURE {
pub HResult: windows_core::HRESULT,
pub CommandType: DSTORAGE_COMMAND_TYPE,
pub Anonymous: DSTORAGE_ERROR_FIRST_FAILURE_0,
}
impl Clone for DSTORAGE_ERROR_FIRST_FAILURE {
fn clone(&self) -> Self {
unsafe { core::mem::transmute_copy(self) }
}
}
impl Default for DSTORAGE_ERROR_FIRST_FAILURE {
fn default() -> Self {
unsafe { core::mem::zeroed() }
}
}
#[repr(C)]
pub union DSTORAGE_ERROR_FIRST_FAILURE_0 {
pub Request: core::mem::ManuallyDrop<DSTORAGE_ERROR_PARAMETERS_REQUEST>,
pub Status: core::mem::ManuallyDrop<DSTORAGE_ERROR_PARAMETERS_STATUS>,
pub Signal: core::mem::ManuallyDrop<DSTORAGE_ERROR_PARAMETERS_SIGNAL>,
pub Event: DSTORAGE_ERROR_PARAMETERS_EVENT,
}
impl Clone for DSTORAGE_ERROR_FIRST_FAILURE_0 {
fn clone(&self) -> Self {
unsafe { core::mem::transmute_copy(self) }
}
}
impl Default for DSTORAGE_ERROR_FIRST_FAILURE_0 {
fn default() -> Self {
unsafe { core::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct DSTORAGE_ERROR_PARAMETERS_EVENT {
pub Handle: windows::Win32::Foundation::HANDLE,
}
#[repr(C)]
pub struct DSTORAGE_ERROR_PARAMETERS_REQUEST {
pub Filename: [u16; 260],
pub RequestName: [i8; 64],
pub Request: DSTORAGE_REQUEST,
}
impl Clone for DSTORAGE_ERROR_PARAMETERS_REQUEST {
fn clone(&self) -> Self {
unsafe { core::mem::transmute_copy(self) }
}
}
impl Default for DSTORAGE_ERROR_PARAMETERS_REQUEST {
fn default() -> Self {
unsafe { core::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DSTORAGE_ERROR_PARAMETERS_SIGNAL {
pub Fence: core::mem::ManuallyDrop<
Option<windows::Win32::Graphics::Direct3D12::ID3D12Fence>,
>,
pub Value: u64,
}
#[repr(C)]
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DSTORAGE_ERROR_PARAMETERS_STATUS {
pub StatusArray: core::mem::ManuallyDrop<Option<IDStorageStatusArray>>,
pub Index: u32,
}
#[repr(C)]
pub struct DSTORAGE_ERROR_RECORD {
pub FailureCount: u32,
pub FirstFailure: DSTORAGE_ERROR_FIRST_FAILURE,
}
impl Clone for DSTORAGE_ERROR_RECORD {
fn clone(&self) -> Self {
unsafe { core::mem::transmute_copy(self) }
}
}
impl Default for DSTORAGE_ERROR_RECORD {
fn default() -> Self {
unsafe { core::mem::zeroed() }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct DSTORAGE_GET_REQUEST_FLAGS(pub u32);
impl DSTORAGE_GET_REQUEST_FLAGS {
pub const fn contains(&self, other: Self) -> bool {
self.0 & other.0 == other.0
}
}
impl core::ops::BitOr for DSTORAGE_GET_REQUEST_FLAGS {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl core::ops::BitAnd for DSTORAGE_GET_REQUEST_FLAGS {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
impl core::ops::BitOrAssign for DSTORAGE_GET_REQUEST_FLAGS {
fn bitor_assign(&mut self, other: Self) {
self.0.bitor_assign(other.0)
}
}
impl core::ops::BitAndAssign for DSTORAGE_GET_REQUEST_FLAGS {
fn bitand_assign(&mut self, other: Self) {
self.0.bitand_assign(other.0)
}
}
impl core::ops::Not for DSTORAGE_GET_REQUEST_FLAGS {
type Output = Self;
fn not(self) -> Self {
Self(self.0.not())
}
}
pub const DSTORAGE_GET_REQUEST_FLAG_SELECT_ALL: DSTORAGE_GET_REQUEST_FLAGS =
DSTORAGE_GET_REQUEST_FLAGS(3u32);
pub const DSTORAGE_GET_REQUEST_FLAG_SELECT_BUILTIN: DSTORAGE_GET_REQUEST_FLAGS =
DSTORAGE_GET_REQUEST_FLAGS(2u32);
pub const DSTORAGE_GET_REQUEST_FLAG_SELECT_CUSTOM: DSTORAGE_GET_REQUEST_FLAGS =
DSTORAGE_GET_REQUEST_FLAGS(1u32);
pub const DSTORAGE_MAX_QUEUE_CAPACITY: u32 = 8192u32;
pub const DSTORAGE_MIN_QUEUE_CAPACITY: u32 = 128u32;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct DSTORAGE_PRIORITY(pub i8);
pub const DSTORAGE_PRIORITY_COUNT: DSTORAGE_PRIORITY = DSTORAGE_PRIORITY(4i8);
pub const DSTORAGE_PRIORITY_FIRST: DSTORAGE_PRIORITY = DSTORAGE_PRIORITY(-1i8);
pub const DSTORAGE_PRIORITY_HIGH: DSTORAGE_PRIORITY = DSTORAGE_PRIORITY(1i8);
pub const DSTORAGE_PRIORITY_LAST: DSTORAGE_PRIORITY = DSTORAGE_PRIORITY(2i8);
pub const DSTORAGE_PRIORITY_LOW: DSTORAGE_PRIORITY = DSTORAGE_PRIORITY(-1i8);
pub const DSTORAGE_PRIORITY_NORMAL: DSTORAGE_PRIORITY = DSTORAGE_PRIORITY(0i8);
pub const DSTORAGE_PRIORITY_REALTIME: DSTORAGE_PRIORITY = DSTORAGE_PRIORITY(2i8);
#[repr(C)]
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DSTORAGE_QUEUE_DESC {
pub SourceType: DSTORAGE_REQUEST_SOURCE_TYPE,
pub Capacity: u16,
pub Priority: DSTORAGE_PRIORITY,
pub Name: windows_core::PCSTR,
pub Device: core::mem::ManuallyDrop<
Option<windows::Win32::Graphics::Direct3D12::ID3D12Device>,
>,
}
#[repr(C)]
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DSTORAGE_QUEUE_INFO {
pub Desc: DSTORAGE_QUEUE_DESC,
pub EmptySlotCount: u16,
pub RequestCountUntilAutoSubmit: u16,
}
#[repr(C)]
pub struct DSTORAGE_REQUEST {
pub Options: DSTORAGE_REQUEST_OPTIONS,
pub Source: DSTORAGE_SOURCE,
pub Destination: DSTORAGE_DESTINATION,
pub UncompressedSize: u32,
pub CancellationTag: u64,
pub Name: windows_core::PCSTR,
}
impl Clone for DSTORAGE_REQUEST {
fn clone(&self) -> Self {
unsafe { core::mem::transmute_copy(self) }
}
}
impl Default for DSTORAGE_REQUEST {
fn default() -> Self {
unsafe { core::mem::zeroed() }
}
}
pub const DSTORAGE_REQUEST_DESTINATION_BUFFER: DSTORAGE_REQUEST_DESTINATION_TYPE =
DSTORAGE_REQUEST_DESTINATION_TYPE(1u64);
pub const DSTORAGE_REQUEST_DESTINATION_MEMORY: DSTORAGE_REQUEST_DESTINATION_TYPE =
DSTORAGE_REQUEST_DESTINATION_TYPE(0u64);
pub const DSTORAGE_REQUEST_DESTINATION_MULTIPLE_SUBRESOURCES:
DSTORAGE_REQUEST_DESTINATION_TYPE = DSTORAGE_REQUEST_DESTINATION_TYPE(3u64);
pub const DSTORAGE_REQUEST_DESTINATION_MULTIPLE_SUBRESOURCES_RANGE:
DSTORAGE_REQUEST_DESTINATION_TYPE = DSTORAGE_REQUEST_DESTINATION_TYPE(5u64);
pub const DSTORAGE_REQUEST_DESTINATION_TEXTURE_REGION:
DSTORAGE_REQUEST_DESTINATION_TYPE = DSTORAGE_REQUEST_DESTINATION_TYPE(2u64);
pub const DSTORAGE_REQUEST_DESTINATION_TILES: DSTORAGE_REQUEST_DESTINATION_TYPE =
DSTORAGE_REQUEST_DESTINATION_TYPE(4u64);
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct DSTORAGE_REQUEST_DESTINATION_TYPE(pub u64);
pub const DSTORAGE_REQUEST_MAX_NAME: u32 = 64u32;
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct DSTORAGE_REQUEST_OPTIONS {
pub _bitfield1: u8,
pub Reserved1: [u8; 7],
pub _bitfield2: u64,
}
impl Default for DSTORAGE_REQUEST_OPTIONS {
fn default() -> Self {
unsafe { core::mem::zeroed() }
}
}
pub const DSTORAGE_REQUEST_SOURCE_FILE: DSTORAGE_REQUEST_SOURCE_TYPE =
DSTORAGE_REQUEST_SOURCE_TYPE(0u64);
pub const DSTORAGE_REQUEST_SOURCE_MEMORY: DSTORAGE_REQUEST_SOURCE_TYPE =
DSTORAGE_REQUEST_SOURCE_TYPE(1u64);
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct DSTORAGE_REQUEST_SOURCE_TYPE(pub u64);
pub const DSTORAGE_SDK_VERSION: u32 = 300u32;
#[repr(C)]
pub union DSTORAGE_SOURCE {
pub Memory: DSTORAGE_SOURCE_MEMORY,
pub File: core::mem::ManuallyDrop<DSTORAGE_SOURCE_FILE>,
}
impl Clone for DSTORAGE_SOURCE {
fn clone(&self) -> Self {
unsafe { core::mem::transmute_copy(self) }
}
}
impl Default for DSTORAGE_SOURCE {
fn default() -> Self {
unsafe { core::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DSTORAGE_SOURCE_FILE {
pub Source: core::mem::ManuallyDrop<Option<IDStorageFile>>,
pub Offset: u64,
pub Size: u32,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct DSTORAGE_SOURCE_MEMORY {
pub Source: *const core::ffi::c_void,
pub Size: u32,
}
impl Default for DSTORAGE_SOURCE_MEMORY {
fn default() -> Self {
unsafe { core::mem::zeroed() }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct DSTORAGE_STAGING_BUFFER_SIZE(pub u32);
pub const DSTORAGE_STAGING_BUFFER_SIZE_0: DSTORAGE_STAGING_BUFFER_SIZE =
DSTORAGE_STAGING_BUFFER_SIZE(0u32);
pub const DSTORAGE_STAGING_BUFFER_SIZE_32MB: DSTORAGE_STAGING_BUFFER_SIZE =
DSTORAGE_STAGING_BUFFER_SIZE(33554432u32);
pub const E_DSTORAGE_ACCESS_VIOLATION: windows_core::HRESULT =
windows_core::HRESULT(0x89240009_u32 as _);
pub const E_DSTORAGE_ALREADY_RUNNING: windows_core::HRESULT =
windows_core::HRESULT(0x89240001_u32 as _);
pub const E_DSTORAGE_BCPACK_BAD_DATA: windows_core::HRESULT =
windows_core::HRESULT(0x89240035_u32 as _);
pub const E_DSTORAGE_BCPACK_BAD_HEADER: windows_core::HRESULT =
windows_core::HRESULT(0x89240034_u32 as _);
pub const E_DSTORAGE_COMPRESSED_DATA_TOO_LARGE: windows_core::HRESULT =
windows_core::HRESULT(0x89240039_u32 as _);
pub const E_DSTORAGE_DECOMPRESSION_ERROR: windows_core::HRESULT =
windows_core::HRESULT(0x89240030_u32 as _);
pub const E_DSTORAGE_DECRYPTION_ERROR: windows_core::HRESULT =
windows_core::HRESULT(0x89240036_u32 as _);
pub const E_DSTORAGE_DEPRECATED_PREVIEW_GDK: windows_core::HRESULT =
windows_core::HRESULT(0x89240018_u32 as _);
pub const E_DSTORAGE_END_OF_FILE: windows_core::HRESULT =
windows_core::HRESULT(0x89240007_u32 as _);
pub const E_DSTORAGE_FILEBUFFERING_REQUIRES_DISABLED_BYPASSIO: windows_core::HRESULT =
windows_core::HRESULT(0x89240041_u32 as _);
pub const E_DSTORAGE_FILE_NOT_OPEN: windows_core::HRESULT =
windows_core::HRESULT(0x8924000B_u32 as _);
pub const E_DSTORAGE_FILE_TOO_FRAGMENTED: windows_core::HRESULT =
windows_core::HRESULT(0x89240038_u32 as _);
pub const E_DSTORAGE_INDEX_BOUND: windows_core::HRESULT =
windows_core::HRESULT(0x89240015_u32 as _);
pub const E_DSTORAGE_INVALID_BCPACK_MODE: windows_core::HRESULT =
windows_core::HRESULT(0x8924000D_u32 as _);
pub const E_DSTORAGE_INVALID_CLUSTER_SIZE: windows_core::HRESULT =
windows_core::HRESULT(0x89240011_u32 as _);
pub const E_DSTORAGE_INVALID_DESTINATION_SIZE: windows_core::HRESULT =
windows_core::HRESULT(0x8924000F_u32 as _);
pub const E_DSTORAGE_INVALID_DESTINATION_TYPE: windows_core::HRESULT =
windows_core::HRESULT(0x89240040_u32 as _);
pub const E_DSTORAGE_INVALID_FENCE: windows_core::HRESULT =
windows_core::HRESULT(0x89240022_u32 as _);
pub const E_DSTORAGE_INVALID_FILE_HANDLE: windows_core::HRESULT =
windows_core::HRESULT(0x89240017_u32 as _);
pub const E_DSTORAGE_INVALID_FILE_OFFSET: windows_core::HRESULT =
windows_core::HRESULT(0x8924001A_u32 as _);
pub const E_DSTORAGE_INVALID_INTERMEDIATE_SIZE: windows_core::HRESULT =
windows_core::HRESULT(0x8924001C_u32 as _);
pub const E_DSTORAGE_INVALID_MEMORY_QUEUE_PRIORITY: windows_core::HRESULT =
windows_core::HRESULT(0x89240024_u32 as _);
pub const E_DSTORAGE_INVALID_QUEUE_CAPACITY: windows_core::HRESULT =
windows_core::HRESULT(0x89240003_u32 as _);
pub const E_DSTORAGE_INVALID_QUEUE_PRIORITY: windows_core::HRESULT =
windows_core::HRESULT(0x89240013_u32 as _);
pub const E_DSTORAGE_INVALID_SOURCE_TYPE: windows_core::HRESULT =
windows_core::HRESULT(0x8924001B_u32 as _);
pub const E_DSTORAGE_INVALID_STAGING_BUFFER_SIZE: windows_core::HRESULT =
windows_core::HRESULT(0x89240020_u32 as _);
pub const E_DSTORAGE_INVALID_STATUS_ARRAY: windows_core::HRESULT =
windows_core::HRESULT(0x89240023_u32 as _);
pub const E_DSTORAGE_INVALID_SWIZZLE_MODE: windows_core::HRESULT =
windows_core::HRESULT(0x8924000E_u32 as _);
pub const E_DSTORAGE_IO_TIMEOUT: windows_core::HRESULT =
windows_core::HRESULT(0x89240016_u32 as _);
pub const E_DSTORAGE_NOT_RUNNING: windows_core::HRESULT =
windows_core::HRESULT(0x89240002_u32 as _);
pub const E_DSTORAGE_PASSTHROUGH_ERROR: windows_core::HRESULT =
windows_core::HRESULT(0x89240037_u32 as _);
pub const E_DSTORAGE_QUEUE_CLOSED: windows_core::HRESULT =
windows_core::HRESULT(0x89240010_u32 as _);
pub const E_DSTORAGE_REQUEST_TOO_LARGE: windows_core::HRESULT =
windows_core::HRESULT(0x89240008_u32 as _);
pub const E_DSTORAGE_RESERVED_FIELDS: windows_core::HRESULT =
windows_core::HRESULT(0x8924000C_u32 as _);
pub const E_DSTORAGE_STAGING_BUFFER_LOCKED: windows_core::HRESULT =
windows_core::HRESULT(0x8924001F_u32 as _);
pub const E_DSTORAGE_STAGING_BUFFER_TOO_SMALL: windows_core::HRESULT =
windows_core::HRESULT(0x89240021_u32 as _);
pub const E_DSTORAGE_SYSTEM_NOT_SUPPORTED: windows_core::HRESULT =
windows_core::HRESULT(0x8924001D_u32 as _);
pub const E_DSTORAGE_TOO_MANY_FILES: windows_core::HRESULT =
windows_core::HRESULT(0x89240014_u32 as _);
pub const E_DSTORAGE_TOO_MANY_QUEUES: windows_core::HRESULT =
windows_core::HRESULT(0x89240012_u32 as _);
pub const E_DSTORAGE_UNSUPPORTED_FILE: windows_core::HRESULT =
windows_core::HRESULT(0x8924000A_u32 as _);
pub const E_DSTORAGE_UNSUPPORTED_VOLUME: windows_core::HRESULT =
windows_core::HRESULT(0x89240005_u32 as _);
pub const E_DSTORAGE_XVD_DEVICE_NOT_SUPPORTED: windows_core::HRESULT =
windows_core::HRESULT(0x89240004_u32 as _);
pub const E_DSTORAGE_XVD_NOT_REGISTERED: windows_core::HRESULT =
windows_core::HRESULT(0x89240019_u32 as _);
pub const E_DSTORAGE_ZLIB_BAD_DATA: windows_core::HRESULT =
windows_core::HRESULT(0x89240032_u32 as _);
pub const E_DSTORAGE_ZLIB_BAD_HEADER: windows_core::HRESULT =
windows_core::HRESULT(0x89240031_u32 as _);
pub const E_DSTORAGE_ZLIB_PARITY_FAIL: windows_core::HRESULT =
windows_core::HRESULT(0x89240033_u32 as _);
pub const FACILITY_GAME: u32 = 2340u32;
windows_core::imp::define_interface!(
IDStorageCompressionCodec,
IDStorageCompressionCodec_Vtbl,
0x84ef5121_9b43_4d03_b5c1_cc34606b262d
);
windows_core::imp::interface_hierarchy!(
IDStorageCompressionCodec,
windows_core::IUnknown
);
impl IDStorageCompressionCodec {
pub unsafe fn CompressBuffer(
&self,
uncompresseddata: *const core::ffi::c_void,
uncompresseddatasize: usize,
compressionsetting: DSTORAGE_COMPRESSION,
compressedbuffer: *mut core::ffi::c_void,
compressedbuffersize: usize,
compresseddatasize: *mut usize,
) -> windows_core::Result<()> {
unsafe {
(windows_core::Interface::vtable(self).CompressBuffer)(
windows_core::Interface::as_raw(self),
uncompresseddata,
uncompresseddatasize,
compressionsetting,
compressedbuffer as _,
compressedbuffersize,
compresseddatasize as _,
)
.ok()
}
}
pub unsafe fn DecompressBuffer(
&self,
compresseddata: *const core::ffi::c_void,
compresseddatasize: usize,
uncompressedbuffer: *mut core::ffi::c_void,
uncompressedbuffersize: usize,
uncompresseddatasize: *mut usize,
) -> windows_core::Result<()> {
unsafe {
(windows_core::Interface::vtable(self).DecompressBuffer)(
windows_core::Interface::as_raw(self),
compresseddata,
compresseddatasize,
uncompressedbuffer as _,
uncompressedbuffersize,
uncompresseddatasize as _,
)
.ok()
}
}
pub unsafe fn CompressBufferBound(&self, uncompresseddatasize: usize) -> usize {
unsafe {
(windows_core::Interface::vtable(self).CompressBufferBound)(
windows_core::Interface::as_raw(self),
uncompresseddatasize,
)
}
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDStorageCompressionCodec_Vtbl {
pub base__: windows_core::IUnknown_Vtbl,
pub CompressBuffer: unsafe extern "system" fn(
*mut core::ffi::c_void,
*const core::ffi::c_void,
usize,
DSTORAGE_COMPRESSION,
*mut core::ffi::c_void,
usize,
*mut usize,
)
-> windows_core::HRESULT,
pub DecompressBuffer: unsafe extern "system" fn(
*mut core::ffi::c_void,
*const core::ffi::c_void,
usize,
*mut core::ffi::c_void,
usize,
*mut usize,
)
-> windows_core::HRESULT,
pub CompressBufferBound:
unsafe extern "system" fn(*mut core::ffi::c_void, usize) -> usize,
}
pub trait IDStorageCompressionCodec_Impl: windows_core::IUnknownImpl {
fn CompressBuffer(
&self,
uncompresseddata: *const core::ffi::c_void,
uncompresseddatasize: usize,
compressionsetting: DSTORAGE_COMPRESSION,
compressedbuffer: *mut core::ffi::c_void,
compressedbuffersize: usize,
compresseddatasize: *mut usize,
) -> windows_core::Result<()>;
fn DecompressBuffer(
&self,
compresseddata: *const core::ffi::c_void,
compresseddatasize: usize,
uncompressedbuffer: *mut core::ffi::c_void,
uncompressedbuffersize: usize,
uncompresseddatasize: *mut usize,
) -> windows_core::Result<()>;
fn CompressBufferBound(&self, uncompresseddatasize: usize) -> usize;
}
impl IDStorageCompressionCodec_Vtbl {
pub const fn new<Identity: IDStorageCompressionCodec_Impl, const OFFSET: isize>(
) -> Self {
unsafe extern "system" fn CompressBuffer<
Identity: IDStorageCompressionCodec_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
uncompresseddata: *const core::ffi::c_void,
uncompresseddatasize: usize,
compressionsetting: DSTORAGE_COMPRESSION,
compressedbuffer: *mut core::ffi::c_void,
compressedbuffersize: usize,
compresseddatasize: *mut usize,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageCompressionCodec_Impl::CompressBuffer(
this,
core::mem::transmute_copy(&uncompresseddata),
core::mem::transmute_copy(&uncompresseddatasize),
core::mem::transmute_copy(&compressionsetting),
core::mem::transmute_copy(&compressedbuffer),
core::mem::transmute_copy(&compressedbuffersize),
core::mem::transmute_copy(&compresseddatasize),
)
.into()
}
}
unsafe extern "system" fn DecompressBuffer<
Identity: IDStorageCompressionCodec_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
compresseddata: *const core::ffi::c_void,
compresseddatasize: usize,
uncompressedbuffer: *mut core::ffi::c_void,
uncompressedbuffersize: usize,
uncompresseddatasize: *mut usize,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageCompressionCodec_Impl::DecompressBuffer(
this,
core::mem::transmute_copy(&compresseddata),
core::mem::transmute_copy(&compresseddatasize),
core::mem::transmute_copy(&uncompressedbuffer),
core::mem::transmute_copy(&uncompressedbuffersize),
core::mem::transmute_copy(&uncompresseddatasize),
)
.into()
}
}
unsafe extern "system" fn CompressBufferBound<
Identity: IDStorageCompressionCodec_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
uncompresseddatasize: usize,
) -> usize {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageCompressionCodec_Impl::CompressBufferBound(
this,
core::mem::transmute_copy(&uncompresseddatasize),
)
}
}
Self {
base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
CompressBuffer: CompressBuffer::<Identity, OFFSET>,
DecompressBuffer: DecompressBuffer::<Identity, OFFSET>,
CompressBufferBound: CompressBufferBound::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDStorageCompressionCodec as windows_core::Interface>::IID
}
}
impl windows_core::RuntimeName for IDStorageCompressionCodec {}
windows_core::imp::define_interface!(
IDStorageCustomDecompressionQueue,
IDStorageCustomDecompressionQueue_Vtbl,
0x97179b2f_2c21_49ca_8291_4e1bf4a160df
);
windows_core::imp::interface_hierarchy!(
IDStorageCustomDecompressionQueue,
windows_core::IUnknown
);
impl IDStorageCustomDecompressionQueue {
pub unsafe fn GetEvent(&self) -> windows::Win32::Foundation::HANDLE {
unsafe {
(windows_core::Interface::vtable(self).GetEvent)(
windows_core::Interface::as_raw(self),
)
}
}
pub unsafe fn GetRequests(
&self,
requests: &mut [DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST],
numrequests: *mut u32,
) -> windows_core::Result<()> {
unsafe {
(windows_core::Interface::vtable(self).GetRequests)(
windows_core::Interface::as_raw(self),
requests.len().try_into().unwrap(),
core::mem::transmute(requests.as_ptr()),
numrequests as _,
)
.ok()
}
}
pub unsafe fn SetRequestResults(
&self,
results: &[DSTORAGE_CUSTOM_DECOMPRESSION_RESULT],
) -> windows_core::Result<()> {
unsafe {
(windows_core::Interface::vtable(self).SetRequestResults)(
windows_core::Interface::as_raw(self),
results.len().try_into().unwrap(),
core::mem::transmute(results.as_ptr()),
)
.ok()
}
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDStorageCustomDecompressionQueue_Vtbl {
pub base__: windows_core::IUnknown_Vtbl,
pub GetEvent: unsafe extern "system" fn(
*mut core::ffi::c_void,
)
-> windows::Win32::Foundation::HANDLE,
pub GetRequests: unsafe extern "system" fn(
*mut core::ffi::c_void,
u32,
*mut DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST,
*mut u32,
)
-> windows_core::HRESULT,
pub SetRequestResults: unsafe extern "system" fn(
*mut core::ffi::c_void,
u32,
*const DSTORAGE_CUSTOM_DECOMPRESSION_RESULT,
)
-> windows_core::HRESULT,
}
pub trait IDStorageCustomDecompressionQueue_Impl: windows_core::IUnknownImpl {
fn GetEvent(&self) -> windows::Win32::Foundation::HANDLE;
fn GetRequests(
&self,
maxrequests: u32,
requests: *mut DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST,
numrequests: *mut u32,
) -> windows_core::Result<()>;
fn SetRequestResults(
&self,
numresults: u32,
results: *const DSTORAGE_CUSTOM_DECOMPRESSION_RESULT,
) -> windows_core::Result<()>;
}
impl IDStorageCustomDecompressionQueue_Vtbl {
pub const fn new<
Identity: IDStorageCustomDecompressionQueue_Impl,
const OFFSET: isize,
>() -> Self {
unsafe extern "system" fn GetEvent<
Identity: IDStorageCustomDecompressionQueue_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
) -> windows::Win32::Foundation::HANDLE {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageCustomDecompressionQueue_Impl::GetEvent(this)
}
}
unsafe extern "system" fn GetRequests<
Identity: IDStorageCustomDecompressionQueue_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
maxrequests: u32,
requests: *mut DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST,
numrequests: *mut u32,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageCustomDecompressionQueue_Impl::GetRequests(
this,
core::mem::transmute_copy(&maxrequests),
core::mem::transmute_copy(&requests),
core::mem::transmute_copy(&numrequests),
)
.into()
}
}
unsafe extern "system" fn SetRequestResults<
Identity: IDStorageCustomDecompressionQueue_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
numresults: u32,
results: *const DSTORAGE_CUSTOM_DECOMPRESSION_RESULT,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageCustomDecompressionQueue_Impl::SetRequestResults(
this,
core::mem::transmute_copy(&numresults),
core::mem::transmute_copy(&results),
)
.into()
}
}
Self {
base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
GetEvent: GetEvent::<Identity, OFFSET>,
GetRequests: GetRequests::<Identity, OFFSET>,
SetRequestResults: SetRequestResults::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDStorageCustomDecompressionQueue as windows_core::Interface>::IID
}
}
impl windows_core::RuntimeName for IDStorageCustomDecompressionQueue {}
windows_core::imp::define_interface!(
IDStorageCustomDecompressionQueue1,
IDStorageCustomDecompressionQueue1_Vtbl,
0x0d47c6c9_e61a_4706_93b4_68bfe3f4aa4a
);
impl core::ops::Deref for IDStorageCustomDecompressionQueue1 {
type Target = IDStorageCustomDecompressionQueue;
fn deref(&self) -> &Self::Target {
unsafe { core::mem::transmute(self) }
}
}
windows_core::imp::interface_hierarchy!(
IDStorageCustomDecompressionQueue1,
windows_core::IUnknown,
IDStorageCustomDecompressionQueue
);
impl IDStorageCustomDecompressionQueue1 {
pub unsafe fn GetRequests1(
&self,
flags: DSTORAGE_GET_REQUEST_FLAGS,
requests: &mut [DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST],
numrequests: *mut u32,
) -> windows_core::Result<()> {
unsafe {
(windows_core::Interface::vtable(self).GetRequests1)(
windows_core::Interface::as_raw(self),
flags,
requests.len().try_into().unwrap(),
core::mem::transmute(requests.as_ptr()),
numrequests as _,
)
.ok()
}
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDStorageCustomDecompressionQueue1_Vtbl {
pub base__: IDStorageCustomDecompressionQueue_Vtbl,
pub GetRequests1: unsafe extern "system" fn(
*mut core::ffi::c_void,
DSTORAGE_GET_REQUEST_FLAGS,
u32,
*mut DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST,
*mut u32,
)
-> windows_core::HRESULT,
}
pub trait IDStorageCustomDecompressionQueue1_Impl:
IDStorageCustomDecompressionQueue_Impl
{
fn GetRequests1(
&self,
flags: DSTORAGE_GET_REQUEST_FLAGS,
maxrequests: u32,
requests: *mut DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST,
numrequests: *mut u32,
) -> windows_core::Result<()>;
}
impl IDStorageCustomDecompressionQueue1_Vtbl {
pub const fn new<
Identity: IDStorageCustomDecompressionQueue1_Impl,
const OFFSET: isize,
>() -> Self {
unsafe extern "system" fn GetRequests1<
Identity: IDStorageCustomDecompressionQueue1_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
flags: DSTORAGE_GET_REQUEST_FLAGS,
maxrequests: u32,
requests: *mut DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST,
numrequests: *mut u32,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageCustomDecompressionQueue1_Impl::GetRequests1(
this,
core::mem::transmute_copy(&flags),
core::mem::transmute_copy(&maxrequests),
core::mem::transmute_copy(&requests),
core::mem::transmute_copy(&numrequests),
)
.into()
}
}
Self {
base__: IDStorageCustomDecompressionQueue_Vtbl::new::<Identity, OFFSET>(),
GetRequests1: GetRequests1::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDStorageCustomDecompressionQueue1 as windows_core::Interface>::IID
|| iid
== &<IDStorageCustomDecompressionQueue as windows_core::Interface>::IID
}
}
impl windows_core::RuntimeName for IDStorageCustomDecompressionQueue1 {}
windows_core::imp::define_interface!(
IDStorageFactory,
IDStorageFactory_Vtbl,
0x6924ea0c_c3cd_4826_b10a_f64f4ed927c1
);
windows_core::imp::interface_hierarchy!(IDStorageFactory, windows_core::IUnknown);
impl IDStorageFactory {
pub unsafe fn CreateQueue<T>(
&self,
desc: *const DSTORAGE_QUEUE_DESC,
) -> windows_core::Result<T>
where
T: windows_core::Interface,
{
let mut result__ = core::ptr::null_mut();
unsafe {
(windows_core::Interface::vtable(self).CreateQueue)(
windows_core::Interface::as_raw(self),
core::mem::transmute(desc),
&T::IID,
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub unsafe fn OpenFile<P0, T>(&self, path: P0) -> windows_core::Result<T>
where
P0: windows_core::Param<windows_core::PCWSTR>,
T: windows_core::Interface,
{
let mut result__ = core::ptr::null_mut();
unsafe {
(windows_core::Interface::vtable(self).OpenFile)(
windows_core::Interface::as_raw(self),
path.param().abi(),
&T::IID,
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub unsafe fn CreateStatusArray<P1, T>(
&self,
capacity: u32,
name: P1,
) -> windows_core::Result<T>
where
P1: windows_core::Param<windows_core::PCSTR>,
T: windows_core::Interface,
{
let mut result__ = core::ptr::null_mut();
unsafe {
(windows_core::Interface::vtable(self).CreateStatusArray)(
windows_core::Interface::as_raw(self),
capacity,
name.param().abi(),
&T::IID,
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub unsafe fn SetDebugFlags(&self, flags: DSTORAGE_DEBUG) {
unsafe {
(windows_core::Interface::vtable(self).SetDebugFlags)(
windows_core::Interface::as_raw(self),
flags.0 as _,
)
}
}
pub unsafe fn SetStagingBufferSize(&self, size: u32) -> windows_core::Result<()> {
unsafe {
(windows_core::Interface::vtable(self).SetStagingBufferSize)(
windows_core::Interface::as_raw(self),
size,
)
.ok()
}
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDStorageFactory_Vtbl {
pub base__: windows_core::IUnknown_Vtbl,
pub CreateQueue: unsafe extern "system" fn(
*mut core::ffi::c_void,
*const DSTORAGE_QUEUE_DESC,
*const windows_core::GUID,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub OpenFile: unsafe extern "system" fn(
*mut core::ffi::c_void,
windows_core::PCWSTR,
*const windows_core::GUID,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub CreateStatusArray: unsafe extern "system" fn(
*mut core::ffi::c_void,
u32,
windows_core::PCSTR,
*const windows_core::GUID,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub SetDebugFlags: unsafe extern "system" fn(*mut core::ffi::c_void, u32),
pub SetStagingBufferSize:
unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT,
}
pub trait IDStorageFactory_Impl: windows_core::IUnknownImpl {
fn CreateQueue(
&self,
desc: *const DSTORAGE_QUEUE_DESC,
riid: *const windows_core::GUID,
ppv: *mut *mut core::ffi::c_void,
) -> windows_core::Result<()>;
fn OpenFile(
&self,
path: &windows_core::PCWSTR,
riid: *const windows_core::GUID,
ppv: *mut *mut core::ffi::c_void,
) -> windows_core::Result<()>;
fn CreateStatusArray(
&self,
capacity: u32,
name: &windows_core::PCSTR,
riid: *const windows_core::GUID,
ppv: *mut *mut core::ffi::c_void,
) -> windows_core::Result<()>;
fn SetDebugFlags(&self, flags: &DSTORAGE_DEBUG);
fn SetStagingBufferSize(&self, size: u32) -> windows_core::Result<()>;
}
impl IDStorageFactory_Vtbl {
pub const fn new<Identity: IDStorageFactory_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn CreateQueue<
Identity: IDStorageFactory_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
desc: *const DSTORAGE_QUEUE_DESC,
riid: *const windows_core::GUID,
ppv: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageFactory_Impl::CreateQueue(
this,
core::mem::transmute_copy(&desc),
core::mem::transmute_copy(&riid),
core::mem::transmute_copy(&ppv),
)
.into()
}
}
unsafe extern "system" fn OpenFile<
Identity: IDStorageFactory_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
path: windows_core::PCWSTR,
riid: *const windows_core::GUID,
ppv: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageFactory_Impl::OpenFile(
this,
core::mem::transmute(&path),
core::mem::transmute_copy(&riid),
core::mem::transmute_copy(&ppv),
)
.into()
}
}
unsafe extern "system" fn CreateStatusArray<
Identity: IDStorageFactory_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
capacity: u32,
name: windows_core::PCSTR,
riid: *const windows_core::GUID,
ppv: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageFactory_Impl::CreateStatusArray(
this,
core::mem::transmute_copy(&capacity),
core::mem::transmute(&name),
core::mem::transmute_copy(&riid),
core::mem::transmute_copy(&ppv),
)
.into()
}
}
unsafe extern "system" fn SetDebugFlags<
Identity: IDStorageFactory_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
flags: u32,
) {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageFactory_Impl::SetDebugFlags(this, core::mem::transmute(&flags))
}
}
unsafe extern "system" fn SetStagingBufferSize<
Identity: IDStorageFactory_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
size: u32,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageFactory_Impl::SetStagingBufferSize(
this,
core::mem::transmute_copy(&size),
)
.into()
}
}
Self {
base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
CreateQueue: CreateQueue::<Identity, OFFSET>,
OpenFile: OpenFile::<Identity, OFFSET>,
CreateStatusArray: CreateStatusArray::<Identity, OFFSET>,
SetDebugFlags: SetDebugFlags::<Identity, OFFSET>,
SetStagingBufferSize: SetStagingBufferSize::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDStorageFactory as windows_core::Interface>::IID
}
}
impl windows_core::RuntimeName for IDStorageFactory {}
windows_core::imp::define_interface!(
IDStorageFile,
IDStorageFile_Vtbl,
0x5de95e7b_955a_4868_a73c_243b29f4b8da
);
windows_core::imp::interface_hierarchy!(IDStorageFile, windows_core::IUnknown);
impl IDStorageFile {
pub unsafe fn Close(&self) {
unsafe {
(windows_core::Interface::vtable(self).Close)(
windows_core::Interface::as_raw(self),
)
}
}
pub unsafe fn GetFileInformation(
&self,
info: *mut windows::Win32::Storage::FileSystem::BY_HANDLE_FILE_INFORMATION,
) -> windows_core::Result<()> {
unsafe {
(windows_core::Interface::vtable(self).GetFileInformation)(
windows_core::Interface::as_raw(self),
info as _,
)
.ok()
}
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDStorageFile_Vtbl {
pub base__: windows_core::IUnknown_Vtbl,
pub Close: unsafe extern "system" fn(*mut core::ffi::c_void),
pub GetFileInformation: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut windows::Win32::Storage::FileSystem::BY_HANDLE_FILE_INFORMATION,
)
-> windows_core::HRESULT,
}
pub trait IDStorageFile_Impl: windows_core::IUnknownImpl {
fn Close(&self);
fn GetFileInformation(
&self,
info: *mut windows::Win32::Storage::FileSystem::BY_HANDLE_FILE_INFORMATION,
) -> windows_core::Result<()>;
}
impl IDStorageFile_Vtbl {
pub const fn new<Identity: IDStorageFile_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Close<
Identity: IDStorageFile_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
) {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageFile_Impl::Close(this)
}
}
unsafe extern "system" fn GetFileInformation<
Identity: IDStorageFile_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
info: *mut windows::Win32::Storage::FileSystem::BY_HANDLE_FILE_INFORMATION,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageFile_Impl::GetFileInformation(
this,
core::mem::transmute_copy(&info),
)
.into()
}
}
Self {
base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
Close: Close::<Identity, OFFSET>,
GetFileInformation: GetFileInformation::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDStorageFile as windows_core::Interface>::IID
}
}
impl windows_core::RuntimeName for IDStorageFile {}
windows_core::imp::define_interface!(
IDStorageQueue,
IDStorageQueue_Vtbl,
0xcfdbd83f_9e06_4fda_8ea5_69042137f49b
);
windows_core::imp::interface_hierarchy!(IDStorageQueue, windows_core::IUnknown);
impl IDStorageQueue {
pub unsafe fn EnqueueRequest(&self, request: *const DSTORAGE_REQUEST) {
unsafe {
(windows_core::Interface::vtable(self).EnqueueRequest)(
windows_core::Interface::as_raw(self),
core::mem::transmute(request),
)
}
}
pub unsafe fn EnqueueStatus<P0>(&self, statusarray: P0, index: u32)
where
P0: windows_core::Param<IDStorageStatusArray>,
{
unsafe {
(windows_core::Interface::vtable(self).EnqueueStatus)(
windows_core::Interface::as_raw(self),
statusarray.param().abi(),
index,
)
}
}
pub unsafe fn EnqueueSignal<P0>(&self, fence: P0, value: u64)
where
P0: windows_core::Param<windows::Win32::Graphics::Direct3D12::ID3D12Fence>,
{
unsafe {
(windows_core::Interface::vtable(self).EnqueueSignal)(
windows_core::Interface::as_raw(self),
fence.param().abi(),
value,
)
}
}
pub unsafe fn Submit(&self) {
unsafe {
(windows_core::Interface::vtable(self).Submit)(
windows_core::Interface::as_raw(self),
)
}
}
pub unsafe fn CancelRequestsWithTag(&self, mask: u64, value: u64) {
unsafe {
(windows_core::Interface::vtable(self).CancelRequestsWithTag)(
windows_core::Interface::as_raw(self),
mask,
value,
)
}
}
pub unsafe fn Close(&self) {
unsafe {
(windows_core::Interface::vtable(self).Close)(
windows_core::Interface::as_raw(self),
)
}
}
pub unsafe fn GetErrorEvent(&self) -> windows::Win32::Foundation::HANDLE {
unsafe {
(windows_core::Interface::vtable(self).GetErrorEvent)(
windows_core::Interface::as_raw(self),
)
}
}
pub unsafe fn RetrieveErrorRecord(&self) -> DSTORAGE_ERROR_RECORD {
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(self).RetrieveErrorRecord)(
windows_core::Interface::as_raw(self),
&mut result__,
);
core::mem::transmute(result__)
}
}
pub unsafe fn Query(&self) -> DSTORAGE_QUEUE_INFO {
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(self).Query)(
windows_core::Interface::as_raw(self),
&mut result__,
);
core::mem::transmute(result__)
}
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDStorageQueue_Vtbl {
pub base__: windows_core::IUnknown_Vtbl,
pub EnqueueRequest:
unsafe extern "system" fn(*mut core::ffi::c_void, *const DSTORAGE_REQUEST),
pub EnqueueStatus:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut core::ffi::c_void, u32),
pub EnqueueSignal:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut core::ffi::c_void, u64),
pub Submit: unsafe extern "system" fn(*mut core::ffi::c_void),
pub CancelRequestsWithTag:
unsafe extern "system" fn(*mut core::ffi::c_void, u64, u64),
pub Close: unsafe extern "system" fn(*mut core::ffi::c_void),
pub GetErrorEvent: unsafe extern "system" fn(
*mut core::ffi::c_void,
)
-> windows::Win32::Foundation::HANDLE,
pub RetrieveErrorRecord:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut DSTORAGE_ERROR_RECORD),
pub Query:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut DSTORAGE_QUEUE_INFO),
}
pub trait IDStorageQueue_Impl: windows_core::IUnknownImpl {
fn EnqueueRequest(&self, request: *const DSTORAGE_REQUEST);
fn EnqueueStatus(
&self,
statusarray: windows_core::Ref<IDStorageStatusArray>,
index: u32,
);
fn EnqueueSignal(
&self,
fence: windows_core::Ref<windows::Win32::Graphics::Direct3D12::ID3D12Fence>,
value: u64,
);
fn Submit(&self);
fn CancelRequestsWithTag(&self, mask: u64, value: u64);
fn Close(&self);
fn GetErrorEvent(&self) -> windows::Win32::Foundation::HANDLE;
fn RetrieveErrorRecord(&self, record: *mut DSTORAGE_ERROR_RECORD);
fn Query(&self, info: *mut DSTORAGE_QUEUE_INFO);
}
impl IDStorageQueue_Vtbl {
pub const fn new<Identity: IDStorageQueue_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn EnqueueRequest<
Identity: IDStorageQueue_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
request: *const DSTORAGE_REQUEST,
) {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageQueue_Impl::EnqueueRequest(
this,
core::mem::transmute_copy(&request),
)
}
}
unsafe extern "system" fn EnqueueStatus<
Identity: IDStorageQueue_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
statusarray: *mut core::ffi::c_void,
index: u32,
) {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageQueue_Impl::EnqueueStatus(
this,
core::mem::transmute_copy(&statusarray),
core::mem::transmute_copy(&index),
)
}
}
unsafe extern "system" fn EnqueueSignal<
Identity: IDStorageQueue_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
fence: *mut core::ffi::c_void,
value: u64,
) {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageQueue_Impl::EnqueueSignal(
this,
core::mem::transmute_copy(&fence),
core::mem::transmute_copy(&value),
)
}
}
unsafe extern "system" fn Submit<
Identity: IDStorageQueue_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
) {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageQueue_Impl::Submit(this)
}
}
unsafe extern "system" fn CancelRequestsWithTag<
Identity: IDStorageQueue_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
mask: u64,
value: u64,
) {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageQueue_Impl::CancelRequestsWithTag(
this,
core::mem::transmute_copy(&mask),
core::mem::transmute_copy(&value),
)
}
}
unsafe extern "system" fn Close<
Identity: IDStorageQueue_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
) {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageQueue_Impl::Close(this)
}
}
unsafe extern "system" fn GetErrorEvent<
Identity: IDStorageQueue_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
) -> windows::Win32::Foundation::HANDLE {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageQueue_Impl::GetErrorEvent(this)
}
}
unsafe extern "system" fn RetrieveErrorRecord<
Identity: IDStorageQueue_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
record: *mut DSTORAGE_ERROR_RECORD,
) {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageQueue_Impl::RetrieveErrorRecord(
this,
core::mem::transmute_copy(&record),
)
}
}
unsafe extern "system" fn Query<
Identity: IDStorageQueue_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
info: *mut DSTORAGE_QUEUE_INFO,
) {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageQueue_Impl::Query(this, core::mem::transmute_copy(&info))
}
}
Self {
base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
EnqueueRequest: EnqueueRequest::<Identity, OFFSET>,
EnqueueStatus: EnqueueStatus::<Identity, OFFSET>,
EnqueueSignal: EnqueueSignal::<Identity, OFFSET>,
Submit: Submit::<Identity, OFFSET>,
CancelRequestsWithTag: CancelRequestsWithTag::<Identity, OFFSET>,
Close: Close::<Identity, OFFSET>,
GetErrorEvent: GetErrorEvent::<Identity, OFFSET>,
RetrieveErrorRecord: RetrieveErrorRecord::<Identity, OFFSET>,
Query: Query::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDStorageQueue as windows_core::Interface>::IID
}
}
impl windows_core::RuntimeName for IDStorageQueue {}
windows_core::imp::define_interface!(
IDStorageQueue1,
IDStorageQueue1_Vtbl,
0xdd2f482c_5eff_41e8_9c9e_d2374b278128
);
impl core::ops::Deref for IDStorageQueue1 {
type Target = IDStorageQueue;
fn deref(&self) -> &Self::Target {
unsafe { core::mem::transmute(self) }
}
}
windows_core::imp::interface_hierarchy!(
IDStorageQueue1,
windows_core::IUnknown,
IDStorageQueue
);
impl IDStorageQueue1 {
pub unsafe fn EnqueueSetEvent(&self, handle: windows::Win32::Foundation::HANDLE) {
unsafe {
(windows_core::Interface::vtable(self).EnqueueSetEvent)(
windows_core::Interface::as_raw(self),
handle,
)
}
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDStorageQueue1_Vtbl {
pub base__: IDStorageQueue_Vtbl,
pub EnqueueSetEvent: unsafe extern "system" fn(
*mut core::ffi::c_void,
windows::Win32::Foundation::HANDLE,
),
}
pub trait IDStorageQueue1_Impl: IDStorageQueue_Impl {
fn EnqueueSetEvent(&self, handle: windows::Win32::Foundation::HANDLE);
}
impl IDStorageQueue1_Vtbl {
pub const fn new<Identity: IDStorageQueue1_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn EnqueueSetEvent<
Identity: IDStorageQueue1_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
handle: windows::Win32::Foundation::HANDLE,
) {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageQueue1_Impl::EnqueueSetEvent(
this,
core::mem::transmute_copy(&handle),
)
}
}
Self {
base__: IDStorageQueue_Vtbl::new::<Identity, OFFSET>(),
EnqueueSetEvent: EnqueueSetEvent::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDStorageQueue1 as windows_core::Interface>::IID
|| iid == &<IDStorageQueue as windows_core::Interface>::IID
}
}
impl windows_core::RuntimeName for IDStorageQueue1 {}
windows_core::imp::define_interface!(
IDStorageQueue2,
IDStorageQueue2_Vtbl,
0xb1c9d643_3a49_44a2_b46f_653649470d18
);
impl core::ops::Deref for IDStorageQueue2 {
type Target = IDStorageQueue1;
fn deref(&self) -> &Self::Target {
unsafe { core::mem::transmute(self) }
}
}
windows_core::imp::interface_hierarchy!(
IDStorageQueue2,
windows_core::IUnknown,
IDStorageQueue,
IDStorageQueue1
);
impl IDStorageQueue2 {
pub unsafe fn GetCompressionSupport(
&self,
format: DSTORAGE_COMPRESSION_FORMAT,
) -> DSTORAGE_COMPRESSION_SUPPORT {
unsafe {
(windows_core::Interface::vtable(self).GetCompressionSupport)(
windows_core::Interface::as_raw(self),
format,
)
}
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDStorageQueue2_Vtbl {
pub base__: IDStorageQueue1_Vtbl,
pub GetCompressionSupport:
unsafe extern "system" fn(
*mut core::ffi::c_void,
DSTORAGE_COMPRESSION_FORMAT,
) -> DSTORAGE_COMPRESSION_SUPPORT,
}
pub trait IDStorageQueue2_Impl: IDStorageQueue1_Impl {
fn GetCompressionSupport(
&self,
format: DSTORAGE_COMPRESSION_FORMAT,
) -> DSTORAGE_COMPRESSION_SUPPORT;
}
impl IDStorageQueue2_Vtbl {
pub const fn new<Identity: IDStorageQueue2_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn GetCompressionSupport<
Identity: IDStorageQueue2_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
format: DSTORAGE_COMPRESSION_FORMAT,
) -> DSTORAGE_COMPRESSION_SUPPORT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageQueue2_Impl::GetCompressionSupport(
this,
core::mem::transmute_copy(&format),
)
}
}
Self {
base__: IDStorageQueue1_Vtbl::new::<Identity, OFFSET>(),
GetCompressionSupport: GetCompressionSupport::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDStorageQueue2 as windows_core::Interface>::IID
|| iid == &<IDStorageQueue as windows_core::Interface>::IID
|| iid == &<IDStorageQueue1 as windows_core::Interface>::IID
}
}
impl windows_core::RuntimeName for IDStorageQueue2 {}
windows_core::imp::define_interface!(
IDStorageQueue3,
IDStorageQueue3_Vtbl,
0xdeb54c52_eca8_46b3_82a7_031b72262653
);
impl core::ops::Deref for IDStorageQueue3 {
type Target = IDStorageQueue2;
fn deref(&self) -> &Self::Target {
unsafe { core::mem::transmute(self) }
}
}
windows_core::imp::interface_hierarchy!(
IDStorageQueue3,
windows_core::IUnknown,
IDStorageQueue,
IDStorageQueue1,
IDStorageQueue2
);
impl IDStorageQueue3 {
pub unsafe fn EnqueueRequests<P2>(
&self,
requests: &[DSTORAGE_REQUEST],
fence: P2,
value: u64,
flag: DSTORAGE_ENQUEUE_REQUEST_FLAGS,
) where
P2: windows_core::Param<windows::Win32::Graphics::Direct3D12::ID3D12Fence>,
{
unsafe {
(windows_core::Interface::vtable(self).EnqueueRequests)(
windows_core::Interface::as_raw(self),
core::mem::transmute(requests.as_ptr()),
requests.len().try_into().unwrap(),
fence.param().abi(),
value,
flag,
)
}
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDStorageQueue3_Vtbl {
pub base__: IDStorageQueue2_Vtbl,
pub EnqueueRequests: unsafe extern "system" fn(
*mut core::ffi::c_void,
*const DSTORAGE_REQUEST,
u32,
*mut core::ffi::c_void,
u64,
DSTORAGE_ENQUEUE_REQUEST_FLAGS,
),
}
pub trait IDStorageQueue3_Impl: IDStorageQueue2_Impl {
fn EnqueueRequests(
&self,
requests: *const DSTORAGE_REQUEST,
numrequests: u32,
fence: windows_core::Ref<windows::Win32::Graphics::Direct3D12::ID3D12Fence>,
value: u64,
flag: DSTORAGE_ENQUEUE_REQUEST_FLAGS,
);
}
impl IDStorageQueue3_Vtbl {
pub const fn new<Identity: IDStorageQueue3_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn EnqueueRequests<
Identity: IDStorageQueue3_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
requests: *const DSTORAGE_REQUEST,
numrequests: u32,
fence: *mut core::ffi::c_void,
value: u64,
flag: DSTORAGE_ENQUEUE_REQUEST_FLAGS,
) {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageQueue3_Impl::EnqueueRequests(
this,
core::mem::transmute_copy(&requests),
core::mem::transmute_copy(&numrequests),
core::mem::transmute_copy(&fence),
core::mem::transmute_copy(&value),
core::mem::transmute_copy(&flag),
)
}
}
Self {
base__: IDStorageQueue2_Vtbl::new::<Identity, OFFSET>(),
EnqueueRequests: EnqueueRequests::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDStorageQueue3 as windows_core::Interface>::IID
|| iid == &<IDStorageQueue as windows_core::Interface>::IID
|| iid == &<IDStorageQueue1 as windows_core::Interface>::IID
|| iid == &<IDStorageQueue2 as windows_core::Interface>::IID
}
}
impl windows_core::RuntimeName for IDStorageQueue3 {}
windows_core::imp::define_interface!(
IDStorageStatusArray,
IDStorageStatusArray_Vtbl,
0x82397587_7cd5_453b_a02e_31379bd64656
);
windows_core::imp::interface_hierarchy!(IDStorageStatusArray, windows_core::IUnknown);
impl IDStorageStatusArray {
pub unsafe fn IsComplete(&self, index: u32) -> bool {
unsafe {
(windows_core::Interface::vtable(self).IsComplete)(
windows_core::Interface::as_raw(self),
index,
)
}
}
pub unsafe fn GetHResult(&self, index: u32) -> windows_core::Result<()> {
unsafe {
(windows_core::Interface::vtable(self).GetHResult)(
windows_core::Interface::as_raw(self),
index,
)
.ok()
}
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDStorageStatusArray_Vtbl {
pub base__: windows_core::IUnknown_Vtbl,
pub IsComplete: unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> bool,
pub GetHResult:
unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT,
}
pub trait IDStorageStatusArray_Impl: windows_core::IUnknownImpl {
fn IsComplete(&self, index: u32) -> bool;
fn GetHResult(&self, index: u32) -> windows_core::Result<()>;
}
impl IDStorageStatusArray_Vtbl {
pub const fn new<Identity: IDStorageStatusArray_Impl, const OFFSET: isize>() -> Self
{
unsafe extern "system" fn IsComplete<
Identity: IDStorageStatusArray_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
index: u32,
) -> bool {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageStatusArray_Impl::IsComplete(
this,
core::mem::transmute_copy(&index),
)
}
}
unsafe extern "system" fn GetHResult<
Identity: IDStorageStatusArray_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
index: u32,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDStorageStatusArray_Impl::GetHResult(
this,
core::mem::transmute_copy(&index),
)
.into()
}
}
Self {
base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
IsComplete: IsComplete::<Identity, OFFSET>,
GetHResult: GetHResult::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDStorageStatusArray as windows_core::Interface>::IID
}
}
impl windows_core::RuntimeName for IDStorageStatusArray {}
}
}
}