locum 0.1.4

Captures everything a Direct3D 11 game draws in a frame, to look at, query, change and replay: d3d11.dll and dxgi.dll beside the game that watch every call on its way to the real runtime.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
//! Generated by `cargo xtask gen` from the `windows` crate's `ID3D12WorkGraphProperties_Vtbl`; do not edit.

#![allow(
    non_snake_case,
    clippy::too_many_arguments,
    clippy::missing_safety_doc,
    dead_code
)]

use core::ffi::c_void;

/// Every method of `ID3D12WorkGraphProperties` in vtable order. The defaults forward to the wrapped object [`WorkGraph12Methods::inner`].
///
/// # Safety
/// The implementing type must be `#[repr(C)]` with a pointer to [`vtable`]'s table as its first field,
/// and `inner` must return a live `ID3D12WorkGraphProperties`.
pub unsafe trait WorkGraph12Methods: Sized {
    /// The wrapped object, an `ID3D12WorkGraphProperties`.
    fn inner(&self) -> *mut c_void;
    unsafe fn QueryInterface(
        &self,
        iid: *const windows::core::GUID,
        out: *mut *mut c_void,
    ) -> windows::core::HRESULT;
    unsafe fn AddRef(&self) -> u32;
    unsafe fn Release(&self) -> u32;
    unsafe fn GetNumWorkGraphs(&self) -> u32 {
        unsafe { real::GetNumWorkGraphs(self.inner()) }
    }
    unsafe fn GetProgramName(&self, a0: u32) -> windows::core::PCWSTR {
        unsafe { real::GetProgramName(self.inner(), a0) }
    }
    unsafe fn GetWorkGraphIndex(&self, a0: windows::core::PCWSTR) -> u32 {
        unsafe { real::GetWorkGraphIndex(self.inner(), a0) }
    }
    unsafe fn GetNumNodes(&self, a0: u32) -> u32 {
        unsafe { real::GetNumNodes(self.inner(), a0) }
    }
    unsafe fn GetNodeID(
        &self,
        a0: *mut windows::Win32::Graphics::Direct3D12::D3D12_NODE_ID,
        a1: u32,
        a2: u32,
    ) {
        unsafe { real::GetNodeID(self.inner(), a0, a1, a2) }
    }
    unsafe fn GetNodeIndex(&self, a0: u32, a1: windows::Win32::Graphics::Direct3D12::D3D12_NODE_ID) -> u32 {
        unsafe { real::GetNodeIndex(self.inner(), a0, a1) }
    }
    unsafe fn GetNodeLocalRootArgumentsTableIndex(&self, a0: u32, a1: u32) -> u32 {
        unsafe { real::GetNodeLocalRootArgumentsTableIndex(self.inner(), a0, a1) }
    }
    unsafe fn GetNumEntrypoints(&self, a0: u32) -> u32 {
        unsafe { real::GetNumEntrypoints(self.inner(), a0) }
    }
    unsafe fn GetEntrypointID(
        &self,
        a0: *mut windows::Win32::Graphics::Direct3D12::D3D12_NODE_ID,
        a1: u32,
        a2: u32,
    ) {
        unsafe { real::GetEntrypointID(self.inner(), a0, a1, a2) }
    }
    unsafe fn GetEntrypointIndex(
        &self,
        a0: u32,
        a1: windows::Win32::Graphics::Direct3D12::D3D12_NODE_ID,
    ) -> u32 {
        unsafe { real::GetEntrypointIndex(self.inner(), a0, a1) }
    }
    unsafe fn GetEntrypointRecordSizeInBytes(&self, a0: u32, a1: u32) -> u32 {
        unsafe { real::GetEntrypointRecordSizeInBytes(self.inner(), a0, a1) }
    }
    unsafe fn GetWorkGraphMemoryRequirements(
        &self,
        a0: u32,
        a1: *mut windows::Win32::Graphics::Direct3D12::D3D12_WORK_GRAPH_MEMORY_REQUIREMENTS,
    ) {
        unsafe { real::GetWorkGraphMemoryRequirements(self.inner(), a0, a1) }
    }
    unsafe fn GetEntrypointRecordAlignmentInBytes(&self, a0: u32, a1: u32) -> u32 {
        unsafe { real::GetEntrypointRecordAlignmentInBytes(self.inner(), a0, a1) }
    }
}

/// Each method called on the real (wrapped) object: the trait's defaults, and overrides that still want the
/// real behaviour.
pub mod real {
    use core::ffi::c_void;

