9721ddd0974c085de16ee5b2caf9ae75b3ffe2e0
[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
35 union
36 {
37 MIXERCAPSW MixCaps;
38 MIXERCONTROLDETAILS MixDetails;
39 MIXERLINECONTROLSW MixControls;
40 MIXERLINEW MixLine;
41 WAVEFORMATEX WaveFormatEx;
42 WAVEOUTCAPSW WaveOutCaps;
43 AUXCAPSW AuxCaps;
44 WAVEINCAPSW WaveInCaps;
45 ULONGLONG Position;
46 KSSTATE State;
47 ULONG Volume;
48 ULONG FrameSize;
49 }u;
50
51 }WDMAUD_DEVICE_INFO, *PWDMAUD_DEVICE_INFO;
52
53
54
55 /// IOCTL_OPEN_WDMAUD
56 ///
57 /// Description: This IOCTL informs wdmaud that an application whats to use wdmsys for a waveOut / waveIn / aux operation
58 ///
59 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
60 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
61 /// Note: DeviceType identifies the device type, DeviceIndex the index, WaveFormatEx the device details
62 /// Result: is returned in hDevice
63 /// Return Code: STATUS_SUCCESS indicates success, otherwise appropiate error code
64 /// Prequsites: none
65
66 #define IOCTL_OPEN_WDMAUD \
67 CTL_CODE(FILE_DEVICE_SOUND, \
68 0, \
69 METHOD_BUFFERED, \
70 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
71
72
73 /// IOCTL_CLOSE_WDMAUD
74 ///
75 /// Description: This IOCTL informs that an application has finished with wdmsys and closes the connection
76 ///
77 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
78 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
79 /// Note: DeviceType, DeviceIndex and hDevice must be set
80 /// ReturnCode: STATUS_SUCCESS indicates success
81 /// Prequsites: openend device
82
83 #define IOCTL_CLOSE_WDMAUD \
84 CTL_CODE(FILE_DEVICE_SOUND, \
85 1, \
86 METHOD_BUFFERED, \
87 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS) \
88
89
90 /// IOCTL_GETNUMDEVS_TYPE
91 ///
92 /// Description: This IOCTL queries the number of devices currently present of a specific type. The caller passes a WDMAUD_DEVICE_INFO structure.
93 ///
94 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
95 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
96 /// Note: The DeviceType contains the requested device type.
97 /// Result: The result is returned in DeviceCount
98 /// ReturnCode: STATUS_SUCCESS indicates success
99 /// Prequsites: none
100
101 #define IOCTL_GETNUMDEVS_TYPE \
102 CTL_CODE(FILE_DEVICE_SOUND, \
103 2, \
104 METHOD_BUFFERED, \
105 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
106
107
108 /// IOCTL_SETDEVICE_STATE
109 ///
110 /// Description: This IOCTL sets an opened waveOut / waveIn / midiIn / midiOut / aux device to specific state
111 ///
112 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
113 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
114 /// Note: The DeviceType, DeviceIndex, hDevice and State member must be set. State determines the new state
115 /// ReturnCode: STATUS_SUCCESS indicates success
116 /// Prequsites: opened device
117
118 #define IOCTL_SETDEVICE_STATE \
119 CTL_CODE(FILE_DEVICE_SOUND, \
120 3, \
121 METHOD_BUFFERED, \
122 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
123
124
125 /// IOCTL_GETDEVID
126 ///
127 /// Description: This IOCTL returns the device index by its provided handle
128 ///
129 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
130 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
131 /// Note: The DeviceType and hDevice must be set
132 /// Result: The result is returned in DeviceIndex
133 /// ReturnCode: STATUS_SUCCESS indicates success
134 /// Prequsites: opened device
135
136 #define IOCTL_GETDEVID \
137 CTL_CODE(FILE_DEVICE_SOUND, \
138 4, \
139 METHOD_BUFFERED, \
140 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
141
142
143 /// IOCTL_GETVOLUME
144 ///
145 /// Description: This IOCTL returns the volume a device
146 ///
147 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
148 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
149 /// Note: The DeviceType and hDevice must be set
150 /// Result: The result is returned in Volume
151 /// ReturnCode: STATUS_SUCCESS indicates success
152 /// Prequsites: opened device
153
154 #define IOCTL_GETVOLUME \
155 CTL_CODE(FILE_DEVICE_SOUND, \
156 5, \
157 METHOD_BUFFERED, \
158 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
159
160
161 /// IOCTL_SETVOLUME
162 ///
163 /// Description: This IOCTL sets the volume a device
164 ///
165 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
166 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
167 /// Note: The DeviceType, hDevice and Volume must be set
168 /// ReturnCode: STATUS_SUCCESS indicates success
169 /// Prequsites: opened device
170
171 #define IOCTL_SETVOLUME \
172 CTL_CODE(FILE_DEVICE_SOUND, \
173 6, \
174 METHOD_BUFFERED, \
175 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
176
177
178 /// IOCTL_GETCAPABILTIES
179 ///
180 /// Description: This IOCTL retrieves the capabilties of an specific device
181 ///
182 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
183 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
184 /// Note: The DeviceType and DeviceIndex must be set
185 /// ReturnCode: STATUS_SUCCESS indicates success
186 /// Prequsites: none
187
188 #define IOCTL_GETCAPABILITIES \
189 CTL_CODE(FILE_DEVICE_SOUND, \
190 7, \
191 METHOD_BUFFERED, \
192 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
193
194
195 /// IOCTL_WRITEDATA
196 ///
197 /// Description: This IOCTL writes data to specified device
198 ///
199 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
200 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
201 /// Note: The DeviceType, DeviceIndex, hDevice, BufferSize and Buffer must be set
202 /// ReturnCode: STATUS_SUCCESS indicates success
203 /// Prequsites: opened device
204
205 #define IOCTL_WRITEDATA \
206 CTL_CODE(FILE_DEVICE_SOUND, \
207 8, \
208 METHOD_BUFFERED, \
209 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
210
211 /// IOCTL_GETPOS
212 ///
213 /// Description: This IOCTL retrieves the current playback / write position
214 ///
215 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
216 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
217 /// Note: The DeviceType and hDevice must be set
218 /// Result: The result is returned in Position
219 /// ReturnCode: STATUS_SUCCESS indicates success
220 /// Prequsites: opened device
221
222 #define IOCTL_GETPOS \
223 CTL_CODE(FILE_DEVICE_SOUND, \
224 9, \
225 METHOD_BUFFERED, \
226 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
227
228 /// IOCTL_GETFRAMESIZE
229 ///
230 /// Description: This IOCTL retrieves the frame size requirements for an audio pin
231 ///
232 /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure,
233 /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure
234 /// Note: The DeviceType and hDevice must be set
235 /// Result: The result is returned in FrameSize
236 /// ReturnCode: STATUS_SUCCESS indicates success
237 /// Prequsites: opened device
238
239 #define IOCTL_GETFRAMESIZE \
240 CTL_CODE(FILE_DEVICE_SOUND, \
241 10, \
242 METHOD_BUFFERED, \
243 FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
244
245
246 #endif