[kernel32]
[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 KSSTREAM_HEADER Header;
29 SOUND_DEVICE_TYPE DeviceType;
30 ULONG DeviceIndex;
31
32 HANDLE hDevice;
33 ULONG DeviceCount;
34 ULONG Flags;
35
36 union
37 {
38 MIXERCAPSW MixCaps;
39 MIXERCONTROLDETAILS MixDetails;
40 MIXERLINECONTROLSW MixControls;
41 MIXERLINEW MixLine;
42 WAVEFORMATEX WaveFormatEx;
43 WAVEOUTCAPSW WaveOutCaps;
44 AUXCAPSW AuxCaps;
45 WAVEINCAPSW WaveInCaps;
46 ULONGLONG Position;
47 KSSTATE State;
48 ULONG Volume;
49 ULONG FrameSize;
50 }u;
51
52 }WDMAUD_DEVICE_INFO, *PWDMAUD_DEVICE_INFO;
53
54
55
56 /// IOCTL_OPEN_WDMAUD
57 ///
58 /// Description: This IOCTL informs wdmaud that an application whats to use wdmsys for a waveOut / waveIn / aux operation
59 ///
60 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
61 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
62 /// Note: DeviceType identifies the device type, DeviceIndex the index, WaveFormatEx the device details
63 /// Result: is returned in hDevice
64 /// Return Code: STATUS_SUCCESS indicates success, otherwise appropiate error code
65 /// Prequsites: none
66
67 #define IOCTL_OPEN_WDMAUD \
68 CTL_CODE(FILE_DEVICE_SOUND, \
69 0, \
70 METHOD_BUFFERED, \
71 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
72
73
74 /// IOCTL_CLOSE_WDMAUD
75 ///
76 /// Description: This IOCTL informs that an application has finished with wdmsys and closes the connection
77 ///
78 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
79 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
80 /// Note: DeviceType, DeviceIndex and hDevice must be set
81 /// ReturnCode: STATUS_SUCCESS indicates success
82 /// Prequsites: openend device
83
84 #define IOCTL_CLOSE_WDMAUD \
85 CTL_CODE(FILE_DEVICE_SOUND, \
86 1, \
87 METHOD_BUFFERED, \
88 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS) \
89
90
91 /// IOCTL_GETNUMDEVS_TYPE
92 ///
93 /// Description: This IOCTL queries the number of devices currently present of a specific type. The caller passes a WDMAUD_DEVICE_INFO structure.
94 ///
95 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
96 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
97 /// Note: The DeviceType contains the requested device type.
98 /// Result: The result is returned in DeviceCount
99 /// ReturnCode: STATUS_SUCCESS indicates success
100 /// Prequsites: none
101
102 #define IOCTL_GETNUMDEVS_TYPE \
103 CTL_CODE(FILE_DEVICE_SOUND, \
104 2, \
105 METHOD_BUFFERED, \
106 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
107
108
109 /// IOCTL_SETDEVICE_STATE
110 ///
111 /// Description: This IOCTL sets an opened waveOut / waveIn / midiIn / midiOut / aux device to specific state
112 ///
113 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
114 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
115 /// Note: The DeviceType, DeviceIndex, hDevice and State member must be set. State determines the new state
116 /// ReturnCode: STATUS_SUCCESS indicates success
117 /// Prequsites: opened device
118
119 #define IOCTL_SETDEVICE_STATE \
120 CTL_CODE(FILE_DEVICE_SOUND, \
121 3, \
122 METHOD_BUFFERED, \
123 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
124
125
126 /// IOCTL_GETDEVID
127 ///
128 /// Description: This IOCTL returns the device index by its provided handle
129 ///
130 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
131 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
132 /// Note: The DeviceType and hDevice must be set
133 /// Result: The result is returned in DeviceIndex
134 /// ReturnCode: STATUS_SUCCESS indicates success
135 /// Prequsites: opened device
136
137 #define IOCTL_GETDEVID \
138 CTL_CODE(FILE_DEVICE_SOUND, \
139 4, \
140 METHOD_BUFFERED, \
141 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
142
143
144 /// IOCTL_GETVOLUME
145 ///
146 /// Description: This IOCTL returns the volume a device
147 ///
148 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
149 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
150 /// Note: The DeviceType and hDevice must be set
151 /// Result: The result is returned in Volume
152 /// ReturnCode: STATUS_SUCCESS indicates success
153 /// Prequsites: opened device
154
155 #define IOCTL_GETVOLUME \
156 CTL_CODE(FILE_DEVICE_SOUND, \
157 5, \
158 METHOD_BUFFERED, \
159 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
160
161
162 /// IOCTL_SETVOLUME
163 ///
164 /// Description: This IOCTL sets the volume a device
165 ///
166 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
167 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
168 /// Note: The DeviceType, hDevice and Volume must be set
169 /// ReturnCode: STATUS_SUCCESS indicates success
170 /// Prequsites: opened device
171
172 #define IOCTL_SETVOLUME \
173 CTL_CODE(FILE_DEVICE_SOUND, \
174 6, \
175 METHOD_BUFFERED, \
176 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
177
178
179 /// IOCTL_GETCAPABILTIES
180 ///
181 /// Description: This IOCTL retrieves the capabilties of an specific device
182 ///
183 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
184 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
185 /// Note: The DeviceType and DeviceIndex must be set
186 /// ReturnCode: STATUS_SUCCESS indicates success
187 /// Prequsites: none
188
189 #define IOCTL_GETCAPABILITIES \
190 CTL_CODE(FILE_DEVICE_SOUND, \
191 7, \
192 METHOD_BUFFERED, \
193 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
194
195
196 /// IOCTL_WRITEDATA
197 ///
198 /// Description: This IOCTL writes data to specified device
199 ///
200 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
201 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
202 /// Note: The DeviceType, DeviceIndex, hDevice, BufferSize and Buffer must be set
203 /// ReturnCode: STATUS_SUCCESS indicates success
204 /// Prequsites: opened device
205
206 #define IOCTL_WRITEDATA \
207 CTL_CODE(FILE_DEVICE_SOUND, \
208 8, \
209 METHOD_BUFFERED, \
210 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
211
212 /// IOCTL_GETPOS
213 ///
214 /// Description: This IOCTL retrieves the current playback / write position
215 ///
216 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
217 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
218 /// Note: The DeviceType and hDevice must be set
219 /// Result: The result is returned in Position
220 /// ReturnCode: STATUS_SUCCESS indicates success
221 /// Prequsites: opened device
222
223 #define IOCTL_GETPOS \
224 CTL_CODE(FILE_DEVICE_SOUND, \
225 9, \
226 METHOD_BUFFERED, \
227 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
228
229 /// IOCTL_GETFRAMESIZE
230 ///
231 /// Description: This IOCTL retrieves the frame size requirements for an audio pin
232 ///
233 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
234 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
235 /// Note: The DeviceType and hDevice must be set
236 /// Result: The result is returned in FrameSize
237 /// ReturnCode: STATUS_SUCCESS indicates success
238 /// Prequsites: opened device
239
240 #define IOCTL_GETFRAMESIZE \
241 CTL_CODE(FILE_DEVICE_SOUND, \
242 10, \
243 METHOD_BUFFERED, \
244 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
245
246 /// IOCTL_GETLINEINFO
247 ///
248 /// Description: This IOCTL retrieves information on a mixerline
249 ///
250 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
251 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
252 /// Note: The hDevice member must be set
253 /// Result: The result is returned in MixLine
254 /// ReturnCode: STATUS_SUCCESS indicates success
255 /// Prequsites: opened device
256
257 #define IOCTL_GETLINEINFO \
258 CTL_CODE(FILE_DEVICE_SOUND, \
259 11, \
260 METHOD_BUFFERED, \
261 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
262
263
264 /// IOCTL_GETLINECONTROLS
265 ///
266 /// Description: This IOCTL retrieves controls of a mixerline
267 ///
268 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
269 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
270 /// Note: The hDevice member must be set
271 /// Result: The result is returned in MixControls
272 /// ReturnCode: STATUS_SUCCESS indicates success
273 /// Prequsites: opened device
274
275 #define IOCTL_GETLINECONTROLS \
276 CTL_CODE(FILE_DEVICE_SOUND, \
277 12, \
278 METHOD_BUFFERED, \
279 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
280
281
282 /// IOCTL_SETCONTROLDETAILS
283 ///
284 /// Description: This IOCTL sets details of a control of a mixerline
285 ///
286 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
287 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
288 /// Note: The hDevice member must be set
289 /// ReturnCode: STATUS_SUCCESS indicates success
290 /// Prequsites: opened device
291
292 #define IOCTL_SETCONTROLDETAILS \
293 CTL_CODE(FILE_DEVICE_SOUND, \
294 13, \
295 METHOD_BUFFERED, \
296 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
297
298
299 /// IOCTL_GETCONTROLDETAILS
300 ///
301 /// Description: This IOCTL gets details of a control of a mixerline
302 ///
303 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
304 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
305 /// Note: The hDevice member must be set
306 /// Result: The result is returned in MixDetails
307 /// ReturnCode: STATUS_SUCCESS indicates success
308 /// Prequsites: opened device
309
310 #define IOCTL_GETCONTROLDETAILS \
311 CTL_CODE(FILE_DEVICE_SOUND, \
312 14, \
313 METHOD_BUFFERED, \
314 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
315
316 #endif