merge 37282 from amd64-branch:
[reactos.git] / reactos / drivers / wdm / audio / legacy / wdmaud / interface.h
1 #ifndef INTERFACE_H__
2 #define INTERFACE_H__
3
4 ///
5 /// WDMAUD Interface Definition
6 ///
7 /// History: 12/02/2008 Created
8
9 // These are now in sndtypes.h
10 /*
11 typedef enum
12 {
13 DEVICE_TYPE_NONE = 0,
14 DEVICE_TYPE_WAVE_OUT,
15 DEVICE_TYPE_WAVE_IN,
16 DEVICE_TYPE_MIDI_IN,
17 DEVICE_TYPE_MIDI_OUT,
18 DEVICE_TYPE_AUX_IN,
19 DEVICE_TYPE_AUX_OUT
20
21 }AUDIO_DEVICE_TYPE;
22 */
23
24 #include <sndtypes.h>
25
26 typedef struct
27 {
28 SOUND_DEVICE_TYPE DeviceType;
29 ULONG DeviceIndex;
30
31 HANDLE hDevice;
32 ULONG DeviceCount;
33 KSSTATE State;
34 ULONG Volume;
35
36 ULONG BufferSize;
37 PUCHAR Buffer;
38
39 union
40 {
41 WAVEFORMATEX WaveFormatEx;
42 WAVEOUTCAPSW WaveOutCaps;
43 AUXCAPSW AuxCaps;
44 WAVEINCAPSW WaveInCaps;
45 }u;
46
47 }WDMAUD_DEVICE_INFO, *PWDMAUD_DEVICE_INFO;
48
49
50
51 /// IOCTL_OPEN_WDMAUD
52 ///
53 /// Description: This IOCTL informs wdmaud that an application whats to use wdmsys for a waveOut / waveIn / aux operation
54 ///
55 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
56 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
57 /// Note: DeviceType identifies the device type, DeviceIndex the index, WaveFormatEx the device details
58 /// Result: is returned in hDevice
59 /// Return Code: STATUS_SUCCESS indicates success, otherwise appropiate error code
60 /// Prequsites: none
61
62 #define IOCTL_OPEN_WDMAUD \
63 CTL_CODE(FILE_DEVICE_SOUND, \
64 0, \
65 METHOD_BUFFERED, \
66 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
67
68
69 /// IOCTL_CLOSE_WDMAUD
70 ///
71 /// Description: This IOCTL informs that an application has finished with wdmsys and closes the connection
72 ///
73 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
74 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
75 /// Note: DeviceType, DeviceIndex and hDevice must be set
76 /// ReturnCode: STATUS_SUCCESS indicates success
77 /// Prequsites: openend device
78
79 #define IOCTL_CLOSE_WDMAUD \
80 CTL_CODE(FILE_DEVICE_SOUND, \
81 1, \
82 METHOD_BUFFERED, \
83 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS) \
84
85
86 /// IOCTL_GETNUMDEVS_TYPE
87 ///
88 /// Description: This IOCTL queries the number of devices currently present of a specific type. The caller passes a WDMAUD_DEVICE_INFO structure.
89 ///
90 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
91 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
92 /// Note: The DeviceType contains the requested device type.
93 /// Result: The result is returned in DeviceCount
94 /// ReturnCode: STATUS_SUCCESS indicates success
95 /// Prequsites: none
96
97 #define IOCTL_GETNUMDEVS_TYPE \
98 CTL_CODE(FILE_DEVICE_SOUND, \
99 2, \
100 METHOD_BUFFERED, \
101 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
102
103
104 /// IOCTL_SETDEVICE_STATE
105 ///
106 /// Description: This IOCTL sets an opened waveOut / waveIn / midiIn / midiOut / aux device to specific state
107 ///
108 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
109 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
110 /// Note: The DeviceType, DeviceIndex, hDevice and State member must be set. State determines the new state
111 /// ReturnCode: STATUS_SUCCESS indicates success
112 /// Prequsites: opened device
113
114 #define IOCTL_SETDEVICE_STATE \
115 CTL_CODE(FILE_DEVICE_SOUND, \
116 3, \
117 METHOD_BUFFERED, \
118 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
119
120
121 /// IOCTL_GETDEVID
122 ///
123 /// Description: This IOCTL returns the device index by its provided handle
124 ///
125 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
126 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
127 /// Note: The DeviceType and hDevice must be set
128 /// Result: The result is returned in DeviceIndex
129 /// ReturnCode: STATUS_SUCCESS indicates success
130 /// Prequsites: opened device
131
132 #define IOCTL_GETDEVID \
133 CTL_CODE(FILE_DEVICE_SOUND, \
134 4, \
135 METHOD_BUFFERED, \
136 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
137
138
139 /// IOCTL_GETVOLUME
140 ///
141 /// Description: This IOCTL returns the volume a device
142 ///
143 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
144 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
145 /// Note: The DeviceType and hDevice must be set
146 /// Result: The result is returned in Volume
147 /// ReturnCode: STATUS_SUCCESS indicates success
148 /// Prequsites: opened device
149
150 #define IOCTL_GETVOLUME \
151 CTL_CODE(FILE_DEVICE_SOUND, \
152 5, \
153 METHOD_BUFFERED, \
154 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
155
156
157 /// IOCTL_SETVOLUME
158 ///
159 /// Description: This IOCTL sets the volume a device
160 ///
161 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
162 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
163 /// Note: The DeviceType, hDevice and Volume must be set
164 /// ReturnCode: STATUS_SUCCESS indicates success
165 /// Prequsites: opened device
166
167 #define IOCTL_SETVOLUME \
168 CTL_CODE(FILE_DEVICE_SOUND, \
169 6, \
170 METHOD_BUFFERED, \
171 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
172
173
174 /// IOCTL_GETCAPABILTIES
175 ///
176 /// Description: This IOCTL retrieves the capabilties of an specific device
177 ///
178 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
179 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
180 /// Note: The DeviceType and DeviceIndex must be set
181 /// ReturnCode: STATUS_SUCCESS indicates success
182 /// Prequsites: none
183
184 #define IOCTL_GETCAPABILITIES \
185 CTL_CODE(FILE_DEVICE_SOUND, \
186 7, \
187 METHOD_BUFFERED, \
188 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
189
190
191 /// IOCTL_WRITEDATA
192 ///
193 /// Description: This IOCTL writes data to specified device
194 ///
195 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
196 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
197 /// Note: The DeviceType, DeviceIndex, hDevice, BufferSize and Buffer must be set
198 /// ReturnCode: STATUS_SUCCESS indicates success
199 /// Prequsites: opened device
200
201 #define IOCTL_WRITEDATA \
202 CTL_CODE(FILE_DEVICE_SOUND, \
203 8, \
204 METHOD_BUFFERED, \
205 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
206
207
208 #endif