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
#[repr(C)] #[derive(Clone, Copy, Debug)]
pub enum EDataFlow {
eRender,
eCapture,
eAll,
EDataFlow_enum_count,
}
#[repr(C)] #[derive(Clone, Copy, Debug)]
pub enum ERole {
eConsole,
eMultimedia,
eCommunications,
ERole_enum_count,
}
pub const CLSID_MMDeviceEnumerator: ::CLSID = ::GUID {
Data1: 0xBCDE0395,
Data2: 0xE52F,
Data3: 0x467C,
Data4: [0x8E, 0x3D, 0xC4, 0x57, 0x92, 0x91, 0x69, 0x2E],
};
pub const IID_IMMDeviceEnumerator: ::IID = ::GUID {
Data1: 0xA95664D2,
Data2: 0x9614,
Data3: 0x4F35,
Data4: [0xA7, 0x46, 0xDE, 0x8D, 0xB6, 0x36, 0x17, 0xE6],
};
RIDL!(
interface IMMDevice(IMMDeviceVtbl): IUnknown(IUnknownVtbl) {
fn Activate(
&mut self,
iid: ::REFIID,
dwClsCtx: ::DWORD,
pActivationParams: *mut ::PROPVARIANT,
ppInterface: *mut ::LPVOID
) -> ::HRESULT,
fn OpenPropertyStore(
&mut self,
stgmAccess: ::DWORD,
ppProperties: *mut *mut ::IPropertyStore
) -> ::HRESULT,
fn GetId(&mut self, ppstrId: *mut ::LPWSTR) -> ::HRESULT,
fn GetState(&mut self, pdwState: *mut ::DWORD) -> ::HRESULT
}
);
RIDL!(
interface IMMDeviceEnumerator(IMMDeviceEnumeratorVtbl): IUnknown(IUnknownVtbl) {
fn EnumAudioEndpoints(
&mut self,
dataFlow: EDataFlow,
dwStateMask: ::DWORD,
ppDevices: *mut *mut IMMDeviceCollection
) -> ::HRESULT,
fn GetDefaultAudioEndpoint(
&mut self,
dataFlow: EDataFlow,
role: ERole,
ppEndpoint: *mut *mut IMMDevice
) -> ::HRESULT,
fn GetDevice(
&mut self,
pwstrId: ::LPCWSTR,
ppDevices: *mut *mut IMMDevice
) -> ::HRESULT,
fn RegisterEndpointNotificationCallback(
&mut self,
pClient: *mut IMMNotificationClient
) -> ::HRESULT,
fn UnregisterEndpointNotificationCallback(
&mut self,
pClient: *mut IMMNotificationClient
) -> ::HRESULT
}
);
#[repr(C)] #[derive(Clone, Copy, Debug)]
pub struct IMMDeviceCollection;
#[repr(C)] #[derive(Clone, Copy, Debug)]
pub struct IMMNotificationClient;