    /// `GetNumWorkGraphs` on the real object.
    pub unsafe fn GetNumWorkGraphs(inner: *mut c_void) -> u32 {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12WorkGraphProperties_Vtbl)))
                .GetNumWorkGraphs)(inner)
        }
    }
    /// `GetProgramName` on the real object.
    pub unsafe fn GetProgramName(inner: *mut c_void, a0: u32) -> windows::core::PCWSTR {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12WorkGraphProperties_Vtbl)))
                .GetProgramName)(inner, a0)
        }
    }
    /// `GetWorkGraphIndex` on the real object.
    pub unsafe fn GetWorkGraphIndex(inner: *mut c_void, a0: windows::core::PCWSTR) -> u32 {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12WorkGraphProperties_Vtbl)))
                .GetWorkGraphIndex)(inner, a0)
        }
    }
    /// `GetNumNodes` on the real object.
    pub unsafe fn GetNumNodes(inner: *mut c_void, a0: u32) -> u32 {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12WorkGraphProperties_Vtbl)))
                .GetNumNodes)(inner, a0)
        }
    }
    /// `GetNodeID` on the real object.
    pub unsafe fn GetNodeID(
        inner: *mut c_void,
        a0: *mut windows::Win32::Graphics::Direct3D12::D3D12_NODE_ID,
        a1: u32,
        a2: u32,
    ) {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12WorkGraphProperties_Vtbl)))
                .GetNodeID)(inner, a0, a1, a2)
        }
    }
    /// `GetNodeIndex` on the real object.
    pub unsafe fn GetNodeIndex(
        inner: *mut c_void,
        a0: u32,
        a1: windows::Win32::Graphics::Direct3D12::D3D12_NODE_ID,
    ) -> u32 {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12WorkGraphProperties_Vtbl)))
                .GetNodeIndex)(inner, a0, a1)
        }
    }
    /// `GetNodeLocalRootArgumentsTableIndex` on the real object.
    pub unsafe fn GetNodeLocalRootArgumentsTableIndex(inner: *mut c_void, a0: u32, a1: u32) -> u32 {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12WorkGraphProperties_Vtbl)))
                .GetNodeLocalRootArgumentsTableIndex)(inner, a0, a1)
        }
    }
    /// `GetNumEntrypoints` on the real object.
    pub unsafe fn GetNumEntrypoints(inner: *mut c_void, a0: u32) -> u32 {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12WorkGraphProperties_Vtbl)))
                .GetNumEntrypoints)(inner, a0)
        }
    }
    /// `GetEntrypointID` on the real object.
    pub unsafe fn GetEntrypointID(
        inner: *mut c_void,
        a0: *mut windows::Win32::Graphics::Direct3D12::D3D12_NODE_ID,
        a1: u32,
        a2: u32,
    ) {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12WorkGraphProperties_Vtbl)))
                .GetEntrypointID)(inner, a0, a1, a2)
        }
    }
    /// `GetEntrypointIndex` on the real object.
    pub unsafe fn GetEntrypointIndex(
        inner: *mut c_void,
        a0: u32,
        a1: windows::Win32::Graphics::Direct3D12::D3D12_NODE_ID,
    ) -> u32 {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12WorkGraphProperties_Vtbl)))
                .GetEntrypointIndex)(inner, a0, a1)
        }
    }
    /// `GetEntrypointRecordSizeInBytes` on the real object.
    pub unsafe fn GetEntrypointRecordSizeInBytes(inner: *mut c_void, a0: u32, a1: u32) -> u32 {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12WorkGraphProperties_Vtbl)))
                .GetEntrypointRecordSizeInBytes)(inner, a0, a1)
        }
    }
    /// `GetWorkGraphMemoryRequirements` on the real object.
    pub unsafe fn GetWorkGraphMemoryRequirements(
        inner: *mut c_void,
        a0: u32,
        a1: *mut windows::Win32::Graphics::Direct3D12::D3D12_WORK_GRAPH_MEMORY_REQUIREMENTS,
    ) {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12WorkGraphProperties_Vtbl)))
                .GetWorkGraphMemoryRequirements)(inner, a0, a1)
        }
    }
    /// `GetEntrypointRecordAlignmentInBytes` on the real object.
    pub unsafe fn GetEntrypointRecordAlignmentInBytes(inner: *mut c_void, a0: u32, a1: u32) -> u32 {
        unsafe {
            ((*(*(inner
                as *const *const windows::Win32::Graphics::Direct3D12::ID3D12WorkGraphProperties_Vtbl)))
                .GetEntrypointRecordAlignmentInBytes)(inner, a0, a1)
        }
    }
}

