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
use crate::*;
#[repr(transparent)]
#[derive(Clone, PartialEq, Eq)]
pub struct IActivationFactory(Object);
impl IActivationFactory {
pub fn activate_instance<I: Interface>(&self) -> Result<I> {
unsafe {
let mut object = None;
(self.vtable().6)(self.abi(), &mut object)
.and_some(object)?
.cast()
}
}
}
#[repr(C)]
pub struct IActivationFactory_vtable(
pub unsafe extern "system" fn(this: RawPtr, iid: &Guid, interface: *mut RawPtr) -> ErrorCode,
pub unsafe extern "system" fn(this: RawPtr) -> u32,
pub unsafe extern "system" fn(this: RawPtr) -> u32,
pub unsafe extern "system" fn(
this: RawPtr,
count: *mut u32,
values: *mut *mut Guid,
) -> ErrorCode,
pub unsafe extern "system" fn(this: RawPtr, value: *mut RawPtr) -> ErrorCode,
pub unsafe extern "system" fn(this: RawPtr, value: *mut i32) -> ErrorCode,
pub unsafe extern "system" fn(this: RawPtr, object: &mut Option<Object>) -> ErrorCode,
);
unsafe impl Interface for IActivationFactory {
type Vtable = IActivationFactory_vtable;
const IID: Guid = Guid::from_values(
0x0000_0035,
0x0000,
0x0000,
[0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46],
);
}
impl std::fmt::Debug for IActivationFactory {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}