1#![allow(
4 non_snake_case,
5 non_upper_case_globals,
6 non_camel_case_types,
7 dead_code,
8 clippy::all
9)]
10
11pub mod Microsoft {
12 pub mod Direct3D {
13 pub mod DirectStorage {
14 #[inline]
15 pub unsafe fn DStorageCreateCompressionCodec<T>(
16 format: DSTORAGE_COMPRESSION_FORMAT,
17 numthreads: u32,
18 ) -> windows_core::Result<T>
19 where
20 T: windows_core::Interface,
21 {
22 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);
23 let mut result__ = core::ptr::null_mut();
24 unsafe {
25 DStorageCreateCompressionCodec(format, numthreads, &T::IID, &mut result__)
26 .and_then(|| windows_core::Type::from_abi(result__))
27 }
28 }
29 #[inline]
30 pub unsafe fn DStorageGetFactory<T>() -> windows_core::Result<T>
31 where
32 T: windows_core::Interface,
33 {
34 windows_link::link!("dstorage" "system" fn DStorageGetFactory(riid : *const windows_core::GUID, ppv : *mut *mut core::ffi::c_void) -> windows_core::HRESULT);
35 let mut result__ = core::ptr::null_mut();
36 unsafe {
37 DStorageGetFactory(&T::IID, &mut result__)
38 .and_then(|| windows_core::Type::from_abi(result__))
39 }
40 }
41 #[inline]
42 pub unsafe fn DStorageSetConfiguration(
43 configuration: *const DSTORAGE_CONFIGURATION,
44 ) -> windows_core::Result<()> {
45 windows_link::link!("dstorage" "system" fn DStorageSetConfiguration(configuration : *const DSTORAGE_CONFIGURATION) -> windows_core::HRESULT);
46 unsafe { DStorageSetConfiguration(configuration).ok() }
47 }
48 #[inline]
49 pub unsafe fn DStorageSetConfiguration1(
50 configuration: *const DSTORAGE_CONFIGURATION1,
51 ) -> windows_core::Result<()> {
52 windows_link::link!("dstorage" "system" fn DStorageSetConfiguration1(configuration : *const DSTORAGE_CONFIGURATION1) -> windows_core::HRESULT);
53 unsafe { DStorageSetConfiguration1(configuration).ok() }
54 }
55 #[repr(transparent)]
56 #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
57 pub struct DSTORAGE_COMMAND_TYPE(pub i32);
58 pub const DSTORAGE_COMMAND_TYPE_EVENT: DSTORAGE_COMMAND_TYPE =
59 DSTORAGE_COMMAND_TYPE(3i32);
60 pub const DSTORAGE_COMMAND_TYPE_NONE: DSTORAGE_COMMAND_TYPE =
61 DSTORAGE_COMMAND_TYPE(-1i32);
62 pub const DSTORAGE_COMMAND_TYPE_REQUEST: DSTORAGE_COMMAND_TYPE =
63 DSTORAGE_COMMAND_TYPE(0i32);
64 pub const DSTORAGE_COMMAND_TYPE_SIGNAL: DSTORAGE_COMMAND_TYPE =
65 DSTORAGE_COMMAND_TYPE(2i32);
66 pub const DSTORAGE_COMMAND_TYPE_STATUS: DSTORAGE_COMMAND_TYPE =
67 DSTORAGE_COMMAND_TYPE(1i32);
68 #[repr(transparent)]
69 #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
70 pub struct DSTORAGE_COMPRESSION(pub i32);
71 pub const DSTORAGE_COMPRESSION_BEST_RATIO: DSTORAGE_COMPRESSION =
72 DSTORAGE_COMPRESSION(1i32);
73 pub const DSTORAGE_COMPRESSION_DEFAULT: DSTORAGE_COMPRESSION =
74 DSTORAGE_COMPRESSION(0i32);
75 pub const DSTORAGE_COMPRESSION_FASTEST: DSTORAGE_COMPRESSION =
76 DSTORAGE_COMPRESSION(-1i32);
77 #[repr(transparent)]
78 #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
79 pub struct DSTORAGE_COMPRESSION_FORMAT(pub u8);
80 pub const DSTORAGE_COMPRESSION_FORMAT_GDEFLATE: DSTORAGE_COMPRESSION_FORMAT =
81 DSTORAGE_COMPRESSION_FORMAT(1u8);
82 pub const DSTORAGE_COMPRESSION_FORMAT_NONE: DSTORAGE_COMPRESSION_FORMAT =
83 DSTORAGE_COMPRESSION_FORMAT(0u8);
84 #[repr(transparent)]
85 #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
86 pub struct DSTORAGE_COMPRESSION_SUPPORT(pub u32);
87 impl DSTORAGE_COMPRESSION_SUPPORT {
88 pub const fn contains(&self, other: Self) -> bool {
89 self.0 & other.0 == other.0
90 }
91 }
92 impl core::ops::BitOr for DSTORAGE_COMPRESSION_SUPPORT {
93 type Output = Self;
94 fn bitor(self, other: Self) -> Self {
95 Self(self.0 | other.0)
96 }
97 }
98 impl core::ops::BitAnd for DSTORAGE_COMPRESSION_SUPPORT {
99 type Output = Self;
100 fn bitand(self, other: Self) -> Self {
101 Self(self.0 & other.0)
102 }
103 }
104 impl core::ops::BitOrAssign for DSTORAGE_COMPRESSION_SUPPORT {
105 fn bitor_assign(&mut self, other: Self) {
106 self.0.bitor_assign(other.0)
107 }
108 }
109 impl core::ops::BitAndAssign for DSTORAGE_COMPRESSION_SUPPORT {
110 fn bitand_assign(&mut self, other: Self) {
111 self.0.bitand_assign(other.0)
112 }
113 }
114 impl core::ops::Not for DSTORAGE_COMPRESSION_SUPPORT {
115 type Output = Self;
116 fn not(self) -> Self {
117 Self(self.0.not())
118 }
119 }
120 pub const DSTORAGE_COMPRESSION_SUPPORT_CPU_FALLBACK: DSTORAGE_COMPRESSION_SUPPORT =
121 DSTORAGE_COMPRESSION_SUPPORT(4u32);
122 pub const DSTORAGE_COMPRESSION_SUPPORT_GPU_FALLBACK: DSTORAGE_COMPRESSION_SUPPORT =
123 DSTORAGE_COMPRESSION_SUPPORT(2u32);
124 pub const DSTORAGE_COMPRESSION_SUPPORT_GPU_OPTIMIZED: DSTORAGE_COMPRESSION_SUPPORT =
125 DSTORAGE_COMPRESSION_SUPPORT(1u32);
126 pub const DSTORAGE_COMPRESSION_SUPPORT_NONE: DSTORAGE_COMPRESSION_SUPPORT =
127 DSTORAGE_COMPRESSION_SUPPORT(0u32);
128 pub const DSTORAGE_COMPRESSION_SUPPORT_USES_COMPUTE_QUEUE:
129 DSTORAGE_COMPRESSION_SUPPORT = DSTORAGE_COMPRESSION_SUPPORT(8u32);
130 pub const DSTORAGE_COMPRESSION_SUPPORT_USES_COPY_QUEUE: DSTORAGE_COMPRESSION_SUPPORT =
131 DSTORAGE_COMPRESSION_SUPPORT(16u32);
132 #[repr(C)]
133 #[derive(Clone, Copy, Debug, Default, PartialEq)]
134 pub struct DSTORAGE_CONFIGURATION {
135 pub NumSubmitThreads: u32,
136 pub NumBuiltInCpuDecompressionThreads: i32,
137 pub ForceMappingLayer: windows_core::BOOL,
138 pub DisableBypassIO: windows_core::BOOL,
139 pub DisableTelemetry: windows_core::BOOL,
140 pub DisableGpuDecompressionMetacommand: windows_core::BOOL,
141 pub DisableGpuDecompression: windows_core::BOOL,
142 }
143 #[repr(C)]
144 #[derive(Clone, Copy, Debug, Default, PartialEq)]
145 pub struct DSTORAGE_CONFIGURATION1 {
146 pub NumSubmitThreads: u32,
147 pub NumBuiltInCpuDecompressionThreads: i32,
148 pub ForceMappingLayer: windows_core::BOOL,
149 pub DisableBypassIO: windows_core::BOOL,
150 pub DisableTelemetry: windows_core::BOOL,
151 pub DisableGpuDecompressionMetacommand: windows_core::BOOL,
152 pub DisableGpuDecompression: windows_core::BOOL,
153 pub ForceFileBuffering: windows_core::BOOL,
154 }
155 pub const DSTORAGE_CUSTOM_COMPRESSION_0: DSTORAGE_COMPRESSION_FORMAT =
156 DSTORAGE_COMPRESSION_FORMAT(128u8);
157 #[repr(transparent)]
158 #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
159 pub struct DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS(pub u32);
160 impl DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS {
161 pub const fn contains(&self, other: Self) -> bool {
162 self.0 & other.0 == other.0
163 }
164 }
165 impl core::ops::BitOr for DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS {
166 type Output = Self;
167 fn bitor(self, other: Self) -> Self {
168 Self(self.0 | other.0)
169 }
170 }
171 impl core::ops::BitAnd for DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS {
172 type Output = Self;
173 fn bitand(self, other: Self) -> Self {
174 Self(self.0 & other.0)
175 }
176 }
177 impl core::ops::BitOrAssign for DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS {
178 fn bitor_assign(&mut self, other: Self) {
179 self.0.bitor_assign(other.0)
180 }
181 }
182 impl core::ops::BitAndAssign for DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS {
183 fn bitand_assign(&mut self, other: Self) {
184 self.0.bitand_assign(other.0)
185 }
186 }
187 impl core::ops::Not for DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS {
188 type Output = Self;
189 fn not(self) -> Self {
190 Self(self.0.not())
191 }
192 }
193 pub const DSTORAGE_CUSTOM_DECOMPRESSION_FLAG_DEST_IN_UPLOAD_HEAP:
194 DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS = DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS(1u32);
195 pub const DSTORAGE_CUSTOM_DECOMPRESSION_FLAG_NONE: DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS =
196 DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS(0u32);
197 #[repr(C)]
198 #[derive(Clone, Copy, Debug, PartialEq)]
199 pub struct DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST {
200 pub Id: u64,
201 pub CompressionFormat: DSTORAGE_COMPRESSION_FORMAT,
202 pub Reserved: [u8; 3],
203 pub Flags: DSTORAGE_CUSTOM_DECOMPRESSION_FLAGS,
204 pub SrcSize: u64,
205 pub SrcBuffer: *const core::ffi::c_void,
206 pub DstSize: u64,
207 pub DstBuffer: *mut core::ffi::c_void,
208 }
209 impl Default for DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST {
210 fn default() -> Self {
211 unsafe { core::mem::zeroed() }
212 }
213 }
214 #[repr(C)]
215 #[derive(Clone, Copy, Debug, Default, PartialEq)]
216 pub struct DSTORAGE_CUSTOM_DECOMPRESSION_RESULT {
217 pub Id: u64,
218 pub Result: windows_core::HRESULT,
219 }
220 #[repr(transparent)]
221 #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
222 pub struct DSTORAGE_DEBUG(pub i32);
223 impl DSTORAGE_DEBUG {
224 pub const fn contains(&self, other: Self) -> bool {
225 self.0 & other.0 == other.0
226 }
227 }
228 impl core::ops::BitOr for DSTORAGE_DEBUG {
229 type Output = Self;
230 fn bitor(self, other: Self) -> Self {
231 Self(self.0 | other.0)
232 }
233 }
234 impl core::ops::BitAnd for DSTORAGE_DEBUG {
235 type Output = Self;
236 fn bitand(self, other: Self) -> Self {
237 Self(self.0 & other.0)
238 }
239 }
240 impl core::ops::BitOrAssign for DSTORAGE_DEBUG {
241 fn bitor_assign(&mut self, other: Self) {
242 self.0.bitor_assign(other.0)
243 }
244 }
245 impl core::ops::BitAndAssign for DSTORAGE_DEBUG {
246 fn bitand_assign(&mut self, other: Self) {
247 self.0.bitand_assign(other.0)
248 }
249 }
250 impl core::ops::Not for DSTORAGE_DEBUG {
251 type Output = Self;
252 fn not(self) -> Self {
253 Self(self.0.not())
254 }
255 }
256 pub const DSTORAGE_DEBUG_BREAK_ON_ERROR: DSTORAGE_DEBUG = DSTORAGE_DEBUG(2i32);
257 pub const DSTORAGE_DEBUG_NONE: DSTORAGE_DEBUG = DSTORAGE_DEBUG(0i32);
258 pub const DSTORAGE_DEBUG_RECORD_OBJECT_NAMES: DSTORAGE_DEBUG = DSTORAGE_DEBUG(4i32);
259 pub const DSTORAGE_DEBUG_SHOW_ERRORS: DSTORAGE_DEBUG = DSTORAGE_DEBUG(1i32);
260 #[repr(C)]
261 pub union DSTORAGE_DESTINATION {
262 pub Memory: DSTORAGE_DESTINATION_MEMORY,
263 pub Buffer: core::mem::ManuallyDrop<DSTORAGE_DESTINATION_BUFFER>,
264 pub Texture: core::mem::ManuallyDrop<DSTORAGE_DESTINATION_TEXTURE_REGION>,
265 pub MultipleSubresources:
266 core::mem::ManuallyDrop<DSTORAGE_DESTINATION_MULTIPLE_SUBRESOURCES>,
267 pub Tiles: core::mem::ManuallyDrop<DSTORAGE_DESTINATION_TILES>,
268 pub MultipleSubresourcesRange:
269 core::mem::ManuallyDrop<DSTORAGE_DESTINATION_MULTIPLE_SUBRESOURCES_RANGE>,
270 }
271 impl Clone for DSTORAGE_DESTINATION {
272 fn clone(&self) -> Self {
273 unsafe { core::mem::transmute_copy(self) }
274 }
275 }
276 impl Default for DSTORAGE_DESTINATION {
277 fn default() -> Self {
278 unsafe { core::mem::zeroed() }
279 }
280 }
281 #[repr(C)]
282 #[derive(Clone, Debug, Default, PartialEq)]
283 pub struct DSTORAGE_DESTINATION_BUFFER {
284 pub Resource: core::mem::ManuallyDrop<
285 Option<windows::Win32::Graphics::Direct3D12::ID3D12Resource>,
286 >,
287 pub Offset: u64,
288 pub Size: u32,
289 }
290 #[repr(C)]
291 #[derive(Clone, Copy, Debug, PartialEq)]
292 pub struct DSTORAGE_DESTINATION_MEMORY {
293 pub Buffer: *mut core::ffi::c_void,
294 pub Size: u32,
295 }
296 impl Default for DSTORAGE_DESTINATION_MEMORY {
297 fn default() -> Self {
298 unsafe { core::mem::zeroed() }
299 }
300 }
301 #[repr(C)]
302 #[derive(Clone, Debug, Default, PartialEq)]
303 pub struct DSTORAGE_DESTINATION_MULTIPLE_SUBRESOURCES {
304 pub Resource: core::mem::ManuallyDrop<
305 Option<windows::Win32::Graphics::Direct3D12::ID3D12Resource>,
306 >,
307 pub FirstSubresource: u32,
308 }
309 #[repr(C)]
310 #[derive(Clone, Debug, Default, PartialEq)]
311 pub struct DSTORAGE_DESTINATION_MULTIPLE_SUBRESOURCES_RANGE {
312 pub Resource: core::mem::ManuallyDrop<
313 Option<windows::Win32::Graphics::Direct3D12::ID3D12Resource>,
314 >,
315 pub FirstSubresource: u32,
316 pub NumSubresources: u32,
317 }
318 #[repr(C)]
319 #[derive(Clone, Debug, Default, PartialEq)]
320 pub struct DSTORAGE_DESTINATION_TEXTURE_REGION {
321 pub Resource: core::mem::ManuallyDrop<
322 Option<windows::Win32::Graphics::Direct3D12::ID3D12Resource>,
323 >,
324 pub SubresourceIndex: u32,
325 pub Region: windows::Win32::Graphics::Direct3D12::D3D12_BOX,
326 }
327 #[repr(C)]
328 #[derive(Clone, Debug, Default, PartialEq)]
329 pub struct DSTORAGE_DESTINATION_TILES {
330 pub Resource: core::mem::ManuallyDrop<
331 Option<windows::Win32::Graphics::Direct3D12::ID3D12Resource>,
332 >,
333 pub TiledRegionStartCoordinate:
334 windows::Win32::Graphics::Direct3D12::D3D12_TILED_RESOURCE_COORDINATE,
335 pub TileRegionSize: windows::Win32::Graphics::Direct3D12::D3D12_TILE_REGION_SIZE,
336 }
337 pub const DSTORAGE_DISABLE_BUILTIN_CPU_DECOMPRESSION: i32 = -1i32;
338 #[repr(transparent)]
339 #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
340 pub struct DSTORAGE_ENQUEUE_REQUEST_FLAGS(pub u32);
341 pub const DSTORAGE_ENQUEUE_REQUEST_FLAG_FENCE_WAIT_BEFORE_GPU_WORK:
342 DSTORAGE_ENQUEUE_REQUEST_FLAGS = DSTORAGE_ENQUEUE_REQUEST_FLAGS(1u32);
343 pub const DSTORAGE_ENQUEUE_REQUEST_FLAG_FENCE_WAIT_BEFORE_SOURCE_ACCESS:
344 DSTORAGE_ENQUEUE_REQUEST_FLAGS = DSTORAGE_ENQUEUE_REQUEST_FLAGS(2u32);
345 pub const DSTORAGE_ENQUEUE_REQUEST_FLAG_NONE: DSTORAGE_ENQUEUE_REQUEST_FLAGS =
346 DSTORAGE_ENQUEUE_REQUEST_FLAGS(0u32);
347 #[repr(C)]
348 pub struct DSTORAGE_ERROR_FIRST_FAILURE {
349 pub HResult: windows_core::HRESULT,
350 pub CommandType: DSTORAGE_COMMAND_TYPE,
351 pub Anonymous: DSTORAGE_ERROR_FIRST_FAILURE_0,
352 }
353 impl Clone for DSTORAGE_ERROR_FIRST_FAILURE {
354 fn clone(&self) -> Self {
355 unsafe { core::mem::transmute_copy(self) }
356 }
357 }
358 impl Default for DSTORAGE_ERROR_FIRST_FAILURE {
359 fn default() -> Self {
360 unsafe { core::mem::zeroed() }
361 }
362 }
363 #[repr(C)]
364 pub union DSTORAGE_ERROR_FIRST_FAILURE_0 {
365 pub Request: core::mem::ManuallyDrop<DSTORAGE_ERROR_PARAMETERS_REQUEST>,
366 pub Status: core::mem::ManuallyDrop<DSTORAGE_ERROR_PARAMETERS_STATUS>,
367 pub Signal: core::mem::ManuallyDrop<DSTORAGE_ERROR_PARAMETERS_SIGNAL>,
368 pub Event: DSTORAGE_ERROR_PARAMETERS_EVENT,
369 }
370 impl Clone for DSTORAGE_ERROR_FIRST_FAILURE_0 {
371 fn clone(&self) -> Self {
372 unsafe { core::mem::transmute_copy(self) }
373 }
374 }
375 impl Default for DSTORAGE_ERROR_FIRST_FAILURE_0 {
376 fn default() -> Self {
377 unsafe { core::mem::zeroed() }
378 }
379 }
380 #[repr(C)]
381 #[derive(Clone, Copy, Debug, Default, PartialEq)]
382 pub struct DSTORAGE_ERROR_PARAMETERS_EVENT {
383 pub Handle: windows::Win32::Foundation::HANDLE,
384 }
385 #[repr(C)]
386 pub struct DSTORAGE_ERROR_PARAMETERS_REQUEST {
387 pub Filename: [u16; 260],
388 pub RequestName: [i8; 64],
389 pub Request: DSTORAGE_REQUEST,
390 }
391 impl Clone for DSTORAGE_ERROR_PARAMETERS_REQUEST {
392 fn clone(&self) -> Self {
393 unsafe { core::mem::transmute_copy(self) }
394 }
395 }
396 impl Default for DSTORAGE_ERROR_PARAMETERS_REQUEST {
397 fn default() -> Self {
398 unsafe { core::mem::zeroed() }
399 }
400 }
401 #[repr(C)]
402 #[derive(Clone, Debug, Default, PartialEq)]
403 pub struct DSTORAGE_ERROR_PARAMETERS_SIGNAL {
404 pub Fence: core::mem::ManuallyDrop<
405 Option<windows::Win32::Graphics::Direct3D12::ID3D12Fence>,
406 >,
407 pub Value: u64,
408 }
409 #[repr(C)]
410 #[derive(Clone, Debug, Default, PartialEq)]
411 pub struct DSTORAGE_ERROR_PARAMETERS_STATUS {
412 pub StatusArray: core::mem::ManuallyDrop<Option<IDStorageStatusArray>>,
413 pub Index: u32,
414 }
415 #[repr(C)]
416 pub struct DSTORAGE_ERROR_RECORD {
417 pub FailureCount: u32,
418 pub FirstFailure: DSTORAGE_ERROR_FIRST_FAILURE,
419 }
420 impl Clone for DSTORAGE_ERROR_RECORD {
421 fn clone(&self) -> Self {
422 unsafe { core::mem::transmute_copy(self) }
423 }
424 }
425 impl Default for DSTORAGE_ERROR_RECORD {
426 fn default() -> Self {
427 unsafe { core::mem::zeroed() }
428 }
429 }
430 #[repr(transparent)]
431 #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
432 pub struct DSTORAGE_GET_REQUEST_FLAGS(pub u32);
433 impl DSTORAGE_GET_REQUEST_FLAGS {
434 pub const fn contains(&self, other: Self) -> bool {
435 self.0 & other.0 == other.0
436 }
437 }
438 impl core::ops::BitOr for DSTORAGE_GET_REQUEST_FLAGS {
439 type Output = Self;
440 fn bitor(self, other: Self) -> Self {
441 Self(self.0 | other.0)
442 }
443 }
444 impl core::ops::BitAnd for DSTORAGE_GET_REQUEST_FLAGS {
445 type Output = Self;
446 fn bitand(self, other: Self) -> Self {
447 Self(self.0 & other.0)
448 }
449 }
450 impl core::ops::BitOrAssign for DSTORAGE_GET_REQUEST_FLAGS {
451 fn bitor_assign(&mut self, other: Self) {
452 self.0.bitor_assign(other.0)
453 }
454 }
455 impl core::ops::BitAndAssign for DSTORAGE_GET_REQUEST_FLAGS {
456 fn bitand_assign(&mut self, other: Self) {
457 self.0.bitand_assign(other.0)
458 }
459 }
460 impl core::ops::Not for DSTORAGE_GET_REQUEST_FLAGS {
461 type Output = Self;
462 fn not(self) -> Self {
463 Self(self.0.not())
464 }
465 }
466 pub const DSTORAGE_GET_REQUEST_FLAG_SELECT_ALL: DSTORAGE_GET_REQUEST_FLAGS =
467 DSTORAGE_GET_REQUEST_FLAGS(3u32);
468 pub const DSTORAGE_GET_REQUEST_FLAG_SELECT_BUILTIN: DSTORAGE_GET_REQUEST_FLAGS =
469 DSTORAGE_GET_REQUEST_FLAGS(2u32);
470 pub const DSTORAGE_GET_REQUEST_FLAG_SELECT_CUSTOM: DSTORAGE_GET_REQUEST_FLAGS =
471 DSTORAGE_GET_REQUEST_FLAGS(1u32);
472 pub const DSTORAGE_MAX_QUEUE_CAPACITY: u32 = 8192u32;
473 pub const DSTORAGE_MIN_QUEUE_CAPACITY: u32 = 128u32;
474 #[repr(transparent)]
475 #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
476 pub struct DSTORAGE_PRIORITY(pub i8);
477 pub const DSTORAGE_PRIORITY_COUNT: DSTORAGE_PRIORITY = DSTORAGE_PRIORITY(4i8);
478 pub const DSTORAGE_PRIORITY_FIRST: DSTORAGE_PRIORITY = DSTORAGE_PRIORITY(-1i8);
479 pub const DSTORAGE_PRIORITY_HIGH: DSTORAGE_PRIORITY = DSTORAGE_PRIORITY(1i8);
480 pub const DSTORAGE_PRIORITY_LAST: DSTORAGE_PRIORITY = DSTORAGE_PRIORITY(2i8);
481 pub const DSTORAGE_PRIORITY_LOW: DSTORAGE_PRIORITY = DSTORAGE_PRIORITY(-1i8);
482 pub const DSTORAGE_PRIORITY_NORMAL: DSTORAGE_PRIORITY = DSTORAGE_PRIORITY(0i8);
483 pub const DSTORAGE_PRIORITY_REALTIME: DSTORAGE_PRIORITY = DSTORAGE_PRIORITY(2i8);
484 #[repr(C)]
485 #[derive(Clone, Debug, Default, PartialEq)]
486 pub struct DSTORAGE_QUEUE_DESC {
487 pub SourceType: DSTORAGE_REQUEST_SOURCE_TYPE,
488 pub Capacity: u16,
489 pub Priority: DSTORAGE_PRIORITY,
490 pub Name: windows_core::PCSTR,
491 pub Device: core::mem::ManuallyDrop<
492 Option<windows::Win32::Graphics::Direct3D12::ID3D12Device>,
493 >,
494 }
495 #[repr(C)]
496 #[derive(Clone, Debug, Default, PartialEq)]
497 pub struct DSTORAGE_QUEUE_INFO {
498 pub Desc: DSTORAGE_QUEUE_DESC,
499 pub EmptySlotCount: u16,
500 pub RequestCountUntilAutoSubmit: u16,
501 }
502 #[repr(C)]
503 pub struct DSTORAGE_REQUEST {
504 pub Options: DSTORAGE_REQUEST_OPTIONS,
505 pub Source: DSTORAGE_SOURCE,
506 pub Destination: DSTORAGE_DESTINATION,
507 pub UncompressedSize: u32,
508 pub CancellationTag: u64,
509 pub Name: windows_core::PCSTR,
510 }
511 impl Clone for DSTORAGE_REQUEST {
512 fn clone(&self) -> Self {
513 unsafe { core::mem::transmute_copy(self) }
514 }
515 }
516 impl Default for DSTORAGE_REQUEST {
517 fn default() -> Self {
518 unsafe { core::mem::zeroed() }
519 }
520 }
521 pub const DSTORAGE_REQUEST_DESTINATION_BUFFER: DSTORAGE_REQUEST_DESTINATION_TYPE =
522 DSTORAGE_REQUEST_DESTINATION_TYPE(1u64);
523 pub const DSTORAGE_REQUEST_DESTINATION_MEMORY: DSTORAGE_REQUEST_DESTINATION_TYPE =
524 DSTORAGE_REQUEST_DESTINATION_TYPE(0u64);
525 pub const DSTORAGE_REQUEST_DESTINATION_MULTIPLE_SUBRESOURCES:
526 DSTORAGE_REQUEST_DESTINATION_TYPE = DSTORAGE_REQUEST_DESTINATION_TYPE(3u64);
527 pub const DSTORAGE_REQUEST_DESTINATION_MULTIPLE_SUBRESOURCES_RANGE:
528 DSTORAGE_REQUEST_DESTINATION_TYPE = DSTORAGE_REQUEST_DESTINATION_TYPE(5u64);
529 pub const DSTORAGE_REQUEST_DESTINATION_TEXTURE_REGION:
530 DSTORAGE_REQUEST_DESTINATION_TYPE = DSTORAGE_REQUEST_DESTINATION_TYPE(2u64);
531 pub const DSTORAGE_REQUEST_DESTINATION_TILES: DSTORAGE_REQUEST_DESTINATION_TYPE =
532 DSTORAGE_REQUEST_DESTINATION_TYPE(4u64);
533 #[repr(transparent)]
534 #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
535 pub struct DSTORAGE_REQUEST_DESTINATION_TYPE(pub u64);
536 pub const DSTORAGE_REQUEST_MAX_NAME: u32 = 64u32;
537 #[repr(C)]
538 #[derive(Clone, Copy, Debug, PartialEq)]
539 pub struct DSTORAGE_REQUEST_OPTIONS {
540 pub _bitfield1: u8,
541 pub Reserved1: [u8; 7],
542 pub _bitfield2: u64,
543 }
544 impl Default for DSTORAGE_REQUEST_OPTIONS {
545 fn default() -> Self {
546 unsafe { core::mem::zeroed() }
547 }
548 }
549 pub const DSTORAGE_REQUEST_SOURCE_FILE: DSTORAGE_REQUEST_SOURCE_TYPE =
550 DSTORAGE_REQUEST_SOURCE_TYPE(0u64);
551 pub const DSTORAGE_REQUEST_SOURCE_MEMORY: DSTORAGE_REQUEST_SOURCE_TYPE =
552 DSTORAGE_REQUEST_SOURCE_TYPE(1u64);
553 #[repr(transparent)]
554 #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
555 pub struct DSTORAGE_REQUEST_SOURCE_TYPE(pub u64);
556 pub const DSTORAGE_SDK_VERSION: u32 = 300u32;
557 #[repr(C)]
558 pub union DSTORAGE_SOURCE {
559 pub Memory: DSTORAGE_SOURCE_MEMORY,
560 pub File: core::mem::ManuallyDrop<DSTORAGE_SOURCE_FILE>,
561 }
562 impl Clone for DSTORAGE_SOURCE {
563 fn clone(&self) -> Self {
564 unsafe { core::mem::transmute_copy(self) }
565 }
566 }
567 impl Default for DSTORAGE_SOURCE {
568 fn default() -> Self {
569 unsafe { core::mem::zeroed() }
570 }
571 }
572 #[repr(C)]
573 #[derive(Clone, Debug, Default, PartialEq)]
574 pub struct DSTORAGE_SOURCE_FILE {
575 pub Source: core::mem::ManuallyDrop<Option<IDStorageFile>>,
576 pub Offset: u64,
577 pub Size: u32,
578 }
579 #[repr(C)]
580 #[derive(Clone, Copy, Debug, PartialEq)]
581 pub struct DSTORAGE_SOURCE_MEMORY {
582 pub Source: *const core::ffi::c_void,
583 pub Size: u32,
584 }
585 impl Default for DSTORAGE_SOURCE_MEMORY {
586 fn default() -> Self {
587 unsafe { core::mem::zeroed() }
588 }
589 }
590 #[repr(transparent)]
591 #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
592 pub struct DSTORAGE_STAGING_BUFFER_SIZE(pub u32);
593 pub const DSTORAGE_STAGING_BUFFER_SIZE_0: DSTORAGE_STAGING_BUFFER_SIZE =
594 DSTORAGE_STAGING_BUFFER_SIZE(0u32);
595 pub const DSTORAGE_STAGING_BUFFER_SIZE_32MB: DSTORAGE_STAGING_BUFFER_SIZE =
596 DSTORAGE_STAGING_BUFFER_SIZE(33554432u32);
597 pub const E_DSTORAGE_ACCESS_VIOLATION: windows_core::HRESULT =
598 windows_core::HRESULT(0x89240009_u32 as _);
599 pub const E_DSTORAGE_ALREADY_RUNNING: windows_core::HRESULT =
600 windows_core::HRESULT(0x89240001_u32 as _);
601 pub const E_DSTORAGE_BCPACK_BAD_DATA: windows_core::HRESULT =
602 windows_core::HRESULT(0x89240035_u32 as _);
603 pub const E_DSTORAGE_BCPACK_BAD_HEADER: windows_core::HRESULT =
604 windows_core::HRESULT(0x89240034_u32 as _);
605 pub const E_DSTORAGE_COMPRESSED_DATA_TOO_LARGE: windows_core::HRESULT =
606 windows_core::HRESULT(0x89240039_u32 as _);
607 pub const E_DSTORAGE_DECOMPRESSION_ERROR: windows_core::HRESULT =
608 windows_core::HRESULT(0x89240030_u32 as _);
609 pub const E_DSTORAGE_DECRYPTION_ERROR: windows_core::HRESULT =
610 windows_core::HRESULT(0x89240036_u32 as _);
611 pub const E_DSTORAGE_DEPRECATED_PREVIEW_GDK: windows_core::HRESULT =
612 windows_core::HRESULT(0x89240018_u32 as _);
613 pub const E_DSTORAGE_END_OF_FILE: windows_core::HRESULT =
614 windows_core::HRESULT(0x89240007_u32 as _);
615 pub const E_DSTORAGE_FILEBUFFERING_REQUIRES_DISABLED_BYPASSIO: windows_core::HRESULT =
616 windows_core::HRESULT(0x89240041_u32 as _);
617 pub const E_DSTORAGE_FILE_NOT_OPEN: windows_core::HRESULT =
618 windows_core::HRESULT(0x8924000B_u32 as _);
619 pub const E_DSTORAGE_FILE_TOO_FRAGMENTED: windows_core::HRESULT =
620 windows_core::HRESULT(0x89240038_u32 as _);
621 pub const E_DSTORAGE_INDEX_BOUND: windows_core::HRESULT =
622 windows_core::HRESULT(0x89240015_u32 as _);
623 pub const E_DSTORAGE_INVALID_BCPACK_MODE: windows_core::HRESULT =
624 windows_core::HRESULT(0x8924000D_u32 as _);
625 pub const E_DSTORAGE_INVALID_CLUSTER_SIZE: windows_core::HRESULT =
626 windows_core::HRESULT(0x89240011_u32 as _);
627 pub const E_DSTORAGE_INVALID_DESTINATION_SIZE: windows_core::HRESULT =
628 windows_core::HRESULT(0x8924000F_u32 as _);
629 pub const E_DSTORAGE_INVALID_DESTINATION_TYPE: windows_core::HRESULT =
630 windows_core::HRESULT(0x89240040_u32 as _);
631 pub const E_DSTORAGE_INVALID_FENCE: windows_core::HRESULT =
632 windows_core::HRESULT(0x89240022_u32 as _);
633 pub const E_DSTORAGE_INVALID_FILE_HANDLE: windows_core::HRESULT =
634 windows_core::HRESULT(0x89240017_u32 as _);
635 pub const E_DSTORAGE_INVALID_FILE_OFFSET: windows_core::HRESULT =
636 windows_core::HRESULT(0x8924001A_u32 as _);
637 pub const E_DSTORAGE_INVALID_INTERMEDIATE_SIZE: windows_core::HRESULT =
638 windows_core::HRESULT(0x8924001C_u32 as _);
639 pub const E_DSTORAGE_INVALID_MEMORY_QUEUE_PRIORITY: windows_core::HRESULT =
640 windows_core::HRESULT(0x89240024_u32 as _);
641 pub const E_DSTORAGE_INVALID_QUEUE_CAPACITY: windows_core::HRESULT =
642 windows_core::HRESULT(0x89240003_u32 as _);
643 pub const E_DSTORAGE_INVALID_QUEUE_PRIORITY: windows_core::HRESULT =
644 windows_core::HRESULT(0x89240013_u32 as _);
645 pub const E_DSTORAGE_INVALID_SOURCE_TYPE: windows_core::HRESULT =
646 windows_core::HRESULT(0x8924001B_u32 as _);
647 pub const E_DSTORAGE_INVALID_STAGING_BUFFER_SIZE: windows_core::HRESULT =
648 windows_core::HRESULT(0x89240020_u32 as _);
649 pub const E_DSTORAGE_INVALID_STATUS_ARRAY: windows_core::HRESULT =
650 windows_core::HRESULT(0x89240023_u32 as _);
651 pub const E_DSTORAGE_INVALID_SWIZZLE_MODE: windows_core::HRESULT =
652 windows_core::HRESULT(0x8924000E_u32 as _);
653 pub const E_DSTORAGE_IO_TIMEOUT: windows_core::HRESULT =
654 windows_core::HRESULT(0x89240016_u32 as _);
655 pub const E_DSTORAGE_NOT_RUNNING: windows_core::HRESULT =
656 windows_core::HRESULT(0x89240002_u32 as _);
657 pub const E_DSTORAGE_PASSTHROUGH_ERROR: windows_core::HRESULT =
658 windows_core::HRESULT(0x89240037_u32 as _);
659 pub const E_DSTORAGE_QUEUE_CLOSED: windows_core::HRESULT =
660 windows_core::HRESULT(0x89240010_u32 as _);
661 pub const E_DSTORAGE_REQUEST_TOO_LARGE: windows_core::HRESULT =
662 windows_core::HRESULT(0x89240008_u32 as _);
663 pub const E_DSTORAGE_RESERVED_FIELDS: windows_core::HRESULT =
664 windows_core::HRESULT(0x8924000C_u32 as _);
665 pub const E_DSTORAGE_STAGING_BUFFER_LOCKED: windows_core::HRESULT =
666 windows_core::HRESULT(0x8924001F_u32 as _);
667 pub const E_DSTORAGE_STAGING_BUFFER_TOO_SMALL: windows_core::HRESULT =
668 windows_core::HRESULT(0x89240021_u32 as _);
669 pub const E_DSTORAGE_SYSTEM_NOT_SUPPORTED: windows_core::HRESULT =
670 windows_core::HRESULT(0x8924001D_u32 as _);
671 pub const E_DSTORAGE_TOO_MANY_FILES: windows_core::HRESULT =
672 windows_core::HRESULT(0x89240014_u32 as _);
673 pub const E_DSTORAGE_TOO_MANY_QUEUES: windows_core::HRESULT =
674 windows_core::HRESULT(0x89240012_u32 as _);
675 pub const E_DSTORAGE_UNSUPPORTED_FILE: windows_core::HRESULT =
676 windows_core::HRESULT(0x8924000A_u32 as _);
677 pub const E_DSTORAGE_UNSUPPORTED_VOLUME: windows_core::HRESULT =
678 windows_core::HRESULT(0x89240005_u32 as _);
679 pub const E_DSTORAGE_XVD_DEVICE_NOT_SUPPORTED: windows_core::HRESULT =
680 windows_core::HRESULT(0x89240004_u32 as _);
681 pub const E_DSTORAGE_XVD_NOT_REGISTERED: windows_core::HRESULT =
682 windows_core::HRESULT(0x89240019_u32 as _);
683 pub const E_DSTORAGE_ZLIB_BAD_DATA: windows_core::HRESULT =
684 windows_core::HRESULT(0x89240032_u32 as _);
685 pub const E_DSTORAGE_ZLIB_BAD_HEADER: windows_core::HRESULT =
686 windows_core::HRESULT(0x89240031_u32 as _);
687 pub const E_DSTORAGE_ZLIB_PARITY_FAIL: windows_core::HRESULT =
688 windows_core::HRESULT(0x89240033_u32 as _);
689 pub const FACILITY_GAME: u32 = 2340u32;
690 windows_core::imp::define_interface!(
691 IDStorageCompressionCodec,
692 IDStorageCompressionCodec_Vtbl,
693 0x84ef5121_9b43_4d03_b5c1_cc34606b262d
694 );
695 windows_core::imp::interface_hierarchy!(
696 IDStorageCompressionCodec,
697 windows_core::IUnknown
698 );
699 impl IDStorageCompressionCodec {
700 pub unsafe fn CompressBuffer(
701 &self,
702 uncompresseddata: *const core::ffi::c_void,
703 uncompresseddatasize: usize,
704 compressionsetting: DSTORAGE_COMPRESSION,
705 compressedbuffer: *mut core::ffi::c_void,
706 compressedbuffersize: usize,
707 compresseddatasize: *mut usize,
708 ) -> windows_core::Result<()> {
709 unsafe {
710 (windows_core::Interface::vtable(self).CompressBuffer)(
711 windows_core::Interface::as_raw(self),
712 uncompresseddata,
713 uncompresseddatasize,
714 compressionsetting,
715 compressedbuffer as _,
716 compressedbuffersize,
717 compresseddatasize as _,
718 )
719 .ok()
720 }
721 }
722 pub unsafe fn DecompressBuffer(
723 &self,
724 compresseddata: *const core::ffi::c_void,
725 compresseddatasize: usize,
726 uncompressedbuffer: *mut core::ffi::c_void,
727 uncompressedbuffersize: usize,
728 uncompresseddatasize: *mut usize,
729 ) -> windows_core::Result<()> {
730 unsafe {
731 (windows_core::Interface::vtable(self).DecompressBuffer)(
732 windows_core::Interface::as_raw(self),
733 compresseddata,
734 compresseddatasize,
735 uncompressedbuffer as _,
736 uncompressedbuffersize,
737 uncompresseddatasize as _,
738 )
739 .ok()
740 }
741 }
742 pub unsafe fn CompressBufferBound(&self, uncompresseddatasize: usize) -> usize {
743 unsafe {
744 (windows_core::Interface::vtable(self).CompressBufferBound)(
745 windows_core::Interface::as_raw(self),
746 uncompresseddatasize,
747 )
748 }
749 }
750 }
751 #[repr(C)]
752 #[doc(hidden)]
753 pub struct IDStorageCompressionCodec_Vtbl {
754 pub base__: windows_core::IUnknown_Vtbl,
755 pub CompressBuffer: unsafe extern "system" fn(
756 *mut core::ffi::c_void,
757 *const core::ffi::c_void,
758 usize,
759 DSTORAGE_COMPRESSION,
760 *mut core::ffi::c_void,
761 usize,
762 *mut usize,
763 )
764 -> windows_core::HRESULT,
765 pub DecompressBuffer: unsafe extern "system" fn(
766 *mut core::ffi::c_void,
767 *const core::ffi::c_void,
768 usize,
769 *mut core::ffi::c_void,
770 usize,
771 *mut usize,
772 )
773 -> windows_core::HRESULT,
774 pub CompressBufferBound:
775 unsafe extern "system" fn(*mut core::ffi::c_void, usize) -> usize,
776 }
777 pub trait IDStorageCompressionCodec_Impl: windows_core::IUnknownImpl {
778 fn CompressBuffer(
779 &self,
780 uncompresseddata: *const core::ffi::c_void,
781 uncompresseddatasize: usize,
782 compressionsetting: DSTORAGE_COMPRESSION,
783 compressedbuffer: *mut core::ffi::c_void,
784 compressedbuffersize: usize,
785 compresseddatasize: *mut usize,
786 ) -> windows_core::Result<()>;
787 fn DecompressBuffer(
788 &self,
789 compresseddata: *const core::ffi::c_void,
790 compresseddatasize: usize,
791 uncompressedbuffer: *mut core::ffi::c_void,
792 uncompressedbuffersize: usize,
793 uncompresseddatasize: *mut usize,
794 ) -> windows_core::Result<()>;
795 fn CompressBufferBound(&self, uncompresseddatasize: usize) -> usize;
796 }
797 impl IDStorageCompressionCodec_Vtbl {
798 pub const fn new<Identity: IDStorageCompressionCodec_Impl, const OFFSET: isize>(
799 ) -> Self {
800 unsafe extern "system" fn CompressBuffer<
801 Identity: IDStorageCompressionCodec_Impl,
802 const OFFSET: isize,
803 >(
804 this: *mut core::ffi::c_void,
805 uncompresseddata: *const core::ffi::c_void,
806 uncompresseddatasize: usize,
807 compressionsetting: DSTORAGE_COMPRESSION,
808 compressedbuffer: *mut core::ffi::c_void,
809 compressedbuffersize: usize,
810 compresseddatasize: *mut usize,
811 ) -> windows_core::HRESULT {
812 unsafe {
813 let this: &Identity =
814 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
815 IDStorageCompressionCodec_Impl::CompressBuffer(
816 this,
817 core::mem::transmute_copy(&uncompresseddata),
818 core::mem::transmute_copy(&uncompresseddatasize),
819 core::mem::transmute_copy(&compressionsetting),
820 core::mem::transmute_copy(&compressedbuffer),
821 core::mem::transmute_copy(&compressedbuffersize),
822 core::mem::transmute_copy(&compresseddatasize),
823 )
824 .into()
825 }
826 }
827 unsafe extern "system" fn DecompressBuffer<
828 Identity: IDStorageCompressionCodec_Impl,
829 const OFFSET: isize,
830 >(
831 this: *mut core::ffi::c_void,
832 compresseddata: *const core::ffi::c_void,
833 compresseddatasize: usize,
834 uncompressedbuffer: *mut core::ffi::c_void,
835 uncompressedbuffersize: usize,
836 uncompresseddatasize: *mut usize,
837 ) -> windows_core::HRESULT {
838 unsafe {
839 let this: &Identity =
840 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
841 IDStorageCompressionCodec_Impl::DecompressBuffer(
842 this,
843 core::mem::transmute_copy(&compresseddata),
844 core::mem::transmute_copy(&compresseddatasize),
845 core::mem::transmute_copy(&uncompressedbuffer),
846 core::mem::transmute_copy(&uncompressedbuffersize),
847 core::mem::transmute_copy(&uncompresseddatasize),
848 )
849 .into()
850 }
851 }
852 unsafe extern "system" fn CompressBufferBound<
853 Identity: IDStorageCompressionCodec_Impl,
854 const OFFSET: isize,
855 >(
856 this: *mut core::ffi::c_void,
857 uncompresseddatasize: usize,
858 ) -> usize {
859 unsafe {
860 let this: &Identity =
861 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
862 IDStorageCompressionCodec_Impl::CompressBufferBound(
863 this,
864 core::mem::transmute_copy(&uncompresseddatasize),
865 )
866 }
867 }
868 Self {
869 base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
870 CompressBuffer: CompressBuffer::<Identity, OFFSET>,
871 DecompressBuffer: DecompressBuffer::<Identity, OFFSET>,
872 CompressBufferBound: CompressBufferBound::<Identity, OFFSET>,
873 }
874 }
875 pub fn matches(iid: &windows_core::GUID) -> bool {
876 iid == &<IDStorageCompressionCodec as windows_core::Interface>::IID
877 }
878 }
879 impl windows_core::RuntimeName for IDStorageCompressionCodec {}
880 windows_core::imp::define_interface!(
881 IDStorageCustomDecompressionQueue,
882 IDStorageCustomDecompressionQueue_Vtbl,
883 0x97179b2f_2c21_49ca_8291_4e1bf4a160df
884 );
885 windows_core::imp::interface_hierarchy!(
886 IDStorageCustomDecompressionQueue,
887 windows_core::IUnknown
888 );
889 impl IDStorageCustomDecompressionQueue {
890 pub unsafe fn GetEvent(&self) -> windows::Win32::Foundation::HANDLE {
891 unsafe {
892 (windows_core::Interface::vtable(self).GetEvent)(
893 windows_core::Interface::as_raw(self),
894 )
895 }
896 }
897 pub unsafe fn GetRequests(
898 &self,
899 requests: &mut [DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST],
900 numrequests: *mut u32,
901 ) -> windows_core::Result<()> {
902 unsafe {
903 (windows_core::Interface::vtable(self).GetRequests)(
904 windows_core::Interface::as_raw(self),
905 requests.len().try_into().unwrap(),
906 core::mem::transmute(requests.as_ptr()),
907 numrequests as _,
908 )
909 .ok()
910 }
911 }
912 pub unsafe fn SetRequestResults(
913 &self,
914 results: &[DSTORAGE_CUSTOM_DECOMPRESSION_RESULT],
915 ) -> windows_core::Result<()> {
916 unsafe {
917 (windows_core::Interface::vtable(self).SetRequestResults)(
918 windows_core::Interface::as_raw(self),
919 results.len().try_into().unwrap(),
920 core::mem::transmute(results.as_ptr()),
921 )
922 .ok()
923 }
924 }
925 }
926 #[repr(C)]
927 #[doc(hidden)]
928 pub struct IDStorageCustomDecompressionQueue_Vtbl {
929 pub base__: windows_core::IUnknown_Vtbl,
930 pub GetEvent: unsafe extern "system" fn(
931 *mut core::ffi::c_void,
932 )
933 -> windows::Win32::Foundation::HANDLE,
934 pub GetRequests: unsafe extern "system" fn(
935 *mut core::ffi::c_void,
936 u32,
937 *mut DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST,
938 *mut u32,
939 )
940 -> windows_core::HRESULT,
941 pub SetRequestResults: unsafe extern "system" fn(
942 *mut core::ffi::c_void,
943 u32,
944 *const DSTORAGE_CUSTOM_DECOMPRESSION_RESULT,
945 )
946 -> windows_core::HRESULT,
947 }
948 pub trait IDStorageCustomDecompressionQueue_Impl: windows_core::IUnknownImpl {
949 fn GetEvent(&self) -> windows::Win32::Foundation::HANDLE;
950 fn GetRequests(
951 &self,
952 maxrequests: u32,
953 requests: *mut DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST,
954 numrequests: *mut u32,
955 ) -> windows_core::Result<()>;
956 fn SetRequestResults(
957 &self,
958 numresults: u32,
959 results: *const DSTORAGE_CUSTOM_DECOMPRESSION_RESULT,
960 ) -> windows_core::Result<()>;
961 }
962 impl IDStorageCustomDecompressionQueue_Vtbl {
963 pub const fn new<
964 Identity: IDStorageCustomDecompressionQueue_Impl,
965 const OFFSET: isize,
966 >() -> Self {
967 unsafe extern "system" fn GetEvent<
968 Identity: IDStorageCustomDecompressionQueue_Impl,
969 const OFFSET: isize,
970 >(
971 this: *mut core::ffi::c_void,
972 ) -> windows::Win32::Foundation::HANDLE {
973 unsafe {
974 let this: &Identity =
975 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
976 IDStorageCustomDecompressionQueue_Impl::GetEvent(this)
977 }
978 }
979 unsafe extern "system" fn GetRequests<
980 Identity: IDStorageCustomDecompressionQueue_Impl,
981 const OFFSET: isize,
982 >(
983 this: *mut core::ffi::c_void,
984 maxrequests: u32,
985 requests: *mut DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST,
986 numrequests: *mut u32,
987 ) -> windows_core::HRESULT {
988 unsafe {
989 let this: &Identity =
990 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
991 IDStorageCustomDecompressionQueue_Impl::GetRequests(
992 this,
993 core::mem::transmute_copy(&maxrequests),
994 core::mem::transmute_copy(&requests),
995 core::mem::transmute_copy(&numrequests),
996 )
997 .into()
998 }
999 }
1000 unsafe extern "system" fn SetRequestResults<
1001 Identity: IDStorageCustomDecompressionQueue_Impl,
1002 const OFFSET: isize,
1003 >(
1004 this: *mut core::ffi::c_void,
1005 numresults: u32,
1006 results: *const DSTORAGE_CUSTOM_DECOMPRESSION_RESULT,
1007 ) -> windows_core::HRESULT {
1008 unsafe {
1009 let this: &Identity =
1010 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1011 IDStorageCustomDecompressionQueue_Impl::SetRequestResults(
1012 this,
1013 core::mem::transmute_copy(&numresults),
1014 core::mem::transmute_copy(&results),
1015 )
1016 .into()
1017 }
1018 }
1019 Self {
1020 base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
1021 GetEvent: GetEvent::<Identity, OFFSET>,
1022 GetRequests: GetRequests::<Identity, OFFSET>,
1023 SetRequestResults: SetRequestResults::<Identity, OFFSET>,
1024 }
1025 }
1026 pub fn matches(iid: &windows_core::GUID) -> bool {
1027 iid == &<IDStorageCustomDecompressionQueue as windows_core::Interface>::IID
1028 }
1029 }
1030 impl windows_core::RuntimeName for IDStorageCustomDecompressionQueue {}
1031 windows_core::imp::define_interface!(
1032 IDStorageCustomDecompressionQueue1,
1033 IDStorageCustomDecompressionQueue1_Vtbl,
1034 0x0d47c6c9_e61a_4706_93b4_68bfe3f4aa4a
1035 );
1036 impl core::ops::Deref for IDStorageCustomDecompressionQueue1 {
1037 type Target = IDStorageCustomDecompressionQueue;
1038 fn deref(&self) -> &Self::Target {
1039 unsafe { core::mem::transmute(self) }
1040 }
1041 }
1042 windows_core::imp::interface_hierarchy!(
1043 IDStorageCustomDecompressionQueue1,
1044 windows_core::IUnknown,
1045 IDStorageCustomDecompressionQueue
1046 );
1047 impl IDStorageCustomDecompressionQueue1 {
1048 pub unsafe fn GetRequests1(
1049 &self,
1050 flags: DSTORAGE_GET_REQUEST_FLAGS,
1051 requests: &mut [DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST],
1052 numrequests: *mut u32,
1053 ) -> windows_core::Result<()> {
1054 unsafe {
1055 (windows_core::Interface::vtable(self).GetRequests1)(
1056 windows_core::Interface::as_raw(self),
1057 flags,
1058 requests.len().try_into().unwrap(),
1059 core::mem::transmute(requests.as_ptr()),
1060 numrequests as _,
1061 )
1062 .ok()
1063 }
1064 }
1065 }
1066 #[repr(C)]
1067 #[doc(hidden)]
1068 pub struct IDStorageCustomDecompressionQueue1_Vtbl {
1069 pub base__: IDStorageCustomDecompressionQueue_Vtbl,
1070 pub GetRequests1: unsafe extern "system" fn(
1071 *mut core::ffi::c_void,
1072 DSTORAGE_GET_REQUEST_FLAGS,
1073 u32,
1074 *mut DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST,
1075 *mut u32,
1076 )
1077 -> windows_core::HRESULT,
1078 }
1079 pub trait IDStorageCustomDecompressionQueue1_Impl:
1080 IDStorageCustomDecompressionQueue_Impl
1081 {
1082 fn GetRequests1(
1083 &self,
1084 flags: DSTORAGE_GET_REQUEST_FLAGS,
1085 maxrequests: u32,
1086 requests: *mut DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST,
1087 numrequests: *mut u32,
1088 ) -> windows_core::Result<()>;
1089 }
1090 impl IDStorageCustomDecompressionQueue1_Vtbl {
1091 pub const fn new<
1092 Identity: IDStorageCustomDecompressionQueue1_Impl,
1093 const OFFSET: isize,
1094 >() -> Self {
1095 unsafe extern "system" fn GetRequests1<
1096 Identity: IDStorageCustomDecompressionQueue1_Impl,
1097 const OFFSET: isize,
1098 >(
1099 this: *mut core::ffi::c_void,
1100 flags: DSTORAGE_GET_REQUEST_FLAGS,
1101 maxrequests: u32,
1102 requests: *mut DSTORAGE_CUSTOM_DECOMPRESSION_REQUEST,
1103 numrequests: *mut u32,
1104 ) -> windows_core::HRESULT {
1105 unsafe {
1106 let this: &Identity =
1107 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1108 IDStorageCustomDecompressionQueue1_Impl::GetRequests1(
1109 this,
1110 core::mem::transmute_copy(&flags),
1111 core::mem::transmute_copy(&maxrequests),
1112 core::mem::transmute_copy(&requests),
1113 core::mem::transmute_copy(&numrequests),
1114 )
1115 .into()
1116 }
1117 }
1118 Self {
1119 base__: IDStorageCustomDecompressionQueue_Vtbl::new::<Identity, OFFSET>(),
1120 GetRequests1: GetRequests1::<Identity, OFFSET>,
1121 }
1122 }
1123 pub fn matches(iid: &windows_core::GUID) -> bool {
1124 iid == &<IDStorageCustomDecompressionQueue1 as windows_core::Interface>::IID
1125 || iid
1126 == &<IDStorageCustomDecompressionQueue as windows_core::Interface>::IID
1127 }
1128 }
1129 impl windows_core::RuntimeName for IDStorageCustomDecompressionQueue1 {}
1130 windows_core::imp::define_interface!(
1131 IDStorageFactory,
1132 IDStorageFactory_Vtbl,
1133 0x6924ea0c_c3cd_4826_b10a_f64f4ed927c1
1134 );
1135 windows_core::imp::interface_hierarchy!(IDStorageFactory, windows_core::IUnknown);
1136 impl IDStorageFactory {
1137 pub unsafe fn CreateQueue<T>(
1138 &self,
1139 desc: *const DSTORAGE_QUEUE_DESC,
1140 ) -> windows_core::Result<T>
1141 where
1142 T: windows_core::Interface,
1143 {
1144 let mut result__ = core::ptr::null_mut();
1145 unsafe {
1146 (windows_core::Interface::vtable(self).CreateQueue)(
1147 windows_core::Interface::as_raw(self),
1148 core::mem::transmute(desc),
1149 &T::IID,
1150 &mut result__,
1151 )
1152 .and_then(|| windows_core::Type::from_abi(result__))
1153 }
1154 }
1155 pub unsafe fn OpenFile<P0, T>(&self, path: P0) -> windows_core::Result<T>
1156 where
1157 P0: windows_core::Param<windows_core::PCWSTR>,
1158 T: windows_core::Interface,
1159 {
1160 let mut result__ = core::ptr::null_mut();
1161 unsafe {
1162 (windows_core::Interface::vtable(self).OpenFile)(
1163 windows_core::Interface::as_raw(self),
1164 path.param().abi(),
1165 &T::IID,
1166 &mut result__,
1167 )
1168 .and_then(|| windows_core::Type::from_abi(result__))
1169 }
1170 }
1171 pub unsafe fn CreateStatusArray<P1, T>(
1172 &self,
1173 capacity: u32,
1174 name: P1,
1175 ) -> windows_core::Result<T>
1176 where
1177 P1: windows_core::Param<windows_core::PCSTR>,
1178 T: windows_core::Interface,
1179 {
1180 let mut result__ = core::ptr::null_mut();
1181 unsafe {
1182 (windows_core::Interface::vtable(self).CreateStatusArray)(
1183 windows_core::Interface::as_raw(self),
1184 capacity,
1185 name.param().abi(),
1186 &T::IID,
1187 &mut result__,
1188 )
1189 .and_then(|| windows_core::Type::from_abi(result__))
1190 }
1191 }
1192 pub unsafe fn SetDebugFlags(&self, flags: DSTORAGE_DEBUG) {
1193 unsafe {
1194 (windows_core::Interface::vtable(self).SetDebugFlags)(
1195 windows_core::Interface::as_raw(self),
1196 flags.0 as _,
1197 )
1198 }
1199 }
1200 pub unsafe fn SetStagingBufferSize(&self, size: u32) -> windows_core::Result<()> {
1201 unsafe {
1202 (windows_core::Interface::vtable(self).SetStagingBufferSize)(
1203 windows_core::Interface::as_raw(self),
1204 size,
1205 )
1206 .ok()
1207 }
1208 }
1209 }
1210 #[repr(C)]
1211 #[doc(hidden)]
1212 pub struct IDStorageFactory_Vtbl {
1213 pub base__: windows_core::IUnknown_Vtbl,
1214 pub CreateQueue: unsafe extern "system" fn(
1215 *mut core::ffi::c_void,
1216 *const DSTORAGE_QUEUE_DESC,
1217 *const windows_core::GUID,
1218 *mut *mut core::ffi::c_void,
1219 )
1220 -> windows_core::HRESULT,
1221 pub OpenFile: unsafe extern "system" fn(
1222 *mut core::ffi::c_void,
1223 windows_core::PCWSTR,
1224 *const windows_core::GUID,
1225 *mut *mut core::ffi::c_void,
1226 ) -> windows_core::HRESULT,
1227 pub CreateStatusArray: unsafe extern "system" fn(
1228 *mut core::ffi::c_void,
1229 u32,
1230 windows_core::PCSTR,
1231 *const windows_core::GUID,
1232 *mut *mut core::ffi::c_void,
1233 )
1234 -> windows_core::HRESULT,
1235 pub SetDebugFlags: unsafe extern "system" fn(*mut core::ffi::c_void, u32),
1236 pub SetStagingBufferSize:
1237 unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT,
1238 }
1239 pub trait IDStorageFactory_Impl: windows_core::IUnknownImpl {
1240 fn CreateQueue(
1241 &self,
1242 desc: *const DSTORAGE_QUEUE_DESC,
1243 riid: *const windows_core::GUID,
1244 ppv: *mut *mut core::ffi::c_void,
1245 ) -> windows_core::Result<()>;
1246 fn OpenFile(
1247 &self,
1248 path: &windows_core::PCWSTR,
1249 riid: *const windows_core::GUID,
1250 ppv: *mut *mut core::ffi::c_void,
1251 ) -> windows_core::Result<()>;
1252 fn CreateStatusArray(
1253 &self,
1254 capacity: u32,
1255 name: &windows_core::PCSTR,
1256 riid: *const windows_core::GUID,
1257 ppv: *mut *mut core::ffi::c_void,
1258 ) -> windows_core::Result<()>;
1259 fn SetDebugFlags(&self, flags: &DSTORAGE_DEBUG);
1260 fn SetStagingBufferSize(&self, size: u32) -> windows_core::Result<()>;
1261 }
1262 impl IDStorageFactory_Vtbl {
1263 pub const fn new<Identity: IDStorageFactory_Impl, const OFFSET: isize>() -> Self {
1264 unsafe extern "system" fn CreateQueue<
1265 Identity: IDStorageFactory_Impl,
1266 const OFFSET: isize,
1267 >(
1268 this: *mut core::ffi::c_void,
1269 desc: *const DSTORAGE_QUEUE_DESC,
1270 riid: *const windows_core::GUID,
1271 ppv: *mut *mut core::ffi::c_void,
1272 ) -> windows_core::HRESULT {
1273 unsafe {
1274 let this: &Identity =
1275 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1276 IDStorageFactory_Impl::CreateQueue(
1277 this,
1278 core::mem::transmute_copy(&desc),
1279 core::mem::transmute_copy(&riid),
1280 core::mem::transmute_copy(&ppv),
1281 )
1282 .into()
1283 }
1284 }
1285 unsafe extern "system" fn OpenFile<
1286 Identity: IDStorageFactory_Impl,
1287 const OFFSET: isize,
1288 >(
1289 this: *mut core::ffi::c_void,
1290 path: windows_core::PCWSTR,
1291 riid: *const windows_core::GUID,
1292 ppv: *mut *mut core::ffi::c_void,
1293 ) -> windows_core::HRESULT {
1294 unsafe {
1295 let this: &Identity =
1296 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1297 IDStorageFactory_Impl::OpenFile(
1298 this,
1299 core::mem::transmute(&path),
1300 core::mem::transmute_copy(&riid),
1301 core::mem::transmute_copy(&ppv),
1302 )
1303 .into()
1304 }
1305 }
1306 unsafe extern "system" fn CreateStatusArray<
1307 Identity: IDStorageFactory_Impl,
1308 const OFFSET: isize,
1309 >(
1310 this: *mut core::ffi::c_void,
1311 capacity: u32,
1312 name: windows_core::PCSTR,
1313 riid: *const windows_core::GUID,
1314 ppv: *mut *mut core::ffi::c_void,
1315 ) -> windows_core::HRESULT {
1316 unsafe {
1317 let this: &Identity =
1318 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1319 IDStorageFactory_Impl::CreateStatusArray(
1320 this,
1321 core::mem::transmute_copy(&capacity),
1322 core::mem::transmute(&name),
1323 core::mem::transmute_copy(&riid),
1324 core::mem::transmute_copy(&ppv),
1325 )
1326 .into()
1327 }
1328 }
1329 unsafe extern "system" fn SetDebugFlags<
1330 Identity: IDStorageFactory_Impl,
1331 const OFFSET: isize,
1332 >(
1333 this: *mut core::ffi::c_void,
1334 flags: u32,
1335 ) {
1336 unsafe {
1337 let this: &Identity =
1338 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1339 IDStorageFactory_Impl::SetDebugFlags(this, core::mem::transmute(&flags))
1340 }
1341 }
1342 unsafe extern "system" fn SetStagingBufferSize<
1343 Identity: IDStorageFactory_Impl,
1344 const OFFSET: isize,
1345 >(
1346 this: *mut core::ffi::c_void,
1347 size: u32,
1348 ) -> windows_core::HRESULT {
1349 unsafe {
1350 let this: &Identity =
1351 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1352 IDStorageFactory_Impl::SetStagingBufferSize(
1353 this,
1354 core::mem::transmute_copy(&size),
1355 )
1356 .into()
1357 }
1358 }
1359 Self {
1360 base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
1361 CreateQueue: CreateQueue::<Identity, OFFSET>,
1362 OpenFile: OpenFile::<Identity, OFFSET>,
1363 CreateStatusArray: CreateStatusArray::<Identity, OFFSET>,
1364 SetDebugFlags: SetDebugFlags::<Identity, OFFSET>,
1365 SetStagingBufferSize: SetStagingBufferSize::<Identity, OFFSET>,
1366 }
1367 }
1368 pub fn matches(iid: &windows_core::GUID) -> bool {
1369 iid == &<IDStorageFactory as windows_core::Interface>::IID
1370 }
1371 }
1372 impl windows_core::RuntimeName for IDStorageFactory {}
1373 windows_core::imp::define_interface!(
1374 IDStorageFile,
1375 IDStorageFile_Vtbl,
1376 0x5de95e7b_955a_4868_a73c_243b29f4b8da
1377 );
1378 windows_core::imp::interface_hierarchy!(IDStorageFile, windows_core::IUnknown);
1379 impl IDStorageFile {
1380 pub unsafe fn Close(&self) {
1381 unsafe {
1382 (windows_core::Interface::vtable(self).Close)(
1383 windows_core::Interface::as_raw(self),
1384 )
1385 }
1386 }
1387 pub unsafe fn GetFileInformation(
1388 &self,
1389 info: *mut windows::Win32::Storage::FileSystem::BY_HANDLE_FILE_INFORMATION,
1390 ) -> windows_core::Result<()> {
1391 unsafe {
1392 (windows_core::Interface::vtable(self).GetFileInformation)(
1393 windows_core::Interface::as_raw(self),
1394 info as _,
1395 )
1396 .ok()
1397 }
1398 }
1399 }
1400 #[repr(C)]
1401 #[doc(hidden)]
1402 pub struct IDStorageFile_Vtbl {
1403 pub base__: windows_core::IUnknown_Vtbl,
1404 pub Close: unsafe extern "system" fn(*mut core::ffi::c_void),
1405 pub GetFileInformation: unsafe extern "system" fn(
1406 *mut core::ffi::c_void,
1407 *mut windows::Win32::Storage::FileSystem::BY_HANDLE_FILE_INFORMATION,
1408 )
1409 -> windows_core::HRESULT,
1410 }
1411 pub trait IDStorageFile_Impl: windows_core::IUnknownImpl {
1412 fn Close(&self);
1413 fn GetFileInformation(
1414 &self,
1415 info: *mut windows::Win32::Storage::FileSystem::BY_HANDLE_FILE_INFORMATION,
1416 ) -> windows_core::Result<()>;
1417 }
1418 impl IDStorageFile_Vtbl {
1419 pub const fn new<Identity: IDStorageFile_Impl, const OFFSET: isize>() -> Self {
1420 unsafe extern "system" fn Close<
1421 Identity: IDStorageFile_Impl,
1422 const OFFSET: isize,
1423 >(
1424 this: *mut core::ffi::c_void,
1425 ) {
1426 unsafe {
1427 let this: &Identity =
1428 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1429 IDStorageFile_Impl::Close(this)
1430 }
1431 }
1432 unsafe extern "system" fn GetFileInformation<
1433 Identity: IDStorageFile_Impl,
1434 const OFFSET: isize,
1435 >(
1436 this: *mut core::ffi::c_void,
1437 info: *mut windows::Win32::Storage::FileSystem::BY_HANDLE_FILE_INFORMATION,
1438 ) -> windows_core::HRESULT {
1439 unsafe {
1440 let this: &Identity =
1441 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1442 IDStorageFile_Impl::GetFileInformation(
1443 this,
1444 core::mem::transmute_copy(&info),
1445 )
1446 .into()
1447 }
1448 }
1449 Self {
1450 base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
1451 Close: Close::<Identity, OFFSET>,
1452 GetFileInformation: GetFileInformation::<Identity, OFFSET>,
1453 }
1454 }
1455 pub fn matches(iid: &windows_core::GUID) -> bool {
1456 iid == &<IDStorageFile as windows_core::Interface>::IID
1457 }
1458 }
1459 impl windows_core::RuntimeName for IDStorageFile {}
1460 windows_core::imp::define_interface!(
1461 IDStorageQueue,
1462 IDStorageQueue_Vtbl,
1463 0xcfdbd83f_9e06_4fda_8ea5_69042137f49b
1464 );
1465 windows_core::imp::interface_hierarchy!(IDStorageQueue, windows_core::IUnknown);
1466 impl IDStorageQueue {
1467 pub unsafe fn EnqueueRequest(&self, request: *const DSTORAGE_REQUEST) {
1468 unsafe {
1469 (windows_core::Interface::vtable(self).EnqueueRequest)(
1470 windows_core::Interface::as_raw(self),
1471 core::mem::transmute(request),
1472 )
1473 }
1474 }
1475 pub unsafe fn EnqueueStatus<P0>(&self, statusarray: P0, index: u32)
1476 where
1477 P0: windows_core::Param<IDStorageStatusArray>,
1478 {
1479 unsafe {
1480 (windows_core::Interface::vtable(self).EnqueueStatus)(
1481 windows_core::Interface::as_raw(self),
1482 statusarray.param().abi(),
1483 index,
1484 )
1485 }
1486 }
1487 pub unsafe fn EnqueueSignal<P0>(&self, fence: P0, value: u64)
1488 where
1489 P0: windows_core::Param<windows::Win32::Graphics::Direct3D12::ID3D12Fence>,
1490 {
1491 unsafe {
1492 (windows_core::Interface::vtable(self).EnqueueSignal)(
1493 windows_core::Interface::as_raw(self),
1494 fence.param().abi(),
1495 value,
1496 )
1497 }
1498 }
1499 pub unsafe fn Submit(&self) {
1500 unsafe {
1501 (windows_core::Interface::vtable(self).Submit)(
1502 windows_core::Interface::as_raw(self),
1503 )
1504 }
1505 }
1506 pub unsafe fn CancelRequestsWithTag(&self, mask: u64, value: u64) {
1507 unsafe {
1508 (windows_core::Interface::vtable(self).CancelRequestsWithTag)(
1509 windows_core::Interface::as_raw(self),
1510 mask,
1511 value,
1512 )
1513 }
1514 }
1515 pub unsafe fn Close(&self) {
1516 unsafe {
1517 (windows_core::Interface::vtable(self).Close)(
1518 windows_core::Interface::as_raw(self),
1519 )
1520 }
1521 }
1522 pub unsafe fn GetErrorEvent(&self) -> windows::Win32::Foundation::HANDLE {
1523 unsafe {
1524 (windows_core::Interface::vtable(self).GetErrorEvent)(
1525 windows_core::Interface::as_raw(self),
1526 )
1527 }
1528 }
1529 pub unsafe fn RetrieveErrorRecord(&self) -> DSTORAGE_ERROR_RECORD {
1530 unsafe {
1531 let mut result__ = core::mem::zeroed();
1532 (windows_core::Interface::vtable(self).RetrieveErrorRecord)(
1533 windows_core::Interface::as_raw(self),
1534 &mut result__,
1535 );
1536 core::mem::transmute(result__)
1537 }
1538 }
1539 pub unsafe fn Query(&self) -> DSTORAGE_QUEUE_INFO {
1540 unsafe {
1541 let mut result__ = core::mem::zeroed();
1542 (windows_core::Interface::vtable(self).Query)(
1543 windows_core::Interface::as_raw(self),
1544 &mut result__,
1545 );
1546 core::mem::transmute(result__)
1547 }
1548 }
1549 }
1550 #[repr(C)]
1551 #[doc(hidden)]
1552 pub struct IDStorageQueue_Vtbl {
1553 pub base__: windows_core::IUnknown_Vtbl,
1554 pub EnqueueRequest:
1555 unsafe extern "system" fn(*mut core::ffi::c_void, *const DSTORAGE_REQUEST),
1556 pub EnqueueStatus:
1557 unsafe extern "system" fn(*mut core::ffi::c_void, *mut core::ffi::c_void, u32),
1558 pub EnqueueSignal:
1559 unsafe extern "system" fn(*mut core::ffi::c_void, *mut core::ffi::c_void, u64),
1560 pub Submit: unsafe extern "system" fn(*mut core::ffi::c_void),
1561 pub CancelRequestsWithTag:
1562 unsafe extern "system" fn(*mut core::ffi::c_void, u64, u64),
1563 pub Close: unsafe extern "system" fn(*mut core::ffi::c_void),
1564 pub GetErrorEvent: unsafe extern "system" fn(
1565 *mut core::ffi::c_void,
1566 )
1567 -> windows::Win32::Foundation::HANDLE,
1568 pub RetrieveErrorRecord:
1569 unsafe extern "system" fn(*mut core::ffi::c_void, *mut DSTORAGE_ERROR_RECORD),
1570 pub Query:
1571 unsafe extern "system" fn(*mut core::ffi::c_void, *mut DSTORAGE_QUEUE_INFO),
1572 }
1573 pub trait IDStorageQueue_Impl: windows_core::IUnknownImpl {
1574 fn EnqueueRequest(&self, request: *const DSTORAGE_REQUEST);
1575 fn EnqueueStatus(
1576 &self,
1577 statusarray: windows_core::Ref<'_, IDStorageStatusArray>,
1578 index: u32,
1579 );
1580 fn EnqueueSignal(
1581 &self,
1582 fence: windows_core::Ref<'_, windows::Win32::Graphics::Direct3D12::ID3D12Fence>,
1583 value: u64,
1584 );
1585 fn Submit(&self);
1586 fn CancelRequestsWithTag(&self, mask: u64, value: u64);
1587 fn Close(&self);
1588 fn GetErrorEvent(&self) -> windows::Win32::Foundation::HANDLE;
1589 fn RetrieveErrorRecord(&self, record: *mut DSTORAGE_ERROR_RECORD);
1590 fn Query(&self, info: *mut DSTORAGE_QUEUE_INFO);
1591 }
1592 impl IDStorageQueue_Vtbl {
1593 pub const fn new<Identity: IDStorageQueue_Impl, const OFFSET: isize>() -> Self {
1594 unsafe extern "system" fn EnqueueRequest<
1595 Identity: IDStorageQueue_Impl,
1596 const OFFSET: isize,
1597 >(
1598 this: *mut core::ffi::c_void,
1599 request: *const DSTORAGE_REQUEST,
1600 ) {
1601 unsafe {
1602 let this: &Identity =
1603 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1604 IDStorageQueue_Impl::EnqueueRequest(
1605 this,
1606 core::mem::transmute_copy(&request),
1607 )
1608 }
1609 }
1610 unsafe extern "system" fn EnqueueStatus<
1611 Identity: IDStorageQueue_Impl,
1612 const OFFSET: isize,
1613 >(
1614 this: *mut core::ffi::c_void,
1615 statusarray: *mut core::ffi::c_void,
1616 index: u32,
1617 ) {
1618 unsafe {
1619 let this: &Identity =
1620 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1621 IDStorageQueue_Impl::EnqueueStatus(
1622 this,
1623 core::mem::transmute_copy(&statusarray),
1624 core::mem::transmute_copy(&index),
1625 )
1626 }
1627 }
1628 unsafe extern "system" fn EnqueueSignal<
1629 Identity: IDStorageQueue_Impl,
1630 const OFFSET: isize,
1631 >(
1632 this: *mut core::ffi::c_void,
1633 fence: *mut core::ffi::c_void,
1634 value: u64,
1635 ) {
1636 unsafe {
1637 let this: &Identity =
1638 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1639 IDStorageQueue_Impl::EnqueueSignal(
1640 this,
1641 core::mem::transmute_copy(&fence),
1642 core::mem::transmute_copy(&value),
1643 )
1644 }
1645 }
1646 unsafe extern "system" fn Submit<
1647 Identity: IDStorageQueue_Impl,
1648 const OFFSET: isize,
1649 >(
1650 this: *mut core::ffi::c_void,
1651 ) {
1652 unsafe {
1653 let this: &Identity =
1654 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1655 IDStorageQueue_Impl::Submit(this)
1656 }
1657 }
1658 unsafe extern "system" fn CancelRequestsWithTag<
1659 Identity: IDStorageQueue_Impl,
1660 const OFFSET: isize,
1661 >(
1662 this: *mut core::ffi::c_void,
1663 mask: u64,
1664 value: u64,
1665 ) {
1666 unsafe {
1667 let this: &Identity =
1668 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1669 IDStorageQueue_Impl::CancelRequestsWithTag(
1670 this,
1671 core::mem::transmute_copy(&mask),
1672 core::mem::transmute_copy(&value),
1673 )
1674 }
1675 }
1676 unsafe extern "system" fn Close<
1677 Identity: IDStorageQueue_Impl,
1678 const OFFSET: isize,
1679 >(
1680 this: *mut core::ffi::c_void,
1681 ) {
1682 unsafe {
1683 let this: &Identity =
1684 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1685 IDStorageQueue_Impl::Close(this)
1686 }
1687 }
1688 unsafe extern "system" fn GetErrorEvent<
1689 Identity: IDStorageQueue_Impl,
1690 const OFFSET: isize,
1691 >(
1692 this: *mut core::ffi::c_void,
1693 ) -> windows::Win32::Foundation::HANDLE {
1694 unsafe {
1695 let this: &Identity =
1696 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1697 IDStorageQueue_Impl::GetErrorEvent(this)
1698 }
1699 }
1700 unsafe extern "system" fn RetrieveErrorRecord<
1701 Identity: IDStorageQueue_Impl,
1702 const OFFSET: isize,
1703 >(
1704 this: *mut core::ffi::c_void,
1705 record: *mut DSTORAGE_ERROR_RECORD,
1706 ) {
1707 unsafe {
1708 let this: &Identity =
1709 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1710 IDStorageQueue_Impl::RetrieveErrorRecord(
1711 this,
1712 core::mem::transmute_copy(&record),
1713 )
1714 }
1715 }
1716 unsafe extern "system" fn Query<
1717 Identity: IDStorageQueue_Impl,
1718 const OFFSET: isize,
1719 >(
1720 this: *mut core::ffi::c_void,
1721 info: *mut DSTORAGE_QUEUE_INFO,
1722 ) {
1723 unsafe {
1724 let this: &Identity =
1725 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1726 IDStorageQueue_Impl::Query(this, core::mem::transmute_copy(&info))
1727 }
1728 }
1729 Self {
1730 base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
1731 EnqueueRequest: EnqueueRequest::<Identity, OFFSET>,
1732 EnqueueStatus: EnqueueStatus::<Identity, OFFSET>,
1733 EnqueueSignal: EnqueueSignal::<Identity, OFFSET>,
1734 Submit: Submit::<Identity, OFFSET>,
1735 CancelRequestsWithTag: CancelRequestsWithTag::<Identity, OFFSET>,
1736 Close: Close::<Identity, OFFSET>,
1737 GetErrorEvent: GetErrorEvent::<Identity, OFFSET>,
1738 RetrieveErrorRecord: RetrieveErrorRecord::<Identity, OFFSET>,
1739 Query: Query::<Identity, OFFSET>,
1740 }
1741 }
1742 pub fn matches(iid: &windows_core::GUID) -> bool {
1743 iid == &<IDStorageQueue as windows_core::Interface>::IID
1744 }
1745 }
1746 impl windows_core::RuntimeName for IDStorageQueue {}
1747 windows_core::imp::define_interface!(
1748 IDStorageQueue1,
1749 IDStorageQueue1_Vtbl,
1750 0xdd2f482c_5eff_41e8_9c9e_d2374b278128
1751 );
1752 impl core::ops::Deref for IDStorageQueue1 {
1753 type Target = IDStorageQueue;
1754 fn deref(&self) -> &Self::Target {
1755 unsafe { core::mem::transmute(self) }
1756 }
1757 }
1758 windows_core::imp::interface_hierarchy!(
1759 IDStorageQueue1,
1760 windows_core::IUnknown,
1761 IDStorageQueue
1762 );
1763 impl IDStorageQueue1 {
1764 pub unsafe fn EnqueueSetEvent(&self, handle: windows::Win32::Foundation::HANDLE) {
1765 unsafe {
1766 (windows_core::Interface::vtable(self).EnqueueSetEvent)(
1767 windows_core::Interface::as_raw(self),
1768 handle,
1769 )
1770 }
1771 }
1772 }
1773 #[repr(C)]
1774 #[doc(hidden)]
1775 pub struct IDStorageQueue1_Vtbl {
1776 pub base__: IDStorageQueue_Vtbl,
1777 pub EnqueueSetEvent: unsafe extern "system" fn(
1778 *mut core::ffi::c_void,
1779 windows::Win32::Foundation::HANDLE,
1780 ),
1781 }
1782 pub trait IDStorageQueue1_Impl: IDStorageQueue_Impl {
1783 fn EnqueueSetEvent(&self, handle: windows::Win32::Foundation::HANDLE);
1784 }
1785 impl IDStorageQueue1_Vtbl {
1786 pub const fn new<Identity: IDStorageQueue1_Impl, const OFFSET: isize>() -> Self {
1787 unsafe extern "system" fn EnqueueSetEvent<
1788 Identity: IDStorageQueue1_Impl,
1789 const OFFSET: isize,
1790 >(
1791 this: *mut core::ffi::c_void,
1792 handle: windows::Win32::Foundation::HANDLE,
1793 ) {
1794 unsafe {
1795 let this: &Identity =
1796 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1797 IDStorageQueue1_Impl::EnqueueSetEvent(
1798 this,
1799 core::mem::transmute_copy(&handle),
1800 )
1801 }
1802 }
1803 Self {
1804 base__: IDStorageQueue_Vtbl::new::<Identity, OFFSET>(),
1805 EnqueueSetEvent: EnqueueSetEvent::<Identity, OFFSET>,
1806 }
1807 }
1808 pub fn matches(iid: &windows_core::GUID) -> bool {
1809 iid == &<IDStorageQueue1 as windows_core::Interface>::IID
1810 || iid == &<IDStorageQueue as windows_core::Interface>::IID
1811 }
1812 }
1813 impl windows_core::RuntimeName for IDStorageQueue1 {}
1814 windows_core::imp::define_interface!(
1815 IDStorageQueue2,
1816 IDStorageQueue2_Vtbl,
1817 0xb1c9d643_3a49_44a2_b46f_653649470d18
1818 );
1819 impl core::ops::Deref for IDStorageQueue2 {
1820 type Target = IDStorageQueue1;
1821 fn deref(&self) -> &Self::Target {
1822 unsafe { core::mem::transmute(self) }
1823 }
1824 }
1825 windows_core::imp::interface_hierarchy!(
1826 IDStorageQueue2,
1827 windows_core::IUnknown,
1828 IDStorageQueue,
1829 IDStorageQueue1
1830 );
1831 impl IDStorageQueue2 {
1832 pub unsafe fn GetCompressionSupport(
1833 &self,
1834 format: DSTORAGE_COMPRESSION_FORMAT,
1835 ) -> DSTORAGE_COMPRESSION_SUPPORT {
1836 unsafe {
1837 (windows_core::Interface::vtable(self).GetCompressionSupport)(
1838 windows_core::Interface::as_raw(self),
1839 format,
1840 )
1841 }
1842 }
1843 }
1844 #[repr(C)]
1845 #[doc(hidden)]
1846 pub struct IDStorageQueue2_Vtbl {
1847 pub base__: IDStorageQueue1_Vtbl,
1848 pub GetCompressionSupport:
1849 unsafe extern "system" fn(
1850 *mut core::ffi::c_void,
1851 DSTORAGE_COMPRESSION_FORMAT,
1852 ) -> DSTORAGE_COMPRESSION_SUPPORT,
1853 }
1854 pub trait IDStorageQueue2_Impl: IDStorageQueue1_Impl {
1855 fn GetCompressionSupport(
1856 &self,
1857 format: DSTORAGE_COMPRESSION_FORMAT,
1858 ) -> DSTORAGE_COMPRESSION_SUPPORT;
1859 }
1860 impl IDStorageQueue2_Vtbl {
1861 pub const fn new<Identity: IDStorageQueue2_Impl, const OFFSET: isize>() -> Self {
1862 unsafe extern "system" fn GetCompressionSupport<
1863 Identity: IDStorageQueue2_Impl,
1864 const OFFSET: isize,
1865 >(
1866 this: *mut core::ffi::c_void,
1867 format: DSTORAGE_COMPRESSION_FORMAT,
1868 ) -> DSTORAGE_COMPRESSION_SUPPORT {
1869 unsafe {
1870 let this: &Identity =
1871 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1872 IDStorageQueue2_Impl::GetCompressionSupport(
1873 this,
1874 core::mem::transmute_copy(&format),
1875 )
1876 }
1877 }
1878 Self {
1879 base__: IDStorageQueue1_Vtbl::new::<Identity, OFFSET>(),
1880 GetCompressionSupport: GetCompressionSupport::<Identity, OFFSET>,
1881 }
1882 }
1883 pub fn matches(iid: &windows_core::GUID) -> bool {
1884 iid == &<IDStorageQueue2 as windows_core::Interface>::IID
1885 || iid == &<IDStorageQueue as windows_core::Interface>::IID
1886 || iid == &<IDStorageQueue1 as windows_core::Interface>::IID
1887 }
1888 }
1889 impl windows_core::RuntimeName for IDStorageQueue2 {}
1890 windows_core::imp::define_interface!(
1891 IDStorageQueue3,
1892 IDStorageQueue3_Vtbl,
1893 0xdeb54c52_eca8_46b3_82a7_031b72262653
1894 );
1895 impl core::ops::Deref for IDStorageQueue3 {
1896 type Target = IDStorageQueue2;
1897 fn deref(&self) -> &Self::Target {
1898 unsafe { core::mem::transmute(self) }
1899 }
1900 }
1901 windows_core::imp::interface_hierarchy!(
1902 IDStorageQueue3,
1903 windows_core::IUnknown,
1904 IDStorageQueue,
1905 IDStorageQueue1,
1906 IDStorageQueue2
1907 );
1908 impl IDStorageQueue3 {
1909 pub unsafe fn EnqueueRequests<P2>(
1910 &self,
1911 requests: &[DSTORAGE_REQUEST],
1912 fence: P2,
1913 value: u64,
1914 flag: DSTORAGE_ENQUEUE_REQUEST_FLAGS,
1915 ) where
1916 P2: windows_core::Param<windows::Win32::Graphics::Direct3D12::ID3D12Fence>,
1917 {
1918 unsafe {
1919 (windows_core::Interface::vtable(self).EnqueueRequests)(
1920 windows_core::Interface::as_raw(self),
1921 core::mem::transmute(requests.as_ptr()),
1922 requests.len().try_into().unwrap(),
1923 fence.param().abi(),
1924 value,
1925 flag,
1926 )
1927 }
1928 }
1929 }
1930 #[repr(C)]
1931 #[doc(hidden)]
1932 pub struct IDStorageQueue3_Vtbl {
1933 pub base__: IDStorageQueue2_Vtbl,
1934 pub EnqueueRequests: unsafe extern "system" fn(
1935 *mut core::ffi::c_void,
1936 *const DSTORAGE_REQUEST,
1937 u32,
1938 *mut core::ffi::c_void,
1939 u64,
1940 DSTORAGE_ENQUEUE_REQUEST_FLAGS,
1941 ),
1942 }
1943 pub trait IDStorageQueue3_Impl: IDStorageQueue2_Impl {
1944 fn EnqueueRequests(
1945 &self,
1946 requests: *const DSTORAGE_REQUEST,
1947 numrequests: u32,
1948 fence: windows_core::Ref<'_, windows::Win32::Graphics::Direct3D12::ID3D12Fence>,
1949 value: u64,
1950 flag: DSTORAGE_ENQUEUE_REQUEST_FLAGS,
1951 );
1952 }
1953 impl IDStorageQueue3_Vtbl {
1954 pub const fn new<Identity: IDStorageQueue3_Impl, const OFFSET: isize>() -> Self {
1955 unsafe extern "system" fn EnqueueRequests<
1956 Identity: IDStorageQueue3_Impl,
1957 const OFFSET: isize,
1958 >(
1959 this: *mut core::ffi::c_void,
1960 requests: *const DSTORAGE_REQUEST,
1961 numrequests: u32,
1962 fence: *mut core::ffi::c_void,
1963 value: u64,
1964 flag: DSTORAGE_ENQUEUE_REQUEST_FLAGS,
1965 ) {
1966 unsafe {
1967 let this: &Identity =
1968 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
1969 IDStorageQueue3_Impl::EnqueueRequests(
1970 this,
1971 core::mem::transmute_copy(&requests),
1972 core::mem::transmute_copy(&numrequests),
1973 core::mem::transmute_copy(&fence),
1974 core::mem::transmute_copy(&value),
1975 core::mem::transmute_copy(&flag),
1976 )
1977 }
1978 }
1979 Self {
1980 base__: IDStorageQueue2_Vtbl::new::<Identity, OFFSET>(),
1981 EnqueueRequests: EnqueueRequests::<Identity, OFFSET>,
1982 }
1983 }
1984 pub fn matches(iid: &windows_core::GUID) -> bool {
1985 iid == &<IDStorageQueue3 as windows_core::Interface>::IID
1986 || iid == &<IDStorageQueue as windows_core::Interface>::IID
1987 || iid == &<IDStorageQueue1 as windows_core::Interface>::IID
1988 || iid == &<IDStorageQueue2 as windows_core::Interface>::IID
1989 }
1990 }
1991 impl windows_core::RuntimeName for IDStorageQueue3 {}
1992 windows_core::imp::define_interface!(
1993 IDStorageStatusArray,
1994 IDStorageStatusArray_Vtbl,
1995 0x82397587_7cd5_453b_a02e_31379bd64656
1996 );
1997 windows_core::imp::interface_hierarchy!(IDStorageStatusArray, windows_core::IUnknown);
1998 impl IDStorageStatusArray {
1999 pub unsafe fn IsComplete(&self, index: u32) -> bool {
2000 unsafe {
2001 (windows_core::Interface::vtable(self).IsComplete)(
2002 windows_core::Interface::as_raw(self),
2003 index,
2004 )
2005 }
2006 }
2007 pub unsafe fn GetHResult(&self, index: u32) -> windows_core::Result<()> {
2008 unsafe {
2009 (windows_core::Interface::vtable(self).GetHResult)(
2010 windows_core::Interface::as_raw(self),
2011 index,
2012 )
2013 .ok()
2014 }
2015 }
2016 }
2017 #[repr(C)]
2018 #[doc(hidden)]
2019 pub struct IDStorageStatusArray_Vtbl {
2020 pub base__: windows_core::IUnknown_Vtbl,
2021 pub IsComplete: unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> bool,
2022 pub GetHResult:
2023 unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT,
2024 }
2025 pub trait IDStorageStatusArray_Impl: windows_core::IUnknownImpl {
2026 fn IsComplete(&self, index: u32) -> bool;
2027 fn GetHResult(&self, index: u32) -> windows_core::Result<()>;
2028 }
2029 impl IDStorageStatusArray_Vtbl {
2030 pub const fn new<Identity: IDStorageStatusArray_Impl, const OFFSET: isize>() -> Self
2031 {
2032 unsafe extern "system" fn IsComplete<
2033 Identity: IDStorageStatusArray_Impl,
2034 const OFFSET: isize,
2035 >(
2036 this: *mut core::ffi::c_void,
2037 index: u32,
2038 ) -> bool {
2039 unsafe {
2040 let this: &Identity =
2041 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
2042 IDStorageStatusArray_Impl::IsComplete(
2043 this,
2044 core::mem::transmute_copy(&index),
2045 )
2046 }
2047 }
2048 unsafe extern "system" fn GetHResult<
2049 Identity: IDStorageStatusArray_Impl,
2050 const OFFSET: isize,
2051 >(
2052 this: *mut core::ffi::c_void,
2053 index: u32,
2054 ) -> windows_core::HRESULT {
2055 unsafe {
2056 let this: &Identity =
2057 &*((this as *const *const ()).offset(OFFSET) as *const Identity);
2058 IDStorageStatusArray_Impl::GetHResult(
2059 this,
2060 core::mem::transmute_copy(&index),
2061 )
2062 .into()
2063 }
2064 }
2065 Self {
2066 base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
2067 IsComplete: IsComplete::<Identity, OFFSET>,
2068 GetHResult: GetHResult::<Identity, OFFSET>,
2069 }
2070 }
2071 pub fn matches(iid: &windows_core::GUID) -> bool {
2072 iid == &<IDStorageStatusArray as windows_core::Interface>::IID
2073 }
2074 }
2075 impl windows_core::RuntimeName for IDStorageStatusArray {}
2076 }
2077 }
2078}