16f85991c1ae285f9af5b3e0c9947b9d4a2e1393
[reactos.git] / reactos / drivers / wdm / audio / legacy / wdmaud / wdmaud.h
1 #ifndef WDMAUD_H__
2 #define WDMAUD_H__
3
4 #include <pseh/pseh2.h>
5 #include <ntddk.h>
6 #include <portcls.h>
7 #include <ks.h>
8 #define NDEBUG
9 #include <debug.h>
10 #include <ksmedia.h>
11 #include <mmreg.h>
12 #include <mmsystem.h>
13 #include <stdlib.h>
14 #include <stdio.h>
15 #include <wchar.h>
16
17 #include "interface.h"
18
19 typedef struct
20 {
21 HANDLE Handle;
22 SOUND_DEVICE_TYPE Type;
23 ULONG FilterId;
24 ULONG PinId;
25 }WDMAUD_HANDLE, *PWDMAUD_HANDLE;
26
27
28 typedef struct
29 {
30 HANDLE hProcess;
31 ULONG NumPins;
32 WDMAUD_HANDLE * hPins;
33
34 }WDMAUD_CLIENT, *PWDMAUD_CLIENT;
35
36 typedef struct
37 {
38 LIST_ENTRY Entry;
39 ULONG dwControlID;
40 }MIXERCONTROL_DATA, *LPMIXERCONTROL_DATA;
41
42 typedef struct
43 {
44 MIXERCONTROL_DATA Header;
45 LONG SignedMinimum;
46 LONG SignedMaximum;
47 LONG SteppingDelta;
48 ULONG InputSteppingDelta;
49 ULONG ValuesCount;
50 PLONG Values;
51 }MIXERVOLUME_DATA, *LPMIXERVOLUME_DATA;
52
53
54
55 typedef struct
56 {
57 LIST_ENTRY Entry;
58 ULONG PinId;
59 ULONG DeviceIndex;
60 MIXERLINEW Line;
61 LPMIXERCONTROLW LineControls;
62 PULONG NodeIds;
63 LIST_ENTRY LineControlsExtraData;
64 }MIXERLINE_EXT, *LPMIXERLINE_EXT;
65
66
67 typedef struct
68 {
69 MIXERCAPSW MixCaps;
70
71 LIST_ENTRY LineList;
72 ULONG ControlId;
73 }MIXER_INFO, *LPMIXER_INFO;
74
75
76 typedef struct
77 {
78 LIST_ENTRY Entry;
79 ULONG FilterId;
80 ULONG PinId;
81 ULONG bInput;
82 union
83 {
84 WAVEOUTCAPSW OutCaps;
85 WAVEINCAPSW InCaps;
86 }u;
87 }WAVE_INFO, *LPWAVE_INFO;
88
89
90 typedef struct
91 {
92 LIST_ENTRY Entry;
93 UNICODE_STRING SymbolicLink;
94 }SYSAUDIO_ENTRY, *PSYSAUDIO_ENTRY;
95
96 typedef struct
97 {
98 KSDEVICE_HEADER DeviceHeader;
99 PVOID SysAudioNotification;
100
101 BOOL DeviceInterfaceSupport;
102
103 KSPIN_LOCK Lock;
104 ULONG NumSysAudioDevices;
105 LIST_ENTRY SysAudioDeviceList;
106 HANDLE hSysAudio;
107 PFILE_OBJECT FileObject;
108
109 ULONG MixerInfoCount;
110 LPMIXER_INFO MixerInfo;
111
112 ULONG WaveInDeviceCount;
113 LIST_ENTRY WaveInList;
114
115 ULONG WaveOutDeviceCount;
116 LIST_ENTRY WaveOutList;
117
118
119 }WDMAUD_DEVICE_EXTENSION, *PWDMAUD_DEVICE_EXTENSION;
120
121 NTSTATUS
122 NTAPI
123 OpenWavePin(
124 IN PWDMAUD_DEVICE_EXTENSION DeviceExtension,
125 IN ULONG FilterId,
126 IN ULONG PinId,
127 IN LPWAVEFORMATEX WaveFormatEx,
128 IN ACCESS_MASK DesiredAccess,
129 OUT PHANDLE PinHandle);
130
131 NTSTATUS
132 WdmAudRegisterDeviceInterface(
133 IN PDEVICE_OBJECT PhysicalDeviceObject,
134 IN PWDMAUD_DEVICE_EXTENSION DeviceExtension);
135
136 NTSTATUS
137 WdmAudOpenSysAudioDevices(
138 IN PDEVICE_OBJECT DeviceObject,
139 IN PWDMAUD_DEVICE_EXTENSION DeviceExtension);
140
141 NTSTATUS
142 WdmAudOpenSysaudio(
143 IN PDEVICE_OBJECT DeviceObject,
144 IN PWDMAUD_CLIENT *pClient);
145
146 NTSTATUS
147 NTAPI
148 WdmAudDeviceControl(
149 IN PDEVICE_OBJECT DeviceObject,
150 IN PIRP Irp);
151
152 NTSTATUS
153 NTAPI
154 WdmAudReadWrite(
155 IN PDEVICE_OBJECT DeviceObject,
156 IN PIRP Irp);
157
158 NTSTATUS
159 NTAPI
160 WdmAudWrite(
161 IN PDEVICE_OBJECT DeviceObject,
162 IN PIRP Irp);
163
164 NTSTATUS
165 WdmAudControlOpenMixer(
166 IN PDEVICE_OBJECT DeviceObject,
167 IN PIRP Irp,
168 IN PWDMAUD_DEVICE_INFO DeviceInfo,
169 IN PWDMAUD_CLIENT ClientInfo);
170
171 NTSTATUS
172 WdmAudControlOpenWave(
173 IN PDEVICE_OBJECT DeviceObject,
174 IN PIRP Irp,
175 IN PWDMAUD_DEVICE_INFO DeviceInfo,
176 IN PWDMAUD_CLIENT ClientInfo);
177
178
179 ULONG
180 GetNumOfMixerDevices(
181 IN PDEVICE_OBJECT DeviceObject);
182
183 NTSTATUS
184 SetIrpIoStatus(
185 IN PIRP Irp,
186 IN NTSTATUS Status,
187 IN ULONG Length);
188
189 NTSTATUS
190 WdmAudOpenSysAudioDevice(
191 IN LPWSTR DeviceName,
192 OUT PHANDLE Handle);
193
194 NTSTATUS
195 FindProductName(
196 IN LPWSTR PnpName,
197 IN ULONG ProductNameSize,
198 OUT LPWSTR ProductName);
199
200 NTSTATUS
201 WdmAudMixerCapabilities(
202 IN PDEVICE_OBJECT DeviceObject,
203 IN PWDMAUD_DEVICE_INFO DeviceInfo,
204 IN PWDMAUD_CLIENT ClientInfo,
205 IN PWDMAUD_DEVICE_EXTENSION DeviceExtension);
206
207 NTSTATUS
208 WdmAudWaveCapabilities(
209 IN PDEVICE_OBJECT DeviceObject,
210 IN PWDMAUD_DEVICE_INFO DeviceInfo,
211 IN PWDMAUD_CLIENT ClientInfo,
212 IN PWDMAUD_DEVICE_EXTENSION DeviceExtension);
213
214 NTSTATUS
215 NTAPI
216 WdmAudFrameSize(
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 WdmAudGetLineInfo(
225 IN PDEVICE_OBJECT DeviceObject,
226 IN PIRP Irp,
227 IN PWDMAUD_DEVICE_INFO DeviceInfo,
228 IN PWDMAUD_CLIENT ClientInfo);
229
230 NTSTATUS
231 NTAPI
232 WdmAudGetLineControls(
233 IN PDEVICE_OBJECT DeviceObject,
234 IN PIRP Irp,
235 IN PWDMAUD_DEVICE_INFO DeviceInfo,
236 IN PWDMAUD_CLIENT ClientInfo);
237
238 NTSTATUS
239 NTAPI
240 WdmAudSetControlDetails(
241 IN PDEVICE_OBJECT DeviceObject,
242 IN PIRP Irp,
243 IN PWDMAUD_DEVICE_INFO DeviceInfo,
244 IN PWDMAUD_CLIENT ClientInfo);
245
246 NTSTATUS
247 NTAPI
248 WdmAudGetControlDetails(
249 IN PDEVICE_OBJECT DeviceObject,
250 IN PIRP Irp,
251 IN PWDMAUD_DEVICE_INFO DeviceInfo,
252 IN PWDMAUD_CLIENT ClientInfo);
253
254 NTSTATUS
255 WdmAudMixerInitialize(
256 IN PDEVICE_OBJECT DeviceObject);
257
258 NTSTATUS
259 NTAPI
260 WdmAudWaveInitialize(
261 IN PDEVICE_OBJECT DeviceObject);
262
263 NTSTATUS
264 ClosePin(
265 IN PWDMAUD_CLIENT ClientInfo,
266 IN ULONG FilterId,
267 IN ULONG PinId,
268 IN SOUND_DEVICE_TYPE DeviceType);
269
270 NTSTATUS
271 InsertPinHandle(
272 IN PWDMAUD_CLIENT ClientInfo,
273 IN ULONG FilterId,
274 IN ULONG PinId,
275 IN SOUND_DEVICE_TYPE DeviceType,
276 IN HANDLE PinHandle,
277 IN ULONG FreeIndex);
278
279
280 #endif