561336e2eb73249df872d7f7db513122d946ca22
[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 PinId;
40 ULONG DeviceIndex;
41 MIXERLINEW Line;
42 LPMIXERCONTROLW LineControls;
43 }MIXERLINE_EXT, *LPMIXERLINE_EXT;
44
45
46 typedef struct
47 {
48 HANDLE hMixer;
49 PFILE_OBJECT MixerFileObject;
50
51 MIXERCAPSW MixCaps;
52
53 LIST_ENTRY LineList;
54
55 }MIXER_INFO, *LPMIXER_INFO;
56
57
58 typedef struct
59 {
60 LIST_ENTRY Entry;
61 UNICODE_STRING SymbolicLink;
62 }SYSAUDIO_ENTRY, *PSYSAUDIO_ENTRY;
63
64 typedef struct
65 {
66 KSDEVICE_HEADER DeviceHeader;
67 PVOID SysAudioNotification;
68
69 BOOL DeviceInterfaceSupport;
70
71 KSPIN_LOCK Lock;
72 ULONG NumSysAudioDevices;
73 LIST_ENTRY SysAudioDeviceList;
74 HANDLE hSysAudio;
75 PFILE_OBJECT FileObject;
76
77 ULONG MixerInfoCount;
78 LPMIXER_INFO MixerInfo;
79
80
81 }WDMAUD_DEVICE_EXTENSION, *PWDMAUD_DEVICE_EXTENSION;
82
83 typedef struct
84 {
85 KSSTREAM_HEADER Header;
86 PIRP Irp;
87 }CONTEXT_WRITE, *PCONTEXT_WRITE;
88
89 NTSTATUS
90 WdmAudRegisterDeviceInterface(
91 IN PDEVICE_OBJECT PhysicalDeviceObject,
92 IN PWDMAUD_DEVICE_EXTENSION DeviceExtension);
93
94 NTSTATUS
95 WdmAudOpenSysAudioDevices(
96 IN PDEVICE_OBJECT DeviceObject,
97 IN PWDMAUD_DEVICE_EXTENSION DeviceExtension);
98
99 NTSTATUS
100 WdmAudOpenSysaudio(
101 IN PDEVICE_OBJECT DeviceObject,
102 IN PWDMAUD_CLIENT *pClient);
103
104 NTSTATUS
105 NTAPI
106 WdmAudDeviceControl(
107 IN PDEVICE_OBJECT DeviceObject,
108 IN PIRP Irp);
109
110 NTSTATUS
111 NTAPI
112 WdmAudWrite(
113 IN PDEVICE_OBJECT DeviceObject,
114 IN PIRP Irp);
115
116 NTSTATUS
117 WdmAudControlOpenMixer(
118 IN PDEVICE_OBJECT DeviceObject,
119 IN PIRP Irp,
120 IN PWDMAUD_DEVICE_INFO DeviceInfo,
121 IN PWDMAUD_CLIENT ClientInfo);
122
123 ULONG
124 GetNumOfMixerDevices(
125 IN PDEVICE_OBJECT DeviceObject);
126
127 NTSTATUS
128 SetIrpIoStatus(
129 IN PIRP Irp,
130 IN NTSTATUS Status,
131 IN ULONG Length);
132
133 NTSTATUS
134 WdmAudOpenSysAudioDevice(
135 IN LPWSTR DeviceName,
136 OUT PHANDLE Handle);
137
138 NTSTATUS
139 FindProductName(
140 IN LPWSTR PnpName,
141 IN ULONG ProductNameSize,
142 OUT LPWSTR ProductName);
143
144 NTSTATUS
145 WdmAudMixerCapabilities(
146 IN PDEVICE_OBJECT DeviceObject,
147 IN PWDMAUD_DEVICE_INFO DeviceInfo,
148 IN PWDMAUD_CLIENT ClientInfo,
149 IN PWDMAUD_DEVICE_EXTENSION DeviceExtension);
150
151 NTSTATUS
152 NTAPI
153 WdmAudFrameSize(
154 IN PDEVICE_OBJECT DeviceObject,
155 IN PIRP Irp,
156 IN PWDMAUD_DEVICE_INFO DeviceInfo,
157 IN PWDMAUD_CLIENT ClientInfo);
158
159 NTSTATUS
160 NTAPI
161 WdmAudGetLineInfo(
162 IN PDEVICE_OBJECT DeviceObject,
163 IN PIRP Irp,
164 IN PWDMAUD_DEVICE_INFO DeviceInfo,
165 IN PWDMAUD_CLIENT ClientInfo);
166
167 NTSTATUS
168 NTAPI
169 WdmAudGetLineControls(
170 IN PDEVICE_OBJECT DeviceObject,
171 IN PIRP Irp,
172 IN PWDMAUD_DEVICE_INFO DeviceInfo,
173 IN PWDMAUD_CLIENT ClientInfo);
174
175 NTSTATUS
176 NTAPI
177 WdmAudSetControlDetails(
178 IN PDEVICE_OBJECT DeviceObject,
179 IN PIRP Irp,
180 IN PWDMAUD_DEVICE_INFO DeviceInfo,
181 IN PWDMAUD_CLIENT ClientInfo);
182
183 NTSTATUS
184 NTAPI
185 WdmAudGetControlDetails(
186 IN PDEVICE_OBJECT DeviceObject,
187 IN PIRP Irp,
188 IN PWDMAUD_DEVICE_INFO DeviceInfo,
189 IN PWDMAUD_CLIENT ClientInfo);
190
191 NTSTATUS
192 WdmAudMixerInitialize(
193 IN PDEVICE_OBJECT DeviceObject);
194
195
196 #endif