[WDMAUD]
[reactos.git] / reactos / drivers / wdm / audio / legacy / wdmaud / wdmaud.h
1 #include <portcls.h>
2 #include <mmsystem.h>
3
4 #include "interface.h"
5
6 typedef struct
7 {
8 PMDL Mdl;
9 ULONG Length;
10 ULONG Function;
11 }WDMAUD_COMPLETION_CONTEXT, *PWDMAUD_COMPLETION_CONTEXT;
12
13
14 typedef struct
15 {
16 HANDLE Handle;
17 SOUND_DEVICE_TYPE Type;
18 ULONG FilterId;
19 ULONG PinId;
20 PRKEVENT NotifyEvent;
21 }WDMAUD_HANDLE, *PWDMAUD_HANDLE;
22
23 typedef struct
24 {
25 LIST_ENTRY Entry;
26 HANDLE hProcess;
27 ULONG NumPins;
28 WDMAUD_HANDLE * hPins;
29
30 LIST_ENTRY MixerEventList;
31 }WDMAUD_CLIENT, *PWDMAUD_CLIENT;
32
33 typedef struct
34 {
35 LIST_ENTRY Entry;
36 ULONG NotificationType;
37 ULONG Value;
38 HANDLE hMixer;
39 }EVENT_ENTRY, *PEVENT_ENTRY;
40
41 typedef struct
42 {
43 LIST_ENTRY Entry;
44 UNICODE_STRING SymbolicLink;
45 }SYSAUDIO_ENTRY, *PSYSAUDIO_ENTRY;
46
47 typedef struct
48 {
49 KSDEVICE_HEADER DeviceHeader;
50 PVOID SysAudioNotification;
51
52 BOOL DeviceInterfaceSupport;
53
54 KSPIN_LOCK Lock;
55 ULONG NumSysAudioDevices;
56 LIST_ENTRY SysAudioDeviceList;
57 HANDLE hSysAudio;
58 PFILE_OBJECT FileObject;
59 LIST_ENTRY WdmAudClientList;
60
61 ULONG SysAudioDeviceCount;
62 PIO_WORKITEM WorkItem;
63 KEVENT InitializationCompletionEvent;
64 ULONG WorkItemActive;
65
66 }WDMAUD_DEVICE_EXTENSION, *PWDMAUD_DEVICE_EXTENSION;
67
68 typedef struct
69 {
70 PWDMAUD_CLIENT ClientInfo;
71 PWDMAUD_DEVICE_EXTENSION DeviceExtension;
72 SOUND_DEVICE_TYPE DeviceType;
73 }PIN_CREATE_CONTEXT, *PPIN_CREATE_CONTEXT;
74
75
76 NTSTATUS
77 NTAPI
78 OpenWavePin(
79 IN PWDMAUD_DEVICE_EXTENSION DeviceExtension,
80 IN ULONG FilterId,
81 IN ULONG PinId,
82 IN LPWAVEFORMATEX WaveFormatEx,
83 IN ACCESS_MASK DesiredAccess,
84 OUT PHANDLE PinHandle);
85
86 NTSTATUS
87 WdmAudRegisterDeviceInterface(
88 IN PDEVICE_OBJECT PhysicalDeviceObject,
89 IN PWDMAUD_DEVICE_EXTENSION DeviceExtension);
90
91 NTSTATUS
92 WdmAudOpenSysAudioDevices(
93 IN PDEVICE_OBJECT DeviceObject,
94 IN PWDMAUD_DEVICE_EXTENSION DeviceExtension);
95
96 NTSTATUS
97 WdmAudOpenSysaudio(
98 IN PDEVICE_OBJECT DeviceObject,
99 IN PWDMAUD_CLIENT *pClient);
100
101 NTSTATUS
102 NTAPI
103 WdmAudDeviceControl(
104 IN PDEVICE_OBJECT DeviceObject,
105 IN PIRP Irp);
106
107 NTSTATUS
108 NTAPI
109 WdmAudReadWrite(
110 IN PDEVICE_OBJECT DeviceObject,
111 IN PIRP Irp);
112
113 NTSTATUS
114 NTAPI
115 WdmAudWrite(
116 IN PDEVICE_OBJECT DeviceObject,
117 IN PIRP Irp);
118
119 NTSTATUS
120 WdmAudControlOpenMixer(
121 IN PDEVICE_OBJECT DeviceObject,
122 IN PIRP Irp,
123 IN PWDMAUD_DEVICE_INFO DeviceInfo,
124 IN PWDMAUD_CLIENT ClientInfo);
125
126 NTSTATUS
127 WdmAudControlOpenWave(
128 IN PDEVICE_OBJECT DeviceObject,
129 IN PIRP Irp,
130 IN PWDMAUD_DEVICE_INFO DeviceInfo,
131 IN PWDMAUD_CLIENT ClientInfo);
132
133 NTSTATUS
134 WdmAudControlOpenMidi(
135 IN PDEVICE_OBJECT DeviceObject,
136 IN PIRP Irp,
137 IN PWDMAUD_DEVICE_INFO DeviceInfo,
138 IN PWDMAUD_CLIENT ClientInfo);
139
140 ULONG
141 GetNumOfMixerDevices(
142 IN PDEVICE_OBJECT DeviceObject);
143
144 NTSTATUS
145 SetIrpIoStatus(
146 IN PIRP Irp,
147 IN NTSTATUS Status,
148 IN ULONG Length);
149
150 NTSTATUS
151 WdmAudOpenSysAudioDevice(
152 IN LPWSTR DeviceName,
153 OUT PHANDLE Handle);
154
155 NTSTATUS
156 FindProductName(
157 IN LPWSTR PnpName,
158 IN ULONG ProductNameSize,
159 OUT LPWSTR ProductName);
160
161 NTSTATUS
162 WdmAudMixerCapabilities(
163 IN PDEVICE_OBJECT DeviceObject,
164 IN PWDMAUD_DEVICE_INFO DeviceInfo,
165 IN PWDMAUD_CLIENT ClientInfo,
166 IN PWDMAUD_DEVICE_EXTENSION DeviceExtension);
167
168 NTSTATUS
169 WdmAudWaveCapabilities(
170 IN PDEVICE_OBJECT DeviceObject,
171 IN PWDMAUD_DEVICE_INFO DeviceInfo,
172 IN PWDMAUD_CLIENT ClientInfo,
173 IN PWDMAUD_DEVICE_EXTENSION DeviceExtension);
174
175 NTSTATUS
176 WdmAudMidiCapabilities(
177 IN PDEVICE_OBJECT DeviceObject,
178 IN PWDMAUD_DEVICE_INFO DeviceInfo,
179 IN PWDMAUD_CLIENT ClientInfo,
180 IN PWDMAUD_DEVICE_EXTENSION DeviceExtension);
181
182 NTSTATUS
183 NTAPI
184 WdmAudFrameSize(
185 IN PDEVICE_OBJECT DeviceObject,
186 IN PIRP Irp,
187 IN PWDMAUD_DEVICE_INFO DeviceInfo,
188 IN PWDMAUD_CLIENT ClientInfo);
189
190 NTSTATUS
191 NTAPI
192 WdmAudGetLineInfo(
193 IN PDEVICE_OBJECT DeviceObject,
194 IN PIRP Irp,
195 IN PWDMAUD_DEVICE_INFO DeviceInfo,
196 IN PWDMAUD_CLIENT ClientInfo);
197
198 NTSTATUS
199 NTAPI
200 WdmAudGetLineControls(
201 IN PDEVICE_OBJECT DeviceObject,
202 IN PIRP Irp,
203 IN PWDMAUD_DEVICE_INFO DeviceInfo,
204 IN PWDMAUD_CLIENT ClientInfo);
205
206 NTSTATUS
207 NTAPI
208 WdmAudSetControlDetails(
209 IN PDEVICE_OBJECT DeviceObject,
210 IN PIRP Irp,
211 IN PWDMAUD_DEVICE_INFO DeviceInfo,
212 IN PWDMAUD_CLIENT ClientInfo);
213
214 NTSTATUS
215 NTAPI
216 WdmAudGetMixerEvent(
217 IN PDEVICE_OBJECT DeviceObject,
218 IN PIRP Irp,
219 IN PWDMAUD_DEVICE_INFO DeviceInfo,
220 IN PWDMAUD_CLIENT ClientInfo);
221
222 NTSTATUS
223 NTAPI
224 WdmAudGetControlDetails(
225 IN PDEVICE_OBJECT DeviceObject,
226 IN PIRP Irp,
227 IN PWDMAUD_DEVICE_INFO DeviceInfo,
228 IN PWDMAUD_CLIENT ClientInfo);
229
230 NTSTATUS
231 WdmAudMixerInitialize(
232 IN PDEVICE_OBJECT DeviceObject);
233
234 NTSTATUS
235 NTAPI
236 WdmAudWaveInitialize(
237 IN PDEVICE_OBJECT DeviceObject);
238
239 ULONG
240 ClosePin(
241 IN PWDMAUD_CLIENT ClientInfo,
242 IN ULONG FilterId,
243 IN ULONG PinId,
244 IN SOUND_DEVICE_TYPE DeviceType);
245
246 NTSTATUS
247 InsertPinHandle(
248 IN PWDMAUD_CLIENT ClientInfo,
249 IN ULONG FilterId,
250 IN ULONG PinId,
251 IN SOUND_DEVICE_TYPE DeviceType,
252 IN HANDLE PinHandle,
253 IN ULONG FreeIndex);
254
255 NTSTATUS
256 GetSysAudioDevicePnpName(
257 IN PDEVICE_OBJECT DeviceObject,
258 IN ULONG DeviceIndex,
259 OUT LPWSTR * Device);
260
261 NTSTATUS
262 OpenSysAudioDeviceByIndex(
263 IN PDEVICE_OBJECT DeviceObject,
264 IN ULONG DeviceIndex,
265 IN PHANDLE DeviceHandle,
266 IN PFILE_OBJECT * FileObject);
267
268 NTSTATUS
269 OpenDevice(
270 IN LPWSTR Device,
271 OUT PHANDLE DeviceHandle,
272 OUT PFILE_OBJECT * FileObject);
273
274 ULONG
275 WdmAudGetMixerDeviceCount(VOID);
276
277 ULONG
278 WdmAudGetWaveInDeviceCount(VOID);
279
280 ULONG
281 WdmAudGetWaveOutDeviceCount(VOID);
282
283 ULONG
284 WdmAudGetMidiInDeviceCount(VOID);
285
286 ULONG
287 WdmAudGetMidiOutDeviceCount(VOID);
288
289 NTSTATUS
290 WdmAudGetPnpNameByIndexAndType(
291 IN ULONG DeviceIndex,
292 IN SOUND_DEVICE_TYPE DeviceType,
293 OUT LPWSTR *Device);
294
295
296 /* sup.c */
297
298 ULONG
299 GetSysAudioDeviceCount(
300 IN PDEVICE_OBJECT DeviceObject);
301
302
303 PVOID
304 AllocateItem(
305 IN POOL_TYPE PoolType,
306 IN SIZE_T NumberOfBytes);
307
308 VOID
309 FreeItem(
310 IN PVOID Item);
311