Fix missed files. Svn problem?
[reactos.git] / reactos / drivers / multimedia / ks.h
1 /*
2 Kernel Streaming
3
4 Part of the ReactOS project
5 (See ReactOS licence for usage restrictions/permissions)
6
7 This file created by Andrew Greenwood.
8
9 Started September 12th, 2005.
10
11 You may notice some structs are empty. These are just placeholders and
12 should be fleshed-out when functions are implemented that require the
13 use of such structs.
14 */
15
16 #ifndef __INCLUDES_REACTOS_KS_H__
17 #define __INCLUDES_REACTOS_KS_H__
18
19 #include <ddk/ntddk.h>
20
21 /* What's this meant to be?! */
22 #define KSDDKAPI
23
24
25 /* Some unimplemented structs :) */
26
27 typedef struct _BUS_INTERFACE_REFERENCE
28 {
29 } BUS_INTERFACE_REFERENCE, *PBUS_INTERFACE_REFERENCE;
30
31 typedef struct _KSPIN_DESCRIPTOR
32 {
33 } KSPIN_DESCRIPTOR, *PKSPIN_DESCRIPTOR;
34
35 typedef struct _KSPIN_DESCRIPTOR_EX
36 {
37 } KSPIN_DESCRIPTOR_EX, *PKSPIN_DESCRIPTOR_EX;
38
39
40 /* This is just to shut the compiler up so DON'T USE IT! */
41 typedef void (*PFNKSINTERSECTHANDLER)(void);
42
43
44
45 typedef struct _KS_COMPRESSION
46 {
47 ULONG RatioNumerator;
48 ULONG RatioDenominator;
49 ULONG RatioConstantMargin;
50 } KS_COMPRESSION, *PKS_COMPRESSION;
51
52 typedef struct _KS_FRAMING_RANGE
53 {
54 ULONG MinFrameSize;
55 ULONG MaxFrameSize;
56 ULONG Stepping;
57 } KS_FRAMING_RANGE, *PKS_FRAMING_RANGE;
58
59 typedef struct _KS_FRAMING_RANGE_WEIGHTED
60 {
61 /* Obsolete */
62 } KS_FRAMING_RANGE_WEIGHTED, *PKS_FRAMING_RANGE_WEIGHTED;
63
64 typedef struct _KS_FRAMING_ITEM
65 {
66 GUID MemoryType;
67 GUID BusType;
68 ULONG MemoryFlags;
69 ULONG BusFlags;
70 ULONG Flags;
71 ULONG Frames;
72 ULONG FileAlignment;
73 ULONG MemoryTypeWeight;
74 KS_FRAMING_RANGE PhysicalRange;
75 KS_FRAMING_RANGE_WEIGHTED FramingRange;
76 } KS_FRAMING_ITEM, *PKS_FRAMING_ITEM;
77
78
79
80 typedef struct _KSALLOCATOR_FRAMING
81 {
82 union
83 {
84 ULONG OptionFlags;
85 ULONG RequirementsFlags;
86 };
87 POOL_TYPE PoolType;
88 ULONG Frames;
89 ULONG FrameSize;
90 ULONG FileAlignment;
91 ULONG Reserved;
92 } KSALLOCATOR_FRAMING, *PKSALLOCATOR_FRAMING;
93
94 typedef struct _KSALLOCATOR_FRAMING_EX
95 {
96 ULONG CountItems;
97 ULONG PinFlags;
98 KS_COMPRESSION OutputCompression;
99 ULONG PinWeight;
100 KS_FRAMING_ITEM FramingItem[1];
101 } KSALLOCATOR_FRAMING_EX, *PKSALLOCATOR_FRAMING_EX;
102
103
104
105 typedef struct _KSATTRIBUTE
106 {
107 ULONG Size;
108 ULONG Flags;
109 GUID Attribute;
110 } KSATTRIBUTE, *PKSATTRIBUTE;
111
112
113 /*
114 typedef struct _KSBUFFER_ITEM
115 {
116 KSDPC_ITEM DpcItem;
117 LIST_ENTRY BufferList;
118 } KSBUFFER_ITEM, *PKSBUFFER_ITEM;
119 */
120
121
122 typedef struct _KSIDENTIFIER
123 {
124 GUID Set;
125 ULONG Id;
126 ULONG Flags;
127 } KSIDENTIFIER;
128
129 typedef KSIDENTIFIER KSPIN_MEDIUM, *PKSPIN_MEDIUM;
130 typedef KSIDENTIFIER KSPIN_INTERFACE, *PKSPIN_INTERFACE;
131 typedef KSIDENTIFIER KSPROPERTY, *PKSPROPERTY;
132
133 typedef struct _KSPRIORITY
134 {
135 ULONG PriorityClass;
136 ULONG PrioritySubClass;
137 } KSPRIORITY, *PKSPRIORITY;
138
139 typedef struct _KSPIN_CONNECT
140 {
141 KSPIN_INTERFACE Interface;
142 KSPIN_MEDIUM Medium;
143 ULONG PinId;
144 HANDLE PinToHandle;
145 KSPRIORITY Priority;
146 } KSPIN_CONNECT, *PKSPIN_CONNECT;
147
148 typedef struct _KSP_PIN
149 {
150 KSPROPERTY Property;
151 ULONG PinId;
152 ULONG Reserved;
153 } KSP_PIN, *PKSP_PIN;
154
155
156 typedef struct _KSDEVICE
157 {
158 /* TODO */
159 } KSDEVICE, *PKSDEVICE;
160
161
162 /* Device dispatch routines */
163
164 typedef NTSTATUS
165 (*PFNKSDEVICECREATE)
166 (
167 IN PKSDEVICE Device
168 );
169
170 typedef NTSTATUS
171 (*PFNKSDEVICEPNPSTART)
172 (
173 IN PKSDEVICE Device,
174 IN PIRP Irp,
175 IN PCM_RESOURCE_LIST TranslatedResourceList OPTIONAL,
176 IN PCM_RESOURCE_LIST UntranslatedResourceList OPTIONAL
177 );
178
179 typedef NTSTATUS
180 (*PFNKSDEVICE)
181 (
182 IN PKSDEVICE Device
183 );
184
185 typedef NTSTATUS
186 (*PFNKSDEVICEIRP)
187 (
188 IN PKSDEVICE Device,
189 IN PIRP Irp
190 );
191
192 typedef VOID
193 (*PFNKSDEVICEIRPVOID)
194 (
195 IN PKSDEVICE Device,
196 IN PIRP Irp
197 );
198
199 typedef NTSTATUS
200 (*PFNKSDEVICEQUERYCAPABILITIES)
201 (
202 IN PKSDEVICE Device,
203 IN PIRP Irp,
204 IN OUT PDEVICE_CAPABILITIES Capabilities
205 );
206
207 typedef NTSTATUS
208 (*PFNKSDEVICEQUERYPOWER)
209 (
210 IN PKSDEVICE Device,
211 IN PIRP Irp,
212 IN DEVICE_POWER_STATE DeviceTo,
213 IN DEVICE_POWER_STATE DeviceFrom,
214 IN SYSTEM_POWER_STATE SystemTo,
215 IN SYSTEM_POWER_STATE SystemFrom,
216 IN POWER_ACTION Action
217 );
218
219 typedef VOID
220 (*PFNKSDEVICESETPOWER)
221 (
222 IN PKSDEVICE Device,
223 IN PIRP Irp,
224 IN DEVICE_POWER_STATE To,
225 IN DEVICE_POWER_STATE From
226 );
227
228 typedef struct _KSDEVICE_DISPATCH
229 {
230 PFNKSDEVICECREATE Add;
231 PFNKSDEVICEPNPSTART Start;
232 PFNKSDEVICE PostStart;
233 PFNKSDEVICEIRP QueryStop;
234 PFNKSDEVICEIRPVOID CancelStop;
235 PFNKSDEVICEIRPVOID Stop;
236 PFNKSDEVICEIRP QueryRemove;
237 PFNKSDEVICEIRPVOID CancelRemove;
238 PFNKSDEVICEIRPVOID Remove;
239 PFNKSDEVICEQUERYCAPABILITIES QueryCapabilities;
240 PFNKSDEVICEIRPVOID SurpriseRemoval;
241 PFNKSDEVICEQUERYPOWER Querypower;
242 PFNKSDEVICESETPOWER SetPower;
243 } KSDEVICE_DISPATCH, *PKSDEVICE_DISPATCH;
244
245
246
247 /* Some more unimplemented stuff */
248
249 typedef struct _KSFILTER
250 {
251 } KSFILTER, *PKSFILTER;
252
253 typedef struct _KSPROCESSPIN_INDEXENTRY
254 {
255 } KSPROCESSPIN_INDEXENTRY, *PKSPROCESSPIN_INDEXENTRY;
256
257
258 /* Filter dispatch routines */
259
260 typedef NTSTATUS
261 (*PFNKSFILTERIRP)
262 (
263 IN PKSFILTER Filter,
264 IN PIRP Irp
265 );
266
267 typedef NTSTATUS
268 (*PFNKSFILTERPROCESS)
269 (
270 IN PKSFILTER FIlter,
271 IN PKSPROCESSPIN_INDEXENTRY ProcessPinsIndex
272 );
273
274 typedef NTSTATUS
275 (*PFNKSFILTERVOID)
276 (
277 IN PKSFILTER Filter
278 );
279
280 typedef struct _KSFILTER_DISPATCH
281 {
282 PFNKSFILTERIRP Create;
283 PFNKSFILTERIRP Close;
284 PFNKSFILTERPROCESS Process;
285 PFNKSFILTERVOID Reset;
286 } KSFILTER_DISPATCH, *PKSFILTER_DISPATCH;
287
288
289
290 /* TODO! */
291
292 typedef struct _KSAUTOMATION_TABLE
293 {
294 } KSAUTOMATION_TABLE, *PKSAUTOMATION_TABLE;
295
296 typedef struct _KSNODE_DESCRIPTOR
297 {
298 } KSNODE_DESCRIPTOR, *PKSNODE_DESCRIPTOR;
299
300 typedef struct _KSTOPOLOGY_CONNECTION
301 {
302 } KSTOPOLOGY_CONNECTION, *PKSTOPOLOGY_CONNECTION;
303
304 typedef struct _KSCOMPONENTID
305 {
306 } KSCOMPONENTID, *PKSCOMPONENTID;
307
308
309 /* Descriptors (filter, device, ...) */
310
311 typedef struct _KSFILTER_DESCRIPTOR
312 {
313 const KSFILTER_DISPATCH* Dispatch;
314 const KSAUTOMATION_TABLE* AutomationTable;
315 ULONG Version;
316 ULONG Flags;
317 const GUID* ReferenceGuid;
318 ULONG PinDescriptorsCount;
319 ULONG PinDescriptorSize;
320 const KSPIN_DESCRIPTOR_EX* PinDescriptors;
321 ULONG CategoriesCount;
322 const GUID* Categories;
323 ULONG NodeDescriptorsCount;
324 ULONG NodeDescriptorSize;
325 const KSNODE_DESCRIPTOR* NodeDescriptors;
326 ULONG ConnectionsCount;
327 const KSTOPOLOGY_CONNECTION* Connections;
328 const KSCOMPONENTID* ComponentId;
329 } KSFILTER_DESCRIPTOR, *PKSFILTER_DESCRIPTOR;
330
331 typedef struct _KSDEVICE_DESCRIPTOR
332 {
333 const KSDEVICE_DISPATCH* Dispatch;
334 ULONG FilterDescriptorsCount;
335 const KSFILTER_DESCRIPTOR* const* FilterDescriptors;
336 ULONG Version; /* Doesn't appear to be in the documentation */
337 } KSDEVICE_DESCRIPTOR, *PKSDEVICE_DESCRIPTOR;
338
339
340
341
342 /*
343 API functions
344 */
345
346 NTSTATUS NTAPI
347 KsInitializeDriver(
348 IN PDRIVER_OBJECT DriverObject,
349 IN PUNICODE_STRING RegistryPath,
350 IN const KSDEVICE_DESCRIPTOR* Descriptor OPTIONAL);
351
352 #endif