unsafe extern "system" fn QueryInterface<T: WorkGraph12Methods>(
    this: *mut c_void,
    iid: *const windows::core::GUID,
    out: *mut *mut c_void,
) -> windows::core::HRESULT {
    unsafe { (*(this as *const T)).QueryInterface(iid, out) }
}
unsafe extern "system" fn AddRef<T: WorkGraph12Methods>(this: *mut c_void) -> u32 {
    unsafe { (*(this as *const T)).AddRef() }
}
unsafe extern "system" fn Release<T: WorkGraph12Methods>(this: *mut c_void) -> u32 {
    unsafe { (*(this as *const T)).Release() }
}
unsafe extern "system" fn GetNumWorkGraphs<T: WorkGraph12Methods>(this: *mut c_void) -> u32 {
    unsafe { (*(this as *const T)).GetNumWorkGraphs() }
}
unsafe extern "system" fn GetProgramName<T: WorkGraph12Methods>(
    this: *mut c_void,
    a0: u32,
) -> windows::core::PCWSTR {
    unsafe { (*(this as *const T)).GetProgramName(a0) }
}
unsafe extern "system" fn GetWorkGraphIndex<T: WorkGraph12Methods>(
    this: *mut c_void,
    a0: windows::core::PCWSTR,
) -> u32 {
    unsafe { (*(this as *const T)).GetWorkGraphIndex(a0) }
}
unsafe extern "system" fn GetNumNodes<T: WorkGraph12Methods>(this: *mut c_void, a0: u32) -> u32 {
    unsafe { (*(this as *const T)).GetNumNodes(a0) }
}
unsafe extern "system" fn GetNodeID<T: WorkGraph12Methods>(
    this: *mut c_void,
    a0: *mut windows::Win32::Graphics::Direct3D12::D3D12_NODE_ID,
    a1: u32,
    a2: u32,
) {
    unsafe { (*(this as *const T)).GetNodeID(a0, a1, a2) }
}
unsafe extern "system" fn GetNodeIndex<T: WorkGraph12Methods>(
    this: *mut c_void,
    a0: u32,
    a1: windows::Win32::Graphics::Direct3D12::D3D12_NODE_ID,
) -> u32 {
    unsafe { (*(this as *const T)).GetNodeIndex(a0, a1) }
}
unsafe extern "system" fn GetNodeLocalRootArgumentsTableIndex<T: WorkGraph12Methods>(
    this: *mut c_void,
    a0: u32,
    a1: u32,
) -> u32 {
    unsafe { (*(this as *const T)).GetNodeLocalRootArgumentsTableIndex(a0, a1) }
}
unsafe extern "system" fn GetNumEntrypoints<T: WorkGraph12Methods>(this: *mut c_void, a0: u32) -> u32 {
    unsafe { (*(this as *const T)).GetNumEntrypoints(a0) }
}
unsafe extern "system" fn GetEntrypointID<T: WorkGraph12Methods>(
    this: *mut c_void,
    a0: *mut windows::Win32::Graphics::Direct3D12::D3D12_NODE_ID,
    a1: u32,
    a2: u32,
) {
    unsafe { (*(this as *const T)).GetEntrypointID(a0, a1, a2) }
}
unsafe extern "system" fn GetEntrypointIndex<T: WorkGraph12Methods>(
    this: *mut c_void,
    a0: u32,
    a1: windows::Win32::Graphics::Direct3D12::D3D12_NODE_ID,
) -> u32 {
    unsafe { (*(this as *const T)).GetEntrypointIndex(a0, a1) }
}
unsafe extern "system" fn GetEntrypointRecordSizeInBytes<T: WorkGraph12Methods>(
    this: *mut c_void,
    a0: u32,
    a1: u32,
) -> u32 {
    unsafe { (*(this as *const T)).GetEntrypointRecordSizeInBytes(a0, a1) }
}
unsafe extern "system" fn GetWorkGraphMemoryRequirements<T: WorkGraph12Methods>(
    this: *mut c_void,
    a0: u32,
    a1: *mut windows::Win32::Graphics::Direct3D12::D3D12_WORK_GRAPH_MEMORY_REQUIREMENTS,
) {
    unsafe { (*(this as *const T)).GetWorkGraphMemoryRequirements(a0, a1) }
}
unsafe extern "system" fn GetEntrypointRecordAlignmentInBytes<T: WorkGraph12Methods>(
    this: *mut c_void,
    a0: u32,
    a1: u32,
) -> u32 {
    unsafe { (*(this as *const T)).GetEntrypointRecordAlignmentInBytes(a0, a1) }
}

#[allow(clippy::let_and_return)] // Uniform post-call interception in generated methods.
unsafe impl WorkGraph12Methods for crate::d3d12::Object {
    fn inner(&self) -> *mut c_void {
        self.real()
    }
    unsafe fn QueryInterface(
        &self,
        iid: *const windows::core::GUID,
        out: *mut *mut c_void,
    ) -> windows::core::HRESULT {
        unsafe { self.query(iid, out) }
    }
    unsafe fn AddRef(&self) -> u32 {
        self.add_ref()
    }
    unsafe fn Release(&self) -> u32 {
        unsafe { self.release() }
    }
    unsafe fn GetNumWorkGraphs(&self) -> u32 {
        unsafe {
            let result = real::GetNumWorkGraphs(self.real());
            result
        }
    }
    unsafe fn GetProgramName(&self, a0: u32) -> windows::core::PCWSTR {
        unsafe {
            let result = real::GetProgramName(self.real(), a0);
            result
        }
    }
    unsafe fn GetWorkGraphIndex(&self, a0: windows::core::PCWSTR) -> u32 {
        unsafe {
            let result = real::GetWorkGraphIndex(self.real(), a0);
            result
        }
    }
    unsafe fn GetNumNodes(&self, a0: u32) -> u32 {
        unsafe {
            let result = real::GetNumNodes(self.real(), a0);
            result
        }
    }
    unsafe fn GetNodeID(
        &self,
        a0: *mut windows::Win32::Graphics::Direct3D12::D3D12_NODE_ID,
        a1: u32,
        a2: u32,
    ) {
        unsafe {
            real::GetNodeID(self.real(), a0, a1, a2);
        }
    }
    unsafe fn GetNodeIndex(&self, a0: u32, a1: windows::Win32::Graphics::Direct3D12::D3D12_NODE_ID) -> u32 {
        unsafe {
            let result = real::GetNodeIndex(self.real(), a0, a1);
            result
        }
    }
    unsafe fn GetNodeLocalRootArgumentsTableIndex(&self, a0: u32, a1: u32) -> u32 {
        unsafe {
            let result = real::GetNodeLocalRootArgumentsTableIndex(self.real(), a0, a1);
            result
        }
    }
    unsafe fn GetNumEntrypoints(&self, a0: u32) -> u32 {
        unsafe {
            let result = real::GetNumEntrypoints(self.real(), a0);
            result
        }
    }
    unsafe fn GetEntrypointID(
        &self,
        a0: *mut windows::Win32::Graphics::Direct3D12::D3D12_NODE_ID,
        a1: u32,
        a2: u32,
    ) {
        unsafe {
            real::GetEntrypointID(self.real(), a0, a1, a2);
        }
    }
    unsafe fn GetEntrypointIndex(
        &self,
        a0: u32,
        a1: windows::Win32::Graphics::Direct3D12::D3D12_NODE_ID,
    ) -> u32 {
        unsafe {
            let result = real::GetEntrypointIndex(self.real(), a0, a1);
            result
        }
    }
    unsafe fn GetEntrypointRecordSizeInBytes(&self, a0: u32, a1: u32) -> u32 {
        unsafe {
            let result = real::GetEntrypointRecordSizeInBytes(self.real(), a0, a1);
            result
        }
    }
    unsafe fn GetWorkGraphMemoryRequirements(
        &self,
        a0: u32,
        a1: *mut windows::Win32::Graphics::Direct3D12::D3D12_WORK_GRAPH_MEMORY_REQUIREMENTS,
    ) {
        unsafe {
            real::GetWorkGraphMemoryRequirements(self.real(), a0, a1);
        }
    }
    unsafe fn GetEntrypointRecordAlignmentInBytes(&self, a0: u32, a1: u32) -> u32 {
        unsafe {
            let result = real::GetEntrypointRecordAlignmentInBytes(self.real(), a0, a1);
            result
        }
    }
}

/// The `ID3D12WorkGraphProperties` vtable whose entries call `T`'s methods.
pub const fn vtable<T: WorkGraph12Methods>()
-> windows::Win32::Graphics::Direct3D12::ID3D12WorkGraphProperties_Vtbl {
    windows::Win32::Graphics::Direct3D12::ID3D12WorkGraphProperties_Vtbl {
        base__: windows::core::IUnknown_Vtbl {
            QueryInterface: QueryInterface::<T>,
            AddRef: AddRef::<T>,
            Release: Release::<T>,
        },
        GetNumWorkGraphs: GetNumWorkGraphs::<T>,
        GetProgramName: GetProgramName::<T>,
        GetWorkGraphIndex: GetWorkGraphIndex::<T>,
        GetNumNodes: GetNumNodes::<T>,
        GetNodeID: GetNodeID::<T>,
        GetNodeIndex: GetNodeIndex::<T>,
        GetNodeLocalRootArgumentsTableIndex: GetNodeLocalRootArgumentsTableIndex::<T>,
        GetNumEntrypoints: GetNumEntrypoints::<T>,
        GetEntrypointID: GetEntrypointID::<T>,
        GetEntrypointIndex: GetEntrypointIndex::<T>,
        GetEntrypointRecordSizeInBytes: GetEntrypointRecordSizeInBytes::<T>,
        GetWorkGraphMemoryRequirements: GetWorkGraphMemoryRequirements::<T>,
        GetEntrypointRecordAlignmentInBytes: GetEntrypointRecordAlignmentInBytes::<T>,
    }
}