158c6602fddafffc6113fee9be90929c7228e500
[reactos.git] / reactos / include / psdk / ks.h
1 /*
2 ReactOS
3 Kernel Streaming API
4
5 by Andrew Greenwood
6
7 NOTES:
8 This is a basic stubbing of the Kernel Streaming API header. It is
9 very incomplete - a lot of the #defines are not set to any value at all.
10
11 Some of the structs/funcs may be incorrectly grouped.
12
13 GUIDs need to be defined properly.
14
15 AVStream functionality (XP and above, DirectX 8.0 and above) will NOT
16 implemented for a while.
17
18 Some example code for interaction from usermode:
19 DeviceIoControl(
20 FilterHandle,
21 IOCTL_KS_PROPERTY,
22 &Property,
23 sizeof(KSPROPERTY),
24 &SeekingCapabilities,
25 sizeof(KS_SEEKING_CAPABILITIES),
26 &BytesReturned,
27 &Overlapped);
28 */
29
30 #ifndef _KS_
31 #define _KS_
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #ifdef BUILDING_KS
38 #define KSDDKAPI
39 #else
40 #define KSDDKAPI //DECLSPEC_IMPORT /* TODO */
41 #endif
42
43
44 #define KSFILTER_NODE ((ULONG)-1)
45 #define KSALL_NODES ((ULONG)-1)
46
47 #define KSSTRING_Filter L"{9B365890-165F-11D0-A195-0020AFD156E4}"
48 #define KSSTRING_Pin L"{146F1A80-4791-11D0-A5D6-28DB04C10000}"
49 #define KSSTRING_Clock L"{53172480-4791-11D0-A5D6-28DB04C10000}"
50 #define KSSTRING_Allocator L"{642F5D00-4791-11D0-A5D6-28DB04C10000}"
51 #define KSSTRING_AllocatorEx L"{091BB63B-603F-11D1-B067-00A0C9062802}"
52 #define KSSTRING_TopologyNode L"{0621061A-EE75-11D0-B915-00A0C9223196}"
53
54 #define KSDATAFORMAT_BIT_ATTRIBUTES 1
55 #define KSDATAFORMAT_ATTRIBUTES (1 << KSDATAFORMAT_BIT_ATTRIBUTES)
56
57 #if defined(_NTDDK_)
58 typedef PVOID PKSWORKER;
59 #endif
60
61 #ifndef SIZEOF_ARRAY
62 #define SIZEOF_ARRAY(a) (sizeof(a)/sizeof((a)[0]))
63 #endif
64
65 /* ===============================================================
66 GUID definition helpers
67 */
68
69 #ifndef _NTRTL_
70 #ifndef DEFINE_GUIDEX
71 #ifdef _MSC_VER
72 #define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name
73 #else
74 #define DEFINE_GUIDEX(name) EXTERN_C const GUID name
75 #endif
76 #endif
77
78 #ifndef STATICGUIDOF
79 #define STATICGUIDOF(guid) STATIC_##guid
80 #endif
81 #endif
82
83 #if defined(__cplusplus) && _MSC_VER >= 1100
84 #define DEFINE_GUIDSTRUCT(guid, name) struct __declspec(uuid(guid)) name
85 #define DEFINE_GUIDNAMED(name) __uuidof(struct name)
86 #else
87 #define DEFINE_GUIDSTRUCT(guid, name) DEFINE_GUIDEX(name)
88 #define DEFINE_GUIDNAMED(name) name
89 #endif
90
91
92 #define STATIC_GUID_NULL \
93 0x00000000L, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
94 DEFINE_GUIDSTRUCT("00000000-0000-0000-0000-000000000000", GUID_NULL);
95 #define GUID_NULL DEFINE_GUIDNAMED(GUID_NULL)
96
97
98 #define STATIC_KSNAME_Filter\
99 0x9b365890L, 0x165f, 0x11d0, {0xa1, 0x95, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4}
100 DEFINE_GUIDSTRUCT("9b365890-165f-11d0-a195-0020afd156e4", KSNAME_Filter);
101 #define KSNAME_Filter DEFINE_GUIDNAMED(KSNAME_Filter)
102
103 #define STATIC_KSMEMORY_TYPE_KERNEL_PAGED \
104 0xd833f8f8L, 0x7894, 0x11d1, {0xb0, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02}
105 DEFINE_GUIDSTRUCT("d833f8f8-7894-11d1-b069-00a0c9062802", KSMEMORY_TYPE_KERNEL_PAGED);
106 #define KSMEMORY_TYPE_KERNEL_PAGED DEFINE_GUIDNAMED(KSMEMORY_TYPE_KERNEL_PAGED)
107
108 /* ===============================================================
109 I/O Control Codes
110 */
111
112 #define IOCTL_KS_DISABLE_EVENT \
113 CTL_CODE( \
114 FILE_DEVICE_KS, \
115 0x000, \
116 METHOD_NEITHER, \
117 FILE_ANY_ACCESS)
118
119 #define IOCTL_KS_ENABLE_EVENT \
120 CTL_CODE( \
121 FILE_DEVICE_KS, \
122 0x001, \
123 METHOD_NEITHER, \
124 FILE_ANY_ACCESS)
125
126 // WAS 2
127 #define IOCTL_KS_METHOD \
128 CTL_CODE( \
129 FILE_DEVICE_KS, \
130 0x003, \
131 METHOD_NEITHER, \
132 FILE_ANY_ACCESS)
133
134 // WAS 3
135 #define IOCTL_KS_PROPERTY \
136 CTL_CODE( \
137 FILE_DEVICE_KS, \
138 0x000, \
139 METHOD_NEITHER, \
140 FILE_ANY_ACCESS)
141
142 #define IOCTL_KS_WRITE_STREAM \
143 CTL_CODE( \
144 FILE_DEVICE_KS, \
145 0x004, \
146 METHOD_NEITHER, \
147 FILE_WRITE_ACCESS)
148
149 #define IOCTL_KS_READ_STREAM \
150 CTL_CODE( \
151 FILE_DEVICE_KS, \
152 0x005, \
153 METHOD_NEITHER, \
154 FILE_READ_ACCESS)
155
156 #define IOCTL_KS_RESET_STATE \
157 CTL_CODE( \
158 FILE_DEVICE_KS, \
159 0x006, \
160 METHOD_NEITHER, \
161 FILE_ANY_ACCESS)
162
163
164 /* ===============================================================
165 Categories
166 */
167
168 #define STATIC_KSCATEGORY_BRIDGE \
169 0x085AFF00L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
170 DEFINE_GUIDSTRUCT("085AFF00-62CE-11CF-A5D6-28DB04C10000", KSCATEGORY_BRIDGE);
171 #define KSCATEGORY_BRIDGE DEFINE_GUIDNAMED(KSCATEGORY_BRIDGE)
172
173 #define STATIC_KSCATEGORY_CAPTURE \
174 0x65E8773DL, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
175 DEFINE_GUIDSTRUCT("65E8773D-8F56-11D0-A3B9-00A0C9223196", KSCATEGORY_CAPTURE);
176 #define KSCATEGORY_CAPTURE DEFINE_GUIDNAMED(KSCATEGORY_CAPTURE)
177
178 #define STATIC_KSCATEGORY_RENDER \
179 0x65E8773EL, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
180 DEFINE_GUIDSTRUCT("65E8773E-8F56-11D0-A3B9-00A0C9223196", KSCATEGORY_RENDER);
181 #define KSCATEGORY_RENDER DEFINE_GUIDNAMED(KSCATEGORY_RENDER)
182
183 #define STATIC_KSCATEGORY_MIXER \
184 0xAD809C00L, 0x7B88, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
185 DEFINE_GUIDSTRUCT("AD809C00-7B88-11D0-A5D6-28DB04C10000", KSCATEGORY_MIXER);
186 #define KSCATEGORY_MIXER DEFINE_GUIDNAMED(KSCATEGORY_MIXER)
187
188 #define STATIC_KSCATEGORY_SPLITTER \
189 0x0A4252A0L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
190 DEFINE_GUIDSTRUCT("0A4252A0-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_SPLITTER);
191 #define KSCATEGORY_SPLITTER DEFINE_GUIDNAMED(KSCATEGORY_SPLITTER)
192
193 #define STATIC_KSCATEGORY_DATACOMPRESSOR \
194 0x1E84C900L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
195 DEFINE_GUIDSTRUCT("1E84C900-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_DATACOMPRESSOR);
196 #define KSCATEGORY_DATACOMPRESSOR DEFINE_GUIDNAMED(KSCATEGORY_DATACOMPRESSOR)
197
198 #define STATIC_KSCATEGORY_DATADECOMPRESSOR \
199 0x2721AE20L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
200 DEFINE_GUIDSTRUCT("2721AE20-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_DATADECOMPRESSOR);
201 #define KSCATEGORY_DATADECOMPRESSOR DEFINE_GUIDNAMED(KSCATEGORY_DATADECOMPRESSOR)
202
203 #define STATIC_KSCATEGORY_DATATRANSFORM \
204 0x2EB07EA0L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
205 DEFINE_GUIDSTRUCT("2EB07EA0-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_DATATRANSFORM);
206 #define KSCATEGORY_DATATRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_DATATRANSFORM)
207
208 #define STATIC_KSCATEGORY_COMMUNICATIONSTRANSFORM \
209 0xCF1DDA2CL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
210 DEFINE_GUIDSTRUCT("CF1DDA2C-9743-11D0-A3EE-00A0C9223196", KSCATEGORY_COMMUNICATIONSTRANSFORM);
211 #define KSCATEGORY_COMMUNICATIONSTRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_COMMUNICATIONSTRANSFORM)
212
213 #define STATIC_KSCATEGORY_INTERFACETRANSFORM \
214 0xCF1DDA2DL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
215 DEFINE_GUIDSTRUCT("CF1DDA2D-9743-11D0-A3EE-00A0C9223196", KSCATEGORY_INTERFACETRANSFORM);
216 #define KSCATEGORY_INTERFACETRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_INTERFACETRANSFORM)
217
218 #define STATIC_KSCATEGORY_MEDIUMTRANSFORM \
219 0xCF1DDA2EL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
220 DEFINE_GUIDSTRUCT("CF1DDA2E-9743-11D0-A3EE-00A0C9223196", KSCATEGORY_MEDIUMTRANSFORM);
221 #define KSCATEGORY_MEDIUMTRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_MEDIUMTRANSFORM)
222
223 #define STATIC_KSCATEGORY_FILESYSTEM \
224 0x760FED5EL, 0x9357, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
225 DEFINE_GUIDSTRUCT("760FED5E-9357-11D0-A3CC-00A0C9223196", KSCATEGORY_FILESYSTEM);
226 #define KSCATEGORY_FILESYSTEM DEFINE_GUIDNAMED(KSCATEGORY_FILESYSTEM)
227
228 #define STATIC_KSCATEGORY_CLOCK \
229 0x53172480L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
230 DEFINE_GUIDSTRUCT("53172480-4791-11D0-A5D6-28DB04C10000", KSCATEGORY_CLOCK);
231 #define KSCATEGORY_CLOCK DEFINE_GUIDNAMED(KSCATEGORY_CLOCK)
232
233 #define STATIC_KSCATEGORY_PROXY \
234 0x97EBAACAL, 0x95BD, 0x11D0, 0xA3, 0xEA, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
235 DEFINE_GUIDSTRUCT("97EBAACA-95BD-11D0-A3EA-00A0C9223196", KSCATEGORY_PROXY);
236 #define KSCATEGORY_PROXY DEFINE_GUIDNAMED(KSCATEGORY_PROXY)
237
238 #define STATIC_KSCATEGORY_QUALITY \
239 0x97EBAACBL, 0x95BD, 0x11D0, 0xA3, 0xEA, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
240 DEFINE_GUIDSTRUCT("97EBAACB-95BD-11D0-A3EA-00A0C9223196", KSCATEGORY_QUALITY);
241 #define KSCATEGORY_QUALITY DEFINE_GUIDNAMED(KSCATEGORY_QUALITY)
242
243 /* ===============================================================
244 Common
245 */
246
247 typedef struct
248 {
249 GUID Set;
250 ULONG Id;
251 ULONG Flags;
252 } KSIDENTIFIER, *PKSIDENTIFIER;
253
254 typedef KSIDENTIFIER KSPROPERTY, *PKSPROPERTY;
255 typedef KSIDENTIFIER KSMETHOD, *PKSMETHOD;
256 typedef KSIDENTIFIER KSEVENT, *PKSEVENT;
257
258 typedef KSIDENTIFIER KSDEGRADE, *PKSDEGRADE;
259
260 typedef KSIDENTIFIER KSPIN_INTERFACE, *PKSPIN_INTERFACE;
261 typedef KSIDENTIFIER KSPIN_MEDIUM, *PKSPIN_MEDIUM;
262
263 typedef union {
264 struct {
265 ULONG FormatSize;
266 ULONG Flags;
267 ULONG SampleSize;
268 ULONG Reserved;
269 GUID MajorFormat;
270 GUID SubFormat;
271 GUID Specifier;
272 };
273 LONGLONG Alignment;
274 } KSDATAFORMAT, *PKSDATAFORMAT, KSDATARANGE, *PKSDATARANGE;
275
276
277 typedef struct
278 {
279 ULONG Size;
280 ULONG Flags;
281 GUID Attribute;
282 } KSATTRIBUTE, *PKSATTRIBUTE;
283
284
285
286 /* ===============================================================
287 Interface Sets - TODO
288 */
289
290 #if 0
291 #define KSINTERFACESETID_Media
292
293 #define KSINTERFACESETID_Standard
294 #define KSINTERFACE_STANDARD_STREAMING
295 #define KSINTERFACE_STANDARD_LOOPED_STREAMING
296 #define KSINTERFACE_STANDARD_CONTROL
297 #endif
298
299 #define STATIC_KSINTERFACESETID_Standard \
300 0x1A8766A0L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
301 DEFINE_GUIDSTRUCT("1A8766A0-62CE-11CF-A5D6-28DB04C10000", KSINTERFACESETID_Standard);
302 #define KSINTERFACESETID_Standard DEFINE_GUIDNAMED(KSINTERFACESETID_Standard)
303
304 typedef enum
305 {
306 KSINTERFACE_STANDARD_STREAMING,
307 KSINTERFACE_STANDARD_LOOPED_STREAMING,
308 KSINTERFACE_STANDARD_CONTROL
309 } KSINTERFACE_STANDARD;
310
311 #define STATIC_KSINTERFACESETID_FileIo \
312 0x8C6F932CL, 0xE771, 0x11D0, 0xB8, 0xFF, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
313 DEFINE_GUIDSTRUCT("8C6F932C-E771-11D0-B8FF-00A0C9223196", KSINTERFACESETID_FileIo);
314 #define KSINTERFACESETID_FileIo DEFINE_GUIDNAMED(KSINTERFACESETID_FileIo)
315
316
317 /* ===============================================================
318 Mediums
319 */
320
321 typedef enum
322 {
323 KSINTERFACE_FILEIO_STREAMING
324 } KSINTERFACE_FILEIO;
325
326 #define KSMEDIUM_TYPE_ANYINSTANCE 0
327
328 #define STATIC_KSMEDIUMSETID_Standard \
329 0x4747B320L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
330 DEFINE_GUIDSTRUCT("4747B320-62CE-11CF-A5D6-28DB04C10000", KSMEDIUMSETID_Standard);
331 #define KSMEDIUMSETID_Standard DEFINE_GUIDNAMED(KSMEDIUMSETID_Standard)
332
333
334 /* ===============================================================
335 Clock Properties/Methods/Events
336 */
337
338 #define KSPROPSETID_Clock \
339 0xDF12A4C0L, 0xAC17, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
340
341 typedef enum
342 {
343 KSPROPERTY_CLOCK_TIME,
344 KSPROPERTY_CLOCK_PHYSICALTIME,
345 KSPROPERTY_CORRELATEDTIME,
346 KSPROPERTY_CORRELATEDPHYSICALTIME,
347 KSPROPERTY_CLOCK_RESOLUTION,
348 KSPROPERTY_CLOCK_STATE,
349 KSPROPERTY_CLOCK_FUNCTIONTABLE
350 } KSPROPERTY_CLOCK;
351
352 #define KSEVENTSETID_Clock \
353 0x364D8E20L, 0x62C7, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
354
355 typedef enum
356 {
357 KSEVENT_CLOCK_INTERVAL_MARK,
358 KSEVENT_CLOCK_POSITION_MARK
359 } KSEVENT_CLOCK_POSITION;
360
361
362 /* ===============================================================
363 Connection Properties/Methods/Events
364 */
365
366 #define STATIC_KSPROPSETID_Connection \
367 0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
368 DEFINE_GUIDSTRUCT("1D58C920-AC9B-11CF-A5D6-28DB04C10000", KSPROPSETID_Connection);
369 #define KSPROPSETID_Connection DEFINE_GUIDNAMED(KSPROPSETID_Connection)
370
371
372 typedef enum
373 {
374 KSPROPERTY_CONNECTION_STATE,
375 KSPROPERTY_CONNECTION_PRIORITY,
376 KSPROPERTY_CONNECTION_DATAFORMAT,
377 KSPROPERTY_CONNECTION_ALLOCATORFRAMING,
378 KSPROPERTY_CONNECTION_PROPOSEDATAFORMAT,
379 KSPROPERTY_CONNECTION_ACQUIREORDERING,
380 KSPROPERTY_CONNECTION_ALLOCATORFRAMING_EX,
381 KSPROPERTY_CONNECTION_STARTAT
382 } KSPROPERTY_CONNECTION;
383
384 #define DEFINE_KSPROPERTY_ITEM_CONNECTION_STATE(GetHandler, SetHandler)\
385 DEFINE_KSPROPERTY_ITEM(\
386 KSPROPERTY_CONNECTION_STATE,\
387 (GetHandler),\
388 sizeof(KSPROPERTY),\
389 sizeof(KSSTATE),\
390 (SetHandler),\
391 NULL, 0, NULL, NULL, 0)
392
393 #define DEFINE_KSPROPERTY_ITEM_CONNECTION_PRIORITY(GetHandler, SetHandler)\
394 DEFINE_KSPROPERTY_ITEM(\
395 KSPROPERTY_CONNECTION_PRIORITY,\
396 (GetHandler),\
397 sizeof(KSPROPERTY),\
398 sizeof(KSPRIORITY),\
399 (SetHandler),\
400 NULL, 0, NULL, NULL, 0)
401
402 #define DEFINE_KSPROPERTY_ITEM_CONNECTION_DATAFORMAT(GetHandler, SetHandler)\
403 DEFINE_KSPROPERTY_ITEM(\
404 KSPROPERTY_CONNECTION_DATAFORMAT,\
405 (GetHandler),\
406 sizeof(KSPROPERTY),\
407 0,\
408 (SetHandler),\
409 NULL, 0, NULL, NULL, 0)
410
411 #define DEFINE_KSPROPERTY_ITEM_CONNECTION_ALLOCATORFRAMING(Handler)\
412 DEFINE_KSPROPERTY_ITEM(\
413 KSPROPERTY_CONNECTION_ALLOCATORFRAMING,\
414 (Handler),\
415 sizeof(KSPROPERTY),\
416 sizeof(KSALLOCATOR_FRAMING),\
417 NULL, NULL, 0, NULL, NULL, 0)
418
419 #define DEFINE_KSPROPERTY_ITEM_CONNECTION_ALLOCATORFRAMING_EX(Handler)\
420 DEFINE_KSPROPERTY_ITEM(\
421 KSPROPERTY_CONNECTION_ALLOCATORFRAMING_EX,\
422 (Handler),\
423 sizeof(KSPROPERTY),\
424 0,\
425 NULL, NULL, 0, NULL, NULL, 0)
426
427 #define DEFINE_KSPROPERTY_ITEM_CONNECTION_PROPOSEDATAFORMAT(Handler)\
428 DEFINE_KSPROPERTY_ITEM(\
429 KSPROPERTY_CONNECTION_PROPOSEDATAFORMAT,\
430 NULL,\
431 sizeof(KSPROPERTY),\
432 sizeof(KSDATAFORMAT),\
433 (Handler),\
434 NULL, 0, NULL, NULL, 0)
435
436 #define DEFINE_KSPROPERTY_ITEM_CONNECTION_ACQUIREORDERING(Handler)\
437 DEFINE_KSPROPERTY_ITEM(\
438 KSPROPERTY_CONNECTION_ACQUIREORDERING,\
439 (Handler),\
440 sizeof(KSPROPERTY),\
441 sizeof(int),\
442 NULL, NULL, 0, NULL, NULL, 0)
443
444 #define DEFINE_KSPROPERTY_ITEM_CONNECTION_STARTAT(Handler)\
445 DEFINE_KSPROPERTY_ITEM(\
446 KSPROPERTY_CONNECTION_STARTAT,\
447 NULL,\
448 sizeof(KSPROPERTY),\
449 sizeof(KSRELATIVEEVENT),\
450 (Handler),\
451 NULL, 0, NULL, NULL, 0)
452
453
454 #define KSEVENTSETID_Connection \
455 0x7f4bcbe0L, 0x9ea5, 0x11cf, 0xa5, 0xd6, 0x28, 0xdb, 0x04, 0xc1, 0x00, 0x00
456
457 typedef enum
458 {
459 KSEVENT_CONNECTION_POSITIONUPDATE,
460 KSEVENT_CONNECTION_DATADISCONTINUITY,
461 KSEVENT_CONNECTION_TIMEDISCONTINUITY,
462 KSEVENT_CONNECTION_PRIORITY,
463 KSEVENT_CONNECTION_ENDOFSTREAM
464 } KSEVENT_CONNECTION;
465
466
467 /* ===============================================================
468 General
469 Properties/Methods/Events
470 */
471
472 #define STATIC_KSPROPSETID_General\
473 0x1464EDA5L, 0x6A8F, 0x11D1, {0x9A, 0xA7, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
474 DEFINE_GUIDSTRUCT("1464EDA5-6A8F-11D1-9AA7-00A0C9223196", KSPROPSETID_General);
475 #define KSPROPSETID_General DEFINE_GUIDNAMED(KSPROPSETID_General)
476
477
478 typedef enum
479 {
480 KSPROPERTY_GENERAL_COMPONENTID
481 } KSPROPERTY_GENERAL;
482
483
484 /* ===============================================================
485 Graph Manager
486 Properties/Methods/Events
487 */
488
489 #define KSPROPSETID_GM \
490 0xAF627536L, 0xE719, 0x11D2, 0x8A, 0x1D, 0x00, 0x60, 0x97, 0xD2, 0xDF, 0x5D
491
492 typedef enum
493 {
494 KSPROPERTY_GM_GRAPHMANAGER,
495 KSPROPERTY_GM_TIMESTAMP_CLOCK,
496 KSPROPERTY_GM_RATEMATCH,
497 KSPROPERTY_GM_RENDERCLOCK
498 } KSPROPERTY_GM;
499
500
501 /* ===============================================================
502 Media Seeking
503 Properties/Methods/Events
504 */
505
506 #define KSPROPSETID_MediaSeeking \
507 0xEE904F0CL, 0xD09B, 0x11D0, 0xAB, 0xE9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
508
509 typedef enum
510 {
511 KSPROPERTY_MEDIASEEKING_CAPABILITIES,
512 KSPROPERTY_MEDIASEEKING_FORMATS,
513 KSPROPERTY_MEDIASEEKING_TIMEFORMAT,
514 KSPROPERTY_MEDIASEEKING_POSITION,
515 KSPROPERTY_MEDIASEEKING_STOPPOSITION,
516 KSPROPERTY_MEDIASEEKING_POSITIONS,
517 KSPROPERTY_MEDIASEEKING_DURATION,
518 KSPROPERTY_MEDIASEEKING_AVAILABLE,
519 KSPROPERTY_MEDIASEEKING_PREROLL,
520 KSPROPERTY_MEDIASEEKING_CONVERTTIMEFORMAT
521 } KSPROPERTY_MEDIASEEKING;
522
523
524 /* ===============================================================
525 Pin
526 Properties/Methods/Events
527 */
528
529 #define STATIC_KSPROPSETID_Pin\
530 0x8C134960L, 0x51AD, 0x11CF, 0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00
531 DEFINE_GUIDSTRUCT("8C134960-51AD-11CF-878A-94F801C10000", KSPROPSETID_Pin);
532 #define KSPROPSETID_Pin DEFINE_GUIDNAMED(KSPROPSETID_Pin)
533
534 #define STATIC_KSNAME_Pin\
535 0x146F1A80L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
536 DEFINE_GUIDSTRUCT("146F1A80-4791-11D0-A5D6-28DB04C10000", KSNAME_Pin);
537 #define KSNAME_Pin DEFINE_GUIDNAMED(KSNAME_Pin)
538
539
540 typedef enum
541 {
542 KSPROPERTY_PIN_CINSTANCES,
543 KSPROPERTY_PIN_CTYPES,
544 KSPROPERTY_PIN_DATAFLOW,
545 KSPROPERTY_PIN_DATARANGES,
546 KSPROPERTY_PIN_DATAINTERSECTION,
547 KSPROPERTY_PIN_INTERFACES,
548 KSPROPERTY_PIN_MEDIUMS,
549 KSPROPERTY_PIN_COMMUNICATION,
550 KSPROPERTY_PIN_GLOBALCINSTANCES,
551 KSPROPERTY_PIN_NECESSARYINSTANCES,
552 KSPROPERTY_PIN_PHYSICALCONNECTION,
553 KSPROPERTY_PIN_CATEGORY,
554 KSPROPERTY_PIN_NAME,
555 KSPROPERTY_PIN_CONSTRAINEDDATARANGES,
556 KSPROPERTY_PIN_PROPOSEDATAFORMAT
557 } KSPROPERTY_PIN;
558
559 typedef struct
560 {
561 KSPROPERTY Property;
562 ULONG PinId;
563 ULONG Reserved;
564 } KSP_PIN, *PKSP_PIN;
565
566 #define KSINSTANCE_INDETERMINATE ((ULONG)-1)
567
568 typedef struct
569 {
570 ULONG PossibleCount;
571 ULONG CurrentCount;
572 } KSPIN_CINSTANCES, *PKSPIN_CINSTANCES;
573
574 typedef struct
575 {
576 ULONG Size;
577 ULONG Pin;
578 WCHAR SymbolicLinkName[1];
579 } KSPIN_PHYSICALCONNECTION, *PKSPIN_PHYSICALCONNECTION;
580
581
582 /* ===============================================================
583 Quality
584 Properties/Methods/Events
585 */
586
587 #define KSPROPSETID_Quality \
588 0xD16AD380L, 0xAC1A, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
589
590 typedef enum
591 {
592 KSPROPERTY_QUALITY_REPORT,
593 KSPROPERTY_QUALITY_ERROR
594 } KSPROPERTY_QUALITY;
595
596
597 /* ===============================================================
598 Stream
599 Properties/Methods/Events
600 */
601
602 #define KSPROPSETID_Stream \
603 0x65aaba60L, 0x98ae, 0x11cf, 0xa1, 0x0d, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4
604
605 typedef enum
606 {
607 KSPROPERTY_STREAM_ALLOCATOR,
608 KSPROPERTY_STREAM_QUALITY,
609 KSPROPERTY_STREAM_DEGRADATION,
610 KSPROPERTY_STREAM_MASTERCLOCK,
611 KSPROPERTY_STREAM_TIMEFORMAT,
612 KSPROPERTY_STREAM_PRESENTATIONTIME,
613 KSPROPERTY_STREAM_PRESENTATIONEXTENT,
614 KSPROPERTY_STREAM_FRAMETIME,
615 KSPROPERTY_STREAM_RATECAPABILITY,
616 KSPROPERTY_STREAM_RATE,
617 KSPROPERTY_STREAM_PIPE_ID
618 } KSPROPERTY_STREAM;
619
620
621 /* ===============================================================
622 StreamAllocator
623 Properties/Methods/Events
624 */
625
626 #define STATIC_KSPROPSETID_StreamAllocator\
627 0xcf6e4342L, 0xec87, 0x11cf, 0xa1, 0x30, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4
628 DEFINE_GUIDSTRUCT("cf6e4342-ec87-11cf-a130-0020afd156e4", KSPROPSETID_StreamAllocator);
629 #define KSPROPSETID_StreamAllocator DEFINE_GUIDNAMED(KSPROPSETID_StreamAllocator)
630
631 typedef enum
632 {
633 KSPROPERTY_STREAMALLOCATOR_FUNCTIONTABLE,
634 KSPROPERTY_STREAMALLOCATOR_STATUS
635 } KSPROPERTY_STREAMALLOCATOR;
636
637 #define KSMETHODSETID_StreamAllocator \
638 0xcf6e4341L, 0xec87, 0x11cf, 0xa1, 0x30, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4
639
640 typedef enum
641 {
642 KSMETHOD_STREAMALLOCATOR_ALLOC,
643 KSMETHOD_STREAMALLOCATOR_FREE
644 } KSMETHOD_STREAMALLOCATOR;
645
646
647 #define KSEVENTSETID_StreamAllocator
648
649 typedef enum
650 {
651 KSEVENT_STREAMALLOCATOR_INTERNAL_FREEFRAME,
652 KSEVENT_STREAMALLOCATOR_FREEFRAME
653 } KSEVENT_STREAMALLOCATOR;
654
655
656 /* ===============================================================
657 StreamInterface
658 Properties/Methods/Events
659 */
660
661 #define KSPROPSETID_StreamInterface \
662 0x1fdd8ee1L, 0x9cd3, 0x11d0, 0x82, 0xaa, 0x00, 0x00, 0xf8, 0x22, 0xfe, 0x8a
663
664 typedef enum
665 {
666 KSPROPERTY_STREAMINTERFACE_HEADERSIZE
667 } KSPROPERTY_STREAMINTERFACE;
668
669
670 /* ===============================================================
671 Topology
672 Properties/Methods/Events
673 */
674
675 #define STATIC_KSPROPSETID_Topology\
676 0x720D4AC0L, 0x7533, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
677 DEFINE_GUIDSTRUCT("720D4AC0-7533-11D0-A5D6-28DB04C10000", KSPROPSETID_Topology);
678 #define KSPROPSETID_Topology DEFINE_GUIDNAMED(KSPROPSETID_Topology)
679
680 typedef enum {
681 KSPROPERTY_TOPOLOGY_CATEGORIES,
682 KSPROPERTY_TOPOLOGY_NODES,
683 KSPROPERTY_TOPOLOGY_CONNECTIONS,
684 KSPROPERTY_TOPOLOGY_NAME
685 } KSPROPERTY_TOPOLOGY;
686
687 /* ===============================================================
688 Property Sets for audio drivers - TODO
689 */
690
691 #define STATIC_KSPROPTYPESETID_General \
692 0x97E99BA0L, 0xBDEA, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
693 DEFINE_GUIDSTRUCT("97E99BA0-BDEA-11CF-A5D6-28DB04C10000", KSPROPTYPESETID_General);
694 #define KSPROPTYPESETID_General DEFINE_GUIDNAMED(KSPROPTYPESETID_General)
695
696 /*
697 KSPROPERTY_AC3_ALTERNATE_AUDIO
698 KSPROPERTY_AC3_BIT_STREAM_MODE
699 KSPROPERTY_AC3_DIALOGUE_LEVEL
700 KSPROPERTY_AC3_DOWNMIX
701 KSPROPERTY_AC3_ERROR_CONCEALMENT
702 KSPROPERTY_AC3_LANGUAGE_CODE
703 KSPROPERTY_AC3_ROOM_TYPE
704 */
705
706 #define KSPROPSETID_Acoustic_Echo_Cancel
707 /*
708 KSPROPERTY_AEC_MODE
709 KSPROPERTY_AEC_NOISE_FILL_ENABLE
710 KSPROPERTY_AEC_STATUS
711 */
712
713 /*
714 KSPROPERTY_AUDIO_3D_INTERFACE
715 KSPROPERTY_AUDIO_AGC
716 KSPROPERTY_AUDIO_ALGORITHM_INSTANCE
717 KSPROPERTY_AUDIO_BASS
718 KSPROPERTY_AUDIO_BASS_BOOST
719 KSPROPERTY_AUDIO_CHANNEL_CONFIG
720 KSPROPERTY_AUDIO_CHORUS_LEVEL
721 KSPROPERTY_AUDIO_COPY_PROTECTION
722 KSPROPERTY_AUDIO_CPU_RESOURCES
723 KSPROPERTY_AUDIO_DELAY
724 KSPROPERTY_AUDIO_DEMUX_DEST
725 KSPROPERTY_AUDIO_DEV_SPECIFIC
726 KSPROPERTY_AUDIO_DYNAMIC_RANGE
727 KSPROPERTY_AUDIO_DYNAMIC_SAMPLING_RATE
728 KSPROPERTY_AUDIO_EQ_BANDS
729 KSPROPERTY_AUDIO_EQ_LEVEL
730 KSPROPERTY_AUDIO_FILTER_STATE
731 KSPROPERTY_AUDIO_LATENCY
732 KSPROPERTY_AUDIO_LOUDNESS
733 KSPROPERTY_AUDIO_MANUFACTURE_GUID
734 KSPROPERTY_AUDIO_MID
735 KSPROPERTY_AUDIO_MIX_LEVEL_CAPS
736 KSPROPERTY_AUDIO_MIX_LEVEL_TABLE
737 KSPROPERTY_AUDIO_MUTE
738 KSPROPERTY_AUDIO_MUX_SOURCE
739 KSPROPERTY_AUDIO_NUM_EQ_BANDS
740 KSPROPERTY_AUDIO_PEAKMETER
741 KSPROPERTY_AUDIO_POSITION
742 KSPROPERTY_AUDIO_PREFERRED_STATUS
743 KSPROPERTY_AUDIO_PRODUCT_GUID
744 KSPROPERTY_AUDIO_QUALITY
745 KSPROPERTY_AUDIO_REVERB_LEVEL
746 KSPROPERTY_AUDIO_SAMPLING_RATE
747 KSPROPERTY_AUDIO_STEREO_ENHANCE
748 KSPROPERTY_AUDIO_STEREO_SPEAKER_GEOMETRY
749 KSPROPERTY_AUDIO_SURROUND_ENCODE
750 KSPROPERTY_AUDIO_TREBLE
751 KSPROPERTY_AUDIO_VOLUMELEVEL
752 KSPROPERTY_AUDIO_WIDE_MODE
753 KSPROPERTY_AUDIO_WIDENESS
754 */
755
756 #define KSPROPSETID_AudioGfx
757 /*
758 KSPROPERTY_AUDIOGFX_CAPTURETARGETDEVICEID
759 KSPROPERTY_AUDIOGFX_RENDERTARGETDEVICEID
760 */
761
762 #define KSPROPSETID_DirectSound3DBuffer
763 /*
764 KSPROPERTY_DIRECTSOUND3DBUFFER_ALL
765 KSPROPERTY_DIRECTSOUND3DBUFFER_CONEANGLES
766 KSPROPERTY_DIRECTSOUND3DBUFFER_CONEORIENTATION
767 KSPROPERTY_DIRECTSOUND3DBUFFER_CONEOUTSIDEVOLUME
768 KSPROPERTY_DIRECTSOUND3DBUFFER_MAXDISTANCE
769 KSPROPERTY_DIRECTSOUND3DBUFFER_MINDISTANCE
770 KSPROPERTY_DIRECTSOUND3DBUFFER_MODE
771 KSPROPERTY_DIRECTSOUND3DBUFFER_POSITION
772 KSPROPERTY_DIRECTSOUND3DBUFFER_VELOCITY
773 */
774
775 #define KSPROPSETID_DirectSound3DListener
776 /*
777 KSPROPERTY_DIRECTSOUND3DLISTENER_ALL
778 KSPROPERTY_DIRECTSOUND3DLISTENER_ALLOCATION
779 KSPROPERTY_DIRECTSOUND3DLISTENER_BATCH
780 KSPROPERTY_DIRECTSOUND3DLISTENER_DISTANCEFACTOR
781 KSPROPERTY_DIRECTSOUND3DLISTENER_DOPPLERFACTOR
782 KSPROPERTY_DIRECTSOUND3DLISTENER_ORIENTATION
783 KSPROPERTY_DIRECTSOUND3DLISTENER_POSITION
784 KSPROPERTY_DIRECTSOUND3DLISTENER_ROLLOFFFACTOR
785 KSPROPERTY_DIRECTSOUND3DLISTENER_VELOCITY
786 */
787
788 #define KSPROPSETID_DrmAudioStream
789 /*
790 KSPROPERTY_DRMAUDIOSTREAM_CONTENTID
791 */
792
793 #define KSPROPSETID_Hrtf3d
794 /*
795 KSPROPERTY_HRTF3D_FILTER_FORMAT
796 KSPROPERTY_HRTF3D_INITIALIZE
797 KSPROPERTY_HRTF3D_PARAMS
798 */
799
800 #define KSPROPSETID_Itd3d
801 /*
802 KSPROPERTY_ITD3D_PARAMS
803 */
804
805 #define KSPROPSETID_Synth
806 /*
807 KSPROPERTY_SYNTH_CAPS
808 KSPROPERTY_SYNTH_CHANNELGROUPS
809 KSPROPERTY_SYNTH_LATENCYCLOCK
810 KSPROPERTY_SYNTH_MASTERCLOCK
811 KSPROPERTY_SYNTH_PORTPARAMETERS
812 KSPROPERTY_SYNTH_RUNNINGSTATS
813 KSPROPERTY_SYNTH_VOICEPRIORITY
814 KSPROPERTY_SYNTH_VOLUME
815 KSPROPERTY_SYNTH_VOLUMEBOOST
816 */
817
818 #define KSPROPSETID_Synth_Dls
819 /*
820 KSPROPERTY_SYNTH_DLS_APPEND
821 KSPROPERTY_SYNTH_DLS_COMPACT
822 KSPROPERTY_SYNTH_DLS_DOWNLOAD
823 KSPROPERTY_SYNTH_DLS_UNLOAD
824 KSPROPERTY_SYNTH_DLS_WAVEFORMAT
825 */
826
827 #define KSPROPSETID_TopologyNode
828 /*
829 KSPROPERTY_TOPOLOGYNODE_ENABLE
830 KSPROPERTY_TOPOLOGYNODE_RESET
831 */
832
833
834
835
836 /* ===============================================================
837 Event Sets for audio drivers - TODO
838 */
839 #define KSEVENTSETID_AudioControlChange
840 /*
841 KSEVENT_CONTROL_CHANGE
842 */
843
844
845
846 /* ===============================================================
847 Node Types
848 */
849 /*
850 KSNODETYPE_3D_EFFECTS
851 KSNODETYPE_ACOUSTIC_ECHO_CANCEL
852 KSNODETYPE_ADC
853 KSNODETYPE_AGC
854 KSNODETYPE_CHORUS
855 KSNODETYPE_DAC
856 KSNODETYPE_DELAY
857 KSNODETYPE_DEMUX
858 KSNODETYPE_DEV_SPECIFIC
859 KSNODETYPE_DMSYNTH
860 KSNODETYPE_DMSYNTH_CAPS
861 KSNODETYPE_DRM_DESCRAMBLE
862 KSNODETYPE_EQUALIZER
863 KSNODETYPE_LOUDNESS
864 KSNODETYPE_MUTE
865 KSNODETYPE_MUX
866 KSNODETYPE_PEAKMETER
867 KSNODETYPE_PROLOGIC_DECODER
868 KSNODETYPE_PROLOGIC_ENCODER
869 KSNODETYPE_REVERB
870 KSNODETYPE_SRC
871 KSNODETYPE_STEREO_ENHANCE
872 KSNODETYPE_STEREO_WIDE
873 KSNODETYPE_SUM
874 KSNODETYPE_SUPERMIX
875 KSNODETYPE_SWMIDI
876 KSNODETYPE_SWSYNTH
877 KSNODETYPE_SYNTHESIZER
878 KSNODETYPE_TONE
879 KSNODETYPE_VOLUME
880 */
881
882
883 typedef PVOID KSDEVICE_HEADER,
884 KSOBJECT_HEADER,
885 KSOBJECT_BAG;
886
887
888
889
890 /* ===============================================================
891 Method Types
892 */
893
894 #define KSMETHOD_TYPE_NONE 0x00000000
895 #define KSMETHOD_TYPE_READ 0x00000001
896 #define KSMETHOD_TYPE_WRITE 0x00000002
897 #define KSMETHOD_TYPE_MODIFY 0x00000003
898 #define KSMETHOD_TYPE_SOURCE 0x00000004
899 #define KSMETHOD_TYPE_SEND 0x00000001
900 #define KSMETHOD_TYPE_SETSUPPORT 0x00000100
901 #define KSMETHOD_TYPE_BASICSUPPORT 0x00000200
902
903
904 /* ===============================================================
905 Property Types
906 */
907
908 #define KSPROPERTY_TYPE_GET 0x00000001
909 #define KSPROPERTY_TYPE_SET 0x00000002
910 #define KSPROPERTY_TYPE_SETSUPPORT 0x00000100
911 #define KSPROPERTY_TYPE_BASICSUPPORT 0x00000200
912 #define KSPROPERTY_TYPE_RELATIONS 0x00000400
913 #define KSPROPERTY_TYPE_SERIALIZESET 0x00000800
914 #define KSPROPERTY_TYPE_UNSERIALIZESET 0x00001000
915 #define KSPROPERTY_TYPE_SERIALIZERAW 0x00002000
916 #define KSPROPERTY_TYPE_UNSERIALIZERAW 0x00004000
917 #define KSPROPERTY_TYPE_SERIALIZESIZE 0x00008000
918 #define KSPROPERTY_TYPE_DEFAULT_VALUES 0x00010000
919
920
921 /* ===============================================================
922 Topology Methods/Properties
923 */
924
925 #define KSMETHOD_TYPE_TOPOLOGY 0x10000000
926 #define KSPROPERTY_TYPE_TOPOLOGY 0x10000000
927
928 /*
929 #define DEFINE_KS_GUID(GA,GB,GC,GD,GE,GF,GG,GH,GI,GJ,GK) \
930 DEFINE_GUID(??, 0x#GA#L, 0xGB, 0xGC, 0xGD, 0xGE, 0xGF, 0xGG, 0xGH, 0xGI, 0xGJ, 0xGK) \
931 "GA-GB-GC-GDGE-GFGGGHGIGJGK"
932 */
933
934 /* ===============================================================
935 KS Category GUIDs
936
937 BRIDGE - 0x085AFF00L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
938 CAPTURE - 0x65E8773DL, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
939 RENDER - 0x65E8773EL, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
940 MIXER - 0xAD809C00L, 0x7B88, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
941 SPLITTER - 0x0A4252A0L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
942 DATACOMPRESSOR - 0x1E84C900L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
943 DATADECOMPRESSOR - 0x2721AE20L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
944 DATATRANSFORM - 0x2EB07EA0L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
945 COMMUNICATIONSTRANSFORM - 0xCF1DDA2CL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
946 INTERFACETRANSFORM - 0xCF1DDA2DL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
947 MEDIUMTRANSFORM - 0xCF1DDA2EL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
948 FILESYSTEM - 0x760FED5EL, 0x9357, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
949 CLOCK - 0x53172480L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
950 PROXY - 0x97EBAACAL, 0x95BD, 0x11D0, 0xA3, 0xEA, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
951 QUALITY - 0x97EBAACBL, 0x95BD, 0x11D0, 0xA3, 0xEA, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
952 */
953
954 /* ===============================================================
955 KSNAME GUIDs (defined also as KSSTRING_Xxx L"{...}"
956
957 Filter - 0x9b365890L, 0x165f, 0x11d0, 0xa1, 0x95, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4
958 Pin - 0x146F1A80L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
959 Clock - 0x53172480L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
960 Allocator - 0x642F5D00L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
961 TopologyNode - 0x0621061AL, 0xEE75, 0x11D0, 0xB9, 0x15, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
962 */
963
964 /* ===============================================================
965 Interface GUIDs
966
967 Standard - 0x1A8766A0L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
968 FileIo - 0x8C6F932CL, 0xE771, 0x11D0, 0xB8, 0xFF, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
969 */
970
971 /* ===============================================================
972 Medium Type GUIDs
973
974 Standard - 0x4747B320L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
975 */
976
977 /* ===============================================================
978 Property Set GUIDs
979
980 General - 0x1464EDA5L, 0x6A8F, 0x11D1, 0x9A, 0xA7, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
981 StreamIo - 0x65D003CAL, 0x1523, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
982 MediaSeeking - 0xEE904F0CL, 0xD09B, 0x11D0, 0xAB, 0xE9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
983 Topology - 0x720D4AC0L, 0x7533, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
984 GM - 0xAF627536L, 0xE719, 0x11D2, 0x8A, 0x1D, 0x00, 0x60, 0x97, 0xD2, 0xDF, 0x5D
985 Quality - 0xD16AD380L, 0xAC1A, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
986 Connection - 0x1D58C920L, 0xAC9B, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
987 */
988
989 /* ===============================================================
990 StreamAllocator Sets
991
992 Event set - 0x75d95571L, 0x073c, 0x11d0, 0xa1, 0x61, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4
993 Method set - 0xcf6e4341L, 0xec87, 0x11cf, 0xa1, 0x30, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4
994 Property set - 0xcf6e4342L, 0xec87, 0x11cf, 0xa1, 0x30, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4
995 */
996
997 /* ===============================================================
998 StreamInterface Sets
999
1000 Property set - 0x1fdd8ee1L, 0x9cd3, 0x11d0, 0x82, 0xaa, 0x00, 0x00, 0xf8, 0x22, 0xfe, 0x8a
1001 */
1002
1003 /* ===============================================================
1004 Clock Sets
1005
1006 Property set - 0xDF12A4C0L, 0xAC17, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1007 Event sets - 0x364D8E20L, 0x62C7, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1008 */
1009
1010 /* ===============================================================
1011 Connection Sets
1012
1013 Event set - 0x7f4bcbe0L, 0x9ea5, 0x11cf, 0xa5, 0xd6, 0x28, 0xdb, 0x04, 0xc1, 0x00, 0x00
1014 */
1015
1016 /* ===============================================================
1017 Time Format GUIDs
1018
1019 KSTIME_FORMAT_NONE (null guid)
1020 FRAME - 0x7b785570L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6
1021 BYTE - 0x7b785571L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6
1022 SAMPLE - 0x7b785572L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6
1023 FIELD - 0x7b785573L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6
1024 MEDIA_TIME - 0x7b785574L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6
1025 */
1026
1027 /* ===============================================================
1028 Media Type GUIDs
1029
1030 NULL
1031 Stream -
1032 None -
1033
1034 TODO ...
1035 */
1036
1037 #define STATIC_KSDATAFORMAT_SPECIFIER_NONE\
1038 0x0F6417D6L, 0xC318, 0x11D0, 0xA4, 0x3F, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
1039 DEFINE_GUIDSTRUCT("0F6417D6-C318-11D0-A43F-00A0C9223196", KSDATAFORMAT_SPECIFIER_NONE);
1040 #define KSDATAFORMAT_SPECIFIER_NONE DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_NONE)
1041
1042
1043 /* ===============================================================
1044 KSMEMORY_TYPE_xxx
1045
1046 WILDCARD, DONT_CARE = NULL
1047 SYSTEM - 0x091bb638L, 0x603f, 0x11d1, 0xb0, 0x67, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02
1048 USER - 0x8cb0fc28L, 0x7893, 0x11d1, 0xb0, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02
1049 KERNEL_PAGED - 0xd833f8f8L, 0x7894, 0x11d1, 0xb0, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02
1050 KERNEL_NONPAGED - 0x4a6d5fc4L, 0x7895, 0x11d1, 0xb0, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02
1051 DEVICE_UNKNOWN - 0x091bb639L, 0x603f, 0x11d1, 0xb0, 0x67, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02
1052 */
1053
1054 /* ===============================================================
1055 Enums
1056 (values have been checked)
1057 */
1058
1059 #ifndef _MSC_VER
1060
1061 #define DEFINE_KSPROPERTY_ITEM(PropertyId, GetHandler,\
1062 MinProperty,\
1063 MinData,\
1064 SetHandler,\
1065 Values, RelationsCount, Relations, SupportHandler,\
1066 SerializedSize)\
1067 {\
1068 PropertyId, {(PFNKSHANDLER)GetHandler}, MinProperty, MinData,\
1069 {(PFNKSHANDLER)SetHandler},\
1070 (PKSPROPERTY_VALUES)Values, RelationsCount, (PKSPROPERTY)Relations,\
1071 (PFNKSHANDLER)SupportHandler, (ULONG)SerializedSize\
1072 }
1073
1074 #else
1075
1076 #define DEFINE_KSPROPERTY_ITEM(PropertyId, GetHandler,\
1077 MinProperty,\
1078 MinData,\
1079 SetHandler,\
1080 Values, RelationsCount, Relations, SupportHandler,\
1081 SerializedSize)\
1082 {\
1083 PropertyId, (PFNKSHANDLER)GetHandler, MinProperty, MinData,\
1084 (PFNKSHANDLER)SetHandler,\
1085 (PKSPROPERTY_VALUES)Values, RelationsCount, (PKSPROPERTY)Relations,\
1086 (PFNKSHANDLER)SupportHandler, (ULONG)SerializedSize\
1087 }
1088
1089 #endif
1090
1091
1092 typedef enum
1093 {
1094 KsObjectTypeDevice,
1095 KsObjectTypeFilterFactory,
1096 KsObjectTypeFilter,
1097 KsObjectTypePin
1098 } KSOBJECTTYPE;
1099
1100 typedef enum
1101 {
1102 KSSTATE_STOP,
1103 KSSTATE_ACQUIRE,
1104 KSSTATE_PAUSE,
1105 KSSTATE_RUN
1106 } KSSTATE, *PKSSTATE;
1107
1108 typedef enum
1109 {
1110 KSTARGET_STATE_DISABLED,
1111 KSTARGET_STATE_ENABLED
1112 } KSTARGET_STATE;
1113
1114 typedef enum
1115 {
1116 KSRESET_BEGIN,
1117 KSRESET_END
1118 } KSRESET;
1119
1120 typedef enum
1121 {
1122 KSEVENTS_NONE,
1123 KSEVENTS_SPINLOCK,
1124 KSEVENTS_MUTEX,
1125 KSEVENTS_FMUTEX,
1126 KSEVENTS_FMUTEXUNSAFE,
1127 KSEVENTS_INTERRUPT,
1128 KSEVENTS_ERESOURCE
1129 } KSEVENTS_LOCKTYPE;
1130
1131 typedef enum
1132 {
1133 KSDEGRADE_STANDARD_SIMPLE,
1134 KSDEGRADE_STANDARD_QUALITY,
1135 KSDEGRADE_STANDARD_COMPUTATION,
1136 KSDEGRADE_STANDARD_SKIP
1137 } KSDEGRADE_STANDARD;
1138
1139 typedef enum
1140 {
1141 KSPIN_DATAFLOW_IN = 1,
1142 KSPIN_DATAFLOW_OUT
1143 } KSPIN_DATAFLOW;
1144
1145 typedef enum
1146 {
1147 KSPIN_COMMUNICATION_NONE,
1148 KSPIN_COMMUNICATION_SINK,
1149 KSPIN_COMMUNICATION_SOURCE,
1150 KSPIN_COMMUNICATION_BOTH,
1151 KSPIN_COMMUNICATION_BRIDGE
1152 } KSPIN_COMMUNICATION;
1153
1154 typedef enum
1155 {
1156 KsListEntryTail,
1157 KsListEntryHead
1158 } KSLIST_ENTRY_LOCATION;
1159
1160 typedef enum
1161 {
1162 KsStackCopyToNewLocation,
1163 KsStackReuseCurrentLocation,
1164 KsStackUseNewLocation
1165 } KSSTACK_USE;
1166
1167 typedef enum
1168 {
1169 KsAcquireOnly,
1170 KsAcquireAndRemove,
1171 KsAcquireOnlySingleItem,
1172 KsAcquireAndRemoveOnlySingleItem
1173 } KSIRP_REMOVAL_OPERATION;
1174
1175 typedef enum
1176 {
1177 KsInvokeOnSuccess = 1,
1178 KsInvokeOnError = 2,
1179 KsInvokeOnCancel = 4
1180 } KSCOMPLETION_INVOCATION;
1181
1182
1183 #if defined(_NTDDK_)
1184 /* MOVE ME */
1185 typedef NTSTATUS (NTAPI *PFNKSCONTEXT_DISPATCH)(
1186 IN PVOID Context,
1187 IN PIRP Irp);
1188 #endif
1189
1190 #if defined(_NTDDK_) && !defined(__wtypes_h__)
1191 enum VARENUM {
1192 VT_EMPTY = 0,
1193 VT_NULL = 1,
1194 VT_I2 = 2,
1195 VT_I4 = 3,
1196 VT_R4 = 4,
1197 VT_R8 = 5,
1198 VT_CY = 6,
1199 VT_DATE = 7,
1200 VT_BSTR = 8,
1201 VT_DISPATCH = 9,
1202 VT_ERROR = 10,
1203 VT_BOOL = 11,
1204 VT_VARIANT = 12,
1205 VT_UNKNOWN = 13,
1206 VT_DECIMAL = 14,
1207 VT_I1 = 16,
1208 VT_UI1 = 17,
1209 VT_UI2 = 18,
1210 VT_UI4 = 19,
1211 VT_I8 = 20,
1212 VT_UI8 = 21,
1213 VT_INT = 22,
1214 VT_UINT = 23,
1215 VT_VOID = 24,
1216 VT_HRESULT = 25,
1217 VT_PTR = 26,
1218 VT_SAFEARRAY = 27,
1219 VT_CARRAY = 28,
1220 VT_USERDEFINED = 29,
1221 VT_LPSTR = 30,
1222 VT_LPWSTR = 31,
1223 VT_FILETIME = 64,
1224 VT_BLOB = 65,
1225 VT_STREAM = 66,
1226 VT_STORAGE = 67,
1227 VT_STREAMED_OBJECT = 68,
1228 VT_STORED_OBJECT = 69,
1229 VT_BLOB_OBJECT = 70,
1230 VT_CF = 71,
1231 VT_CLSID = 72,
1232 VT_VECTOR = 0x1000,
1233 VT_ARRAY = 0x2000,
1234 VT_BYREF = 0x4000,
1235 VT_RESERVED = 0x8000,
1236 VT_ILLEGAL = 0xffff,
1237 VT_ILLEGALMASKED = 0xfff,
1238 VT_TYPEMASK = 0xfff
1239 };
1240 #endif
1241
1242 #define STATIC_KSDATAFORMAT_TYPE_WILDCARD STATIC_GUID_NULL
1243 #define KSDATAFORMAT_TYPE_WILDCARD GUID_NULL
1244
1245 #define STATIC_KSDATAFORMAT_SUBTYPE_WILDCARD STATIC_GUID_NULL
1246 #define KSDATAFORMAT_SUBTYPE_WILDCARD GUID_NULL
1247
1248 #define STATIC_KSDATAFORMAT_SPECIFIER_WILDCARD STATIC_GUID_NULL
1249 #define KSDATAFORMAT_SPECIFIER_WILDCARD GUID_NULL
1250
1251 /* ===============================================================
1252 Framing
1253 */
1254
1255 typedef struct
1256 {
1257 ULONG MinFrameSize;
1258 ULONG MaxFrameSize;
1259 ULONG Stepping;
1260 } KS_FRAMING_RANGE, *PKS_FRAMING_RANGE;
1261
1262 typedef struct
1263 {
1264 KS_FRAMING_RANGE Range;
1265 ULONG InPlaceWeight;
1266 ULONG NotInPlaceWeight;
1267 } KS_FRAMING_RANGE_WEIGHTED, *PKS_FRAMING_RANGE_WEIGHTED;
1268
1269 typedef struct
1270 {
1271 GUID MemoryType;
1272 GUID BusType;
1273 ULONG MemoryFlags;
1274 ULONG BusFlags;
1275 ULONG Flags;
1276 ULONG Frames;
1277 ULONG FileAlignment;
1278 ULONG MemoryTypeWeight;
1279 KS_FRAMING_RANGE PhysicalRange;
1280 KS_FRAMING_RANGE_WEIGHTED FramingRange;
1281 } KS_FRAMING_ITEM, *PKS_FRAMING_ITEM;
1282
1283 typedef struct
1284 {
1285 ULONG RatioNumerator;
1286 ULONG RatioDenominator;
1287 ULONG RatioConstantMargin;
1288 } KS_COMPRESSION, *PKS_COMPRESSION;
1289
1290
1291 /* ===============================================================
1292 Priorities
1293 */
1294
1295 #define KSPRIORITY_LOW 0x00000001
1296 #define KSPRIORITY_NORMAL 0x40000000
1297 #define KSPRIORITY_HIGH 0x80000000
1298 #define KSPRIORITY_EXCLUSIVE 0xFFFFFFFF
1299
1300 typedef struct
1301 {
1302 ULONG PriorityClass;
1303 ULONG PrioritySubClass;
1304 } KSPRIORITY, *PKSPRIORITY;
1305
1306
1307 /* ===============================================================
1308 Dispatch Table
1309 http://www.osronline.com/DDKx/stream/ks-struct_494j.htm
1310 */
1311 #if defined(_NTDDK_)
1312 typedef struct
1313 {
1314 PDRIVER_DISPATCH DeviceIoControl;
1315 PDRIVER_DISPATCH Read;
1316 PDRIVER_DISPATCH Write;
1317 PDRIVER_DISPATCH Flush;
1318 PDRIVER_DISPATCH Close;
1319 PDRIVER_DISPATCH QuerySecurity;
1320 PDRIVER_DISPATCH SetSecurity;
1321 PFAST_IO_DEVICE_CONTROL FastDeviceIoControl;
1322 PFAST_IO_READ FastRead;
1323 PFAST_IO_WRITE FastWrite;
1324 } KSDISPATCH_TABLE, *PKSDISPATCH_TABLE;
1325
1326
1327 #define KSCREATE_ITEM_IRP_STORAGE(Irp) (*(PKSOBJECT_CREATE_ITEM*)&(Irp)->Tail.Overlay.DriverContext[0])
1328 #define KSEVENT_SET_IRP_STORAGE(Irp) (*(const KSEVENT_SET**)&(Irp)->Tail.Overlay.DriverContext[0])
1329 #define KSEVENT_ITEM_IRP_STORAGE(Irp) (*(const KSEVENT_ITEM**)&(Irp)->Tail.Overlay.DriverContext[3])
1330 #define KSEVENT_ENTRY_IRP_STORAGE(Irp) (*(PKSEVENT_ENTRY*)&(Irp)->Tail.Overlay.DriverContext[0])
1331 #define KSMETHOD_SET_IRP_STORAGE(Irp) (*(const KSMETHOD_SET**)&(Irp)->Tail.Overlay.DriverContext[0])
1332 #define KSMETHOD_ITEM_IRP_STORAGE(Irp) (*(const KSMETHOD_ITEM**)&(Irp)->Tail.Overlay.DriverContext[3])
1333 #define KSMETHOD_TYPE_IRP_STORAGE(Irp) (*(ULONG_PTR*)(&(Irp)->Tail.Overlay.DriverContext[2]))
1334 #define KSQUEUE_SPINLOCK_IRP_STORAGE(Irp) (*(PKSPIN_LOCK*)&(Irp)->Tail.Overlay.DriverContext[1])
1335 #define KSPROPERTY_SET_IRP_STORAGE(Irp) (*(const KSPROPERTY_SET**)&(Irp)->Tail.Overlay.DriverContext[0])
1336 #define KSPROPERTY_ITEM_IRP_STORAGE(Irp) (*(const KSPROPERTY_ITEM**)&(Irp)->Tail.Overlay.DriverContext[3])
1337 #define KSPROPERTY_ATTRIBUTES_IRP_STORAGE(Irp) (*(PKSATTRIBUTE_LIST*)&(Irp)->Tail.Overlay.DriverContext[2])
1338
1339 typedef
1340 VOID
1341 (NTAPI *PFNREFERENCEDEVICEOBJECT)(
1342 IN PVOID Context
1343 );
1344
1345 typedef
1346 VOID
1347 (NTAPI *PFNDEREFERENCEDEVICEOBJECT)(
1348 IN PVOID Context
1349 );
1350
1351 typedef
1352 NTSTATUS
1353 (NTAPI *PFNQUERYREFERENCESTRING)(
1354 IN PVOID Context,
1355 IN OUT PWCHAR *String
1356 );
1357
1358 typedef struct
1359 {
1360 INTERFACE Interface;
1361 PFNREFERENCEDEVICEOBJECT ReferenceDeviceObject;
1362 PFNDEREFERENCEDEVICEOBJECT DereferenceDeviceObject;
1363 PFNQUERYREFERENCESTRING QueryReferenceString;
1364 } BUS_INTERFACE_REFERENCE, *PBUS_INTERFACE_REFERENCE;
1365
1366 typedef struct
1367 {
1368 KDPC Dpc;
1369 ULONG ReferenceCount;
1370 KSPIN_LOCK AccessLock;
1371 } KSDPC_ITEM, *PKSDPC_ITEM;
1372
1373 typedef struct
1374 {
1375 KSDPC_ITEM DpcItem;
1376 LIST_ENTRY BufferList;
1377 } KSBUFFER_ITEM, *PKSBUFFER_ITEM;
1378
1379 #endif
1380
1381 typedef struct
1382 {
1383 GUID Manufacturer;
1384 GUID Product;
1385 GUID Component;
1386 GUID Name;
1387 ULONG Version;
1388 ULONG Revision;
1389 } KSCOMPONENTID, *PKSCOMPONENTID;
1390
1391 /* ===============================================================
1392 Properties
1393 */
1394
1395 #define KSPROPERTY_MEMBER_RANGES 0x00000001
1396 #define KSPROPERTY_MEMBER_STEPPEDRANGES 0x00000002
1397 #define KSPROPERTY_MEMBER_VALUES 0x00000003
1398 #define KSPROPERTY_MEMBER_FLAG_DEFAULT KSPROPERTY_MEMBER_RANGES
1399
1400 typedef enum {
1401 KS_SEEKING_NoPositioning,
1402 KS_SEEKING_AbsolutePositioning,
1403 KS_SEEKING_RelativePositioning,
1404 KS_SEEKING_IncrementalPositioning,
1405 KS_SEEKING_PositioningBitsMask = 0x3,
1406 KS_SEEKING_SeekToKeyFrame,
1407 KS_SEEKING_ReturnTime = 0x8
1408 } KS_SEEKING_FLAGS;
1409
1410 typedef struct
1411 {
1412 LONGLONG Current;
1413 LONGLONG Stop;
1414 KS_SEEKING_FLAGS CurrentFlags;
1415 KS_SEEKING_FLAGS StopFlags;
1416 } KSPROPERTY_POSITIONS, *PKSPROPERTY_POSITIONS;
1417
1418 typedef struct
1419 {
1420 GUID PropertySet;
1421 ULONG Count;
1422 } KSPROPERTY_SERIALHDR, *PKSPROPERTY_SERIALHDR;
1423
1424 typedef struct
1425 {
1426 KSIDENTIFIER PropTypeSet;
1427 ULONG Id;
1428 ULONG PropertyLength;
1429 } KSPROPERTY_SERIAL, *PKSPROPERTY_SERIAL;
1430
1431
1432 typedef union
1433 {
1434 struct {
1435 LONG SignedMinimum;
1436 LONG SignedMaximum;
1437
1438 #if defined( _KS_NO_ANONYMOUS_STRUCTURES_ )
1439 }_SIGNED;
1440 #else
1441 };
1442 #endif
1443
1444 struct {
1445 ULONG UnsignedMinimum;
1446 ULONG UnsignedMaximum;
1447 #if defined( _KS_NO_ANONYMOUS_STRUCTURES_ )
1448 }_UNSIGNED;
1449 #else
1450 };
1451 #endif
1452
1453 } KSPROPERTY_BOUNDS_LONG, *PKSPROPERTY_BOUNDS_LONG;
1454
1455 typedef union
1456 {
1457 struct {
1458 LONGLONG SignedMinimum;
1459 LONGLONG SignedMaximum;
1460 #if defined( _KS_NO_ANONYMOUS_STRUCTURES_ )
1461 }_SIGNED64;
1462 #else
1463 };
1464 #endif
1465
1466 struct {
1467 #if defined(_NTDDK_)
1468 ULONGLONG UnsignedMinimum;
1469 ULONGLONG UnsignedMaximum;
1470 #else
1471 DWORDLONG UnsignedMinimum;
1472 DWORDLONG UnsignedMaximum;
1473 #endif
1474 #if defined( _KS_NO_ANONYMOUS_STRUCTURES_ )
1475 }_UNSIGNED64;
1476 #else
1477 };
1478 #endif
1479 } KSPROPERTY_BOUNDS_LONGLONG, *PKSPROPERTY_BOUNDS_LONGLONG;
1480
1481 typedef struct
1482 {
1483 ULONG AccessFlags;
1484 ULONG DescriptionSize;
1485 KSIDENTIFIER PropTypeSet;
1486 ULONG MembersListCount;
1487 ULONG Reserved;
1488 } KSPROPERTY_DESCRIPTION, *PKSPROPERTY_DESCRIPTION;
1489
1490 typedef struct
1491 {
1492 LONGLONG Earliest;
1493 LONGLONG Latest;
1494 } KSPROPERTY_MEDIAAVAILABLE, *PKSPROPERTY_MEDIAAVAILABLE;
1495
1496
1497 typedef struct
1498 {
1499 ULONG MembersFlags;
1500 ULONG MembersSize;
1501 ULONG MembersCount;
1502 ULONG Flags;
1503 } KSPROPERTY_MEMBERSHEADER, *PKSPROPERTY_MEMBERSHEADER;
1504
1505 typedef struct {
1506 KSPROPERTY_MEMBERSHEADER MembersHeader;
1507 const VOID* Members;
1508 } KSPROPERTY_MEMBERSLIST, *PKSPROPERTY_MEMBERSLIST;
1509
1510 typedef struct {
1511 KSIDENTIFIER PropTypeSet;
1512 ULONG MembersListCount;
1513 const KSPROPERTY_MEMBERSLIST* MembersList;
1514 } KSPROPERTY_VALUES, *PKSPROPERTY_VALUES;
1515
1516 #if defined(_NTDDK_)
1517 typedef NTSTATUS (NTAPI *PFNKSHANDLER)(
1518 IN PIRP Irp,
1519 IN PKSIDENTIFIER Request,
1520 IN OUT PVOID Data);
1521
1522 typedef struct
1523 {
1524 ULONG PropertyId;
1525 union
1526 {
1527 PFNKSHANDLER GetPropertyHandler;
1528 BOOLEAN GetSupported;
1529 };
1530 ULONG MinProperty;
1531 ULONG MinData;
1532 union {
1533 PFNKSHANDLER SetPropertyHandler;
1534 BOOLEAN SetSupported;
1535 };
1536 const KSPROPERTY_VALUES * Values;
1537 ULONG RelationsCount;
1538 const KSPROPERTY * Relations;
1539 PFNKSHANDLER SupportHandler;
1540 ULONG SerializedSize;
1541 } KSPROPERTY_ITEM, *PKSPROPERTY_ITEM;
1542
1543
1544 typedef
1545 BOOLEAN
1546 (NTAPI *PFNKSFASTHANDLER)(
1547 IN PFILE_OBJECT FileObject,
1548 IN PKSIDENTIFIER Request,
1549 IN ULONG RequestLength,
1550 IN OUT PVOID Data,
1551 IN ULONG DataLength,
1552 OUT PIO_STATUS_BLOCK IoStatus
1553 );
1554
1555 typedef struct {
1556 ULONG PropertyId;
1557 union {
1558 PFNKSFASTHANDLER GetPropertyHandler;
1559 BOOLEAN GetSupported;
1560 };
1561 union {
1562 PFNKSFASTHANDLER SetPropertyHandler;
1563 BOOLEAN SetSupported;
1564 };
1565 ULONG Reserved;
1566 } KSFASTPROPERTY_ITEM, *PKSFASTPROPERTY_ITEM;
1567
1568 typedef struct
1569 {
1570 const GUID* Set;
1571 ULONG PropertiesCount;
1572 const KSPROPERTY_ITEM * PropertyItem;
1573 ULONG FastIoCount;
1574 const KSFASTPROPERTY_ITEM* FastIoTable;
1575 } KSPROPERTY_SET, *PKSPROPERTY_SET;
1576
1577 #endif
1578
1579 typedef struct
1580 {
1581 ULONG SteppingDelta;
1582 ULONG Reserved;
1583 KSPROPERTY_BOUNDS_LONG Bounds;
1584 } KSPROPERTY_STEPPING_LONG, *PKSPROPERTY_STEPPING_LONG;
1585
1586 typedef struct
1587 {
1588 #if defined(_NTDDK_)
1589 ULONGLONG SteppingDelta;
1590 #else
1591 DWORDLONG SteppingDelta;
1592 #endif
1593 KSPROPERTY_BOUNDS_LONGLONG Bounds;
1594 } KSPROPERTY_STEPPING_LONGLONG, *PKSPROPERTY_STEPPING_LONGLONG;
1595
1596 /* ===============================================================
1597 Allocator Framing
1598 */
1599
1600 typedef struct
1601 {
1602 union {
1603 ULONG OptionsFlags;
1604 ULONG RequirementsFlags;
1605 };
1606 #if defined(_NTDDK_)
1607 POOL_TYPE PoolType;
1608 #else
1609 ULONG PoolType;
1610 #endif
1611 ULONG Frames;
1612 ULONG FrameSize;
1613 ULONG FileAlignment;
1614 ULONG Reserved;
1615 } KSALLOCATOR_FRAMING, *PKSALLOCATOR_FRAMING;
1616
1617 typedef struct
1618 {
1619 ULONG CountItems;
1620 ULONG PinFlags;
1621 KS_COMPRESSION OutputCompression;
1622 ULONG PinWeight;
1623 KS_FRAMING_ITEM FramingItem[1];
1624 } KSALLOCATOR_FRAMING_EX, *PKSALLOCATOR_FRAMING_EX;
1625
1626 #define KSALLOCATOR_REQUIREMENTF_INPLACE_MODIFIER 0x00000001
1627 #define KSALLOCATOR_REQUIREMENTF_SYSTEM_MEMORY 0x00000002
1628 #define KSALLOCATOR_REQUIREMENTF_FRAME_INTEGRITY 0x00000004
1629 #define KSALLOCATOR_REQUIREMENTF_MUST_ALLOCATE 0x00000008
1630 #define KSALLOCATOR_REQUIREMENTF_PREFERENCES_ONLY 0x80000000
1631
1632 #define KSALLOCATOR_OPTIONF_COMPATIBLE 0x00000001
1633 #define KSALLOCATOR_OPTIONF_SYSTEM_MEMORY 0x00000002
1634 #define KSALLOCATOR_OPTIONF_VALID 0x00000003
1635
1636 #define KSALLOCATOR_FLAG_PARTIAL_READ_SUPPORT 0x00000010
1637 #define KSALLOCATOR_FLAG_DEVICE_SPECIFIC 0x00000020
1638 #define KSALLOCATOR_FLAG_CAN_ALLOCATE 0x00000040
1639 #define KSALLOCATOR_FLAG_INSIST_ON_FRAMESIZE_RATIO 0x00000080
1640
1641 /* ===============================================================
1642 Quality
1643 */
1644
1645 typedef struct
1646 {
1647 PVOID Context;
1648 ULONG Proportion;
1649 LONGLONG DeltaTime;
1650 } KSQUALITY, *PKSQUALITY;
1651
1652 typedef struct
1653 {
1654 HANDLE QualityManager;
1655 PVOID Context;
1656 } KSQUALITY_MANAGER, *PKSQUALITY_MANAGER;
1657
1658 typedef struct
1659 {
1660 LONGLONG PresentationStart;
1661 LONGLONG Duration;
1662 KSPIN_INTERFACE Interface;
1663 LONG Rate;
1664 ULONG Flags;
1665 } KSRATE, *PKSRATE;
1666
1667 typedef struct
1668 {
1669 KSPROPERTY Property;
1670 KSRATE Rate;
1671 } KSRATE_CAPABILITY, *PKSRATE_CAPABILITY;
1672
1673 typedef struct
1674 {
1675 LONGLONG Granularity;
1676 LONGLONG Error;
1677 } KSRESOLUTION, *PKSRESOLUTION;
1678
1679 typedef struct
1680 {
1681 ULONG NotificationType;
1682 union {
1683 struct {
1684 HANDLE Event;
1685 ULONG_PTR Reserved[2];
1686 } EventHandle;
1687 struct {
1688 HANDLE Semaphore;
1689 ULONG Reserved;
1690 LONG Adjustment;
1691 } SemaphoreHandle;
1692 #if defined(_NTDDK_)
1693 struct {
1694 PVOID Event;
1695 KPRIORITY Increment;
1696 ULONG_PTR Reserved;
1697 } EventObject;
1698 struct {
1699 PVOID Semaphore;
1700 KPRIORITY Increment;
1701 LONG Adjustment;
1702 } SemaphoreObject;
1703 struct {
1704 PKDPC Dpc;
1705 ULONG ReferenceCount;
1706 ULONG_PTR Reserved;
1707 } Dpc;
1708 struct {
1709 PWORK_QUEUE_ITEM WorkQueueItem;
1710 WORK_QUEUE_TYPE WorkQueueType;
1711 ULONG_PTR Reserved;
1712 } WorkItem;
1713 struct {
1714 PWORK_QUEUE_ITEM WorkQueueItem;
1715 PKSWORKER KsWorkerObject;
1716 ULONG_PTR Reserved;
1717 } KsWorkItem;
1718 #endif
1719 struct {
1720 PVOID Unused;
1721 LONG_PTR Alignment[2];
1722 } Alignment;
1723 };
1724 } KSEVENTDATA, *PKSEVENTDATA;
1725
1726 typedef struct
1727 {
1728 ULONG Size;
1729 ULONG Flags;
1730 union {
1731 HANDLE ObjectHandle;
1732 PVOID ObjectPointer;
1733 };
1734 PVOID Reserved;
1735 KSEVENT Event;
1736 KSEVENTDATA EventData;
1737 } KSRELATIVEEVENT, *PKSRELATIVEEVENT;
1738
1739
1740 /* ===============================================================
1741 Timing
1742 */
1743
1744 typedef struct
1745 {
1746 LONGLONG Time;
1747 ULONG Numerator;
1748 ULONG Denominator;
1749 } KSTIME, *PKSTIME;
1750
1751 typedef struct
1752 {
1753 LONGLONG Time;
1754 LONGLONG SystemTime;
1755 } KSCORRELATED_TIME, *PKSCORRELATED_TIME;
1756
1757 typedef struct
1758 {
1759 KSPROPERTY Property;
1760 GUID SourceFormat;
1761 GUID TargetFormat;
1762 LONGLONG Time;
1763 } KSP_TIMEFORMAT, *PKSP_TIMEFORMAT;
1764
1765 typedef struct
1766 {
1767 LONGLONG TimeBase;
1768 LONGLONG Interval;
1769 } KSINTERVAL, *PKSINTERVAL;
1770
1771 typedef struct
1772 {
1773 LONGLONG Duration;
1774 ULONG FrameFlags;
1775 ULONG Reserved;
1776 } KSFRAMETIME, *PKSFRAMETIME;
1777
1778
1779 /* ===============================================================
1780 Clocks
1781 */
1782
1783 typedef PVOID PKSDEFAULTCLOCK;
1784
1785 typedef struct
1786 {
1787 ULONG CreateFlags;
1788 } KSCLOCK_CREATE, *PKSCLOCK_CREATE;
1789
1790 #if defined(_NTDDK_)
1791
1792 typedef
1793 LONGLONG
1794 (FASTCALL *PFNKSCLOCK_GETTIME)(
1795 IN PFILE_OBJECT FileObject
1796 );
1797 typedef
1798 LONGLONG
1799 (FASTCALL *PFNKSCLOCK_CORRELATEDTIME)(
1800 IN PFILE_OBJECT FileObject,
1801 OUT PLONGLONG SystemTime);
1802
1803 typedef struct
1804 {
1805 PFNKSCLOCK_GETTIME GetTime;
1806 PFNKSCLOCK_GETTIME GetPhysicalTime;
1807 PFNKSCLOCK_CORRELATEDTIME GetCorrelatedTime;
1808 PFNKSCLOCK_CORRELATEDTIME GetCorrelatedPhysicalTime;
1809 } KSCLOCK_FUNCTIONTABLE, *PKSCLOCK_FUNCTIONTABLE;
1810
1811
1812 /* ===============================================================
1813 Objects ??? SORT ME!
1814 */
1815
1816 #define KSCREATE_ITEM_SECURITYCHANGED 0x1
1817 #define KSCREATE_ITEM_WILDCARD 0x2
1818 #define KSCREATE_ITEM_NOPARAMETERS 0x4
1819 #define KSCREATE_ITEM_FREEONSTOP 0x8
1820
1821 typedef struct
1822 {
1823 PDRIVER_DISPATCH Create;
1824 PVOID Context;
1825 UNICODE_STRING ObjectClass;
1826 PSECURITY_DESCRIPTOR SecurityDescriptor;
1827 ULONG Flags;
1828 } KSOBJECT_CREATE_ITEM, *PKSOBJECT_CREATE_ITEM;
1829
1830 typedef struct
1831 {
1832 ULONG CreateItemsCount;
1833 PKSOBJECT_CREATE_ITEM CreateItemsList;
1834 } KSOBJECT_CREATE, *PKSOBJECT_CREATE;
1835
1836 typedef VOID (NTAPI *PFNKSITEMFREECALLBACK)(
1837 IN PKSOBJECT_CREATE_ITEM CreateItem);
1838
1839 #endif
1840
1841 typedef struct
1842 {
1843 ULONG Size;
1844 ULONG Count;
1845 } KSMULTIPLE_ITEM, *PKSMULTIPLE_ITEM;
1846
1847 typedef struct
1848 {
1849 KSEVENT Event;
1850 PKSEVENTDATA EventData;
1851 PVOID Reserved;
1852 } KSQUERYBUFFER, *PKSQUERYBUFFER;
1853
1854 typedef struct
1855 {
1856 PVOID Context;
1857 ULONG Status;
1858 } KSERROR, *PKSERROR;
1859
1860 /* ===============================================================
1861 Methods
1862 */
1863 #if defined(_NTDDK_)
1864
1865 typedef struct
1866 {
1867 ULONG MethodId;
1868 union {
1869 PFNKSHANDLER MethodHandler;
1870 BOOLEAN MethodSupported;
1871 };
1872 ULONG MinMethod;
1873 ULONG MinData;
1874 PFNKSHANDLER SupportHandler;
1875 ULONG Flags;
1876 } KSMETHOD_ITEM, *PKSMETHOD_ITEM;
1877
1878 #ifndef _MSC_VER
1879
1880 #define DEFINE_KSMETHOD_ITEM(MethodId, Flags,\
1881 MethodHandler,\
1882 MinMethod, MinData, SupportHandler)\
1883 {\
1884 MethodId, {(PFNKSHANDLER)MethodHandler}, MinMethod, MinData,\
1885 SupportHandler, Flags\
1886 }
1887
1888 #else
1889
1890 #define DEFINE_KSMETHOD_ITEM(MethodId, Flags,\
1891 MethodHandler,\
1892 MinMethod, MinData, SupportHandler)\
1893 {\
1894 MethodId, (PFNKSHANDLER)MethodHandler, MinMethod, MinData,\
1895 SupportHandler, Flags\
1896 }
1897
1898
1899
1900 #endif
1901
1902
1903 typedef struct
1904 {
1905 ULONG MethodId;
1906 union {
1907 PFNKSFASTHANDLER MethodHandler;
1908 BOOLEAN MethodSupported;
1909 };
1910 } KSFASTMETHOD_ITEM, *PKSFASTMETHOD_ITEM;
1911
1912 #define DEFINE_KSFASTMETHOD_ITEM(MethodId, MethodHandler)\
1913 {\
1914 MethodId, (PFNKSFASTHANDLER)MethodHandler\
1915 }
1916
1917
1918 typedef struct
1919 {
1920 const GUID* Set;
1921 ULONG MethodsCount;
1922 const KSMETHOD_ITEM* MethodItem;
1923 ULONG FastIoCount;
1924 const KSFASTMETHOD_ITEM*FastIoTable;
1925 } KSMETHOD_SET, *PKSMETHOD_SET;
1926
1927
1928 #define DEFINE_KSMETHOD_SET(Set,\
1929 MethodsCount,\
1930 MethodItem,\
1931 FastIoCount,\
1932 FastIoTable)\
1933 {\
1934 Set,\
1935 MethodsCount,\
1936 MethodItem,\
1937 FastIoCount,\
1938 FastIoTable\
1939 }
1940
1941 #endif
1942 /* ===============================================================
1943 Nodes
1944 */
1945
1946 typedef struct
1947 {
1948 KSPROPERTY Property;
1949 ULONG NodeId;
1950 ULONG Reserved;
1951 } KSP_NODE, *PKSP_NODE;
1952
1953 typedef struct
1954 {
1955 KSMETHOD Method;
1956 ULONG NodeID;
1957 ULONG Reserved;
1958 } KSM_NODE, *PKSM_NODE;
1959
1960 typedef struct
1961 {
1962 KSEVENT Event;
1963 ULONG NodeId;
1964 ULONG Reserved;
1965 } KSE_NODE, *PKSE_NODE;
1966
1967 typedef struct {
1968 ULONG CreateFlags;
1969 ULONG Node;
1970 } KSNODE_CREATE, *PKSNODE_CREATE;
1971
1972
1973 /* ===============================================================
1974 Events
1975 */
1976 typedef struct _KSEVENT_ENTRY KSEVENT_ENTRY, *PKSEVENT_ENTRY;
1977
1978 #if defined(_NTDDK_)
1979 typedef struct
1980 {
1981 KSEVENTDATA EventData;
1982 LONGLONG MarkTime;
1983 } KSEVENT_TIME_MARK, *PKSEVENT_TIME_MARK;
1984
1985 typedef struct
1986 {
1987 KSEVENTDATA EventData;
1988 LONGLONG TimeBase;
1989 LONGLONG Interval;
1990 } KSEVENT_TIME_INTERVAL, *PKSEVENT_TIME_INTERVAL;
1991
1992 typedef NTSTATUS (NTAPI *PFNKSADDEVENT)(
1993 IN PIRP Irp,
1994 IN PKSEVENTDATA EventData,
1995 IN struct _KSEVENT_ENTRY* EventEntry);
1996
1997 typedef
1998 VOID
1999 (NTAPI *PFNKSREMOVEEVENT)(
2000 IN PFILE_OBJECT FileObject,
2001 IN struct _KSEVENT_ENTRY* EventEntry
2002 );
2003
2004 typedef struct
2005 {
2006 ULONG EventId;
2007 ULONG DataInput;
2008 ULONG ExtraEntryData;
2009 PFNKSADDEVENT AddHandler;
2010 PFNKSREMOVEEVENT RemoveHandler;
2011 PFNKSHANDLER SupportHandler;
2012 } KSEVENT_ITEM, *PKSEVENT_ITEM;
2013
2014 typedef struct
2015 {
2016 const GUID* Set;
2017 ULONG EventsCount;
2018 const KSEVENT_ITEM* EventItem;
2019 } KSEVENT_SET, *PKSEVENT_SET;
2020
2021 struct _KSEVENT_ENTRY
2022 {
2023 LIST_ENTRY ListEntry;
2024 PVOID Object;
2025 union {
2026 PKSDPC_ITEM DpcItem;
2027 PKSBUFFER_ITEM BufferItem;
2028 };
2029 PKSEVENTDATA EventData;
2030 ULONG NotificationType;
2031 const KSEVENT_SET* EventSet;
2032 const KSEVENT_ITEM* EventItem;
2033 PFILE_OBJECT FileObject;
2034 ULONG SemaphoreAdjustment;
2035 ULONG Reserved;
2036 ULONG Flags;
2037 };
2038
2039 #endif
2040 /* ===============================================================
2041 Pins
2042 */
2043
2044 #if defined(_NTDDK_)
2045
2046 typedef struct _KSPIN KSPIN, *PKSPIN;
2047 typedef struct _KSSTREAM_POINTER KSSTREAM_POINTER, *PKSSTREAM_POINTER;
2048 typedef struct _KSSTREAM_POINTER_OFFSET KSSTREAM_POINTER_OFFSET, *PKSSTREAM_POINTER_OFFSET;
2049 typedef struct _KSMAPPING KSMAPPING, *PKSMAPPING;
2050 typedef struct _KSPROCESSPIN KSPROCESSPIN, *PKSPROCESSPIN;
2051
2052 #define IOCTL_KS_HANDSHAKE CTL_CODE(FILE_DEVICE_KS, 0x007, METHOD_NEITHER, FILE_ANY_ACCESS)
2053
2054 typedef struct {
2055 GUID ProtocolId;
2056 PVOID Argument1;
2057 PVOID Argument2;
2058 } KSHANDSHAKE, *PKSHANDSHAKE;
2059
2060 typedef
2061 NTSTATUS
2062 (NTAPI *PFNKSPINHANDSHAKE)(
2063 IN PKSPIN Pin,
2064 IN PKSHANDSHAKE In,
2065 IN PKSHANDSHAKE Out
2066 );
2067
2068 typedef
2069 void
2070 (NTAPI *PFNKSPINPOWER)(
2071 IN PKSPIN Pin,
2072 IN DEVICE_POWER_STATE State
2073 );
2074
2075 typedef
2076 void
2077 (NTAPI *PFNKSPINFRAMERETURN)(
2078 IN PKSPIN Pin,
2079 IN PVOID Data OPTIONAL,
2080 IN ULONG Size OPTIONAL,
2081 IN PMDL Mdl OPTIONAL,
2082 IN PVOID Context OPTIONAL,
2083 IN NTSTATUS Status
2084 );
2085
2086 typedef
2087 void
2088 (NTAPI *PFNKSPINIRPCOMPLETION)(
2089 IN PKSPIN Pin,
2090 IN PIRP Irp
2091 );
2092
2093 typedef
2094 NTSTATUS
2095 (NTAPI *PFNKSPINIRP)(
2096 IN PKSPIN Pin,
2097 IN PIRP Irp
2098 );
2099
2100 typedef
2101 NTSTATUS
2102 (NTAPI *PFNKSPIN)(
2103 IN PKSPIN Pin
2104 );
2105
2106 typedef
2107 void
2108 (NTAPI *PFNKSPINVOID)(
2109 IN PKSPIN Pin
2110 );
2111
2112 typedef
2113 void
2114 (NTAPI *PFNKSSTREAMPOINTER)(
2115 IN PKSSTREAM_POINTER StreamPointer
2116 );
2117
2118 typedef struct {
2119 ULONG Count;
2120 PKSATTRIBUTE* Attributes;
2121 } KSATTRIBUTE_LIST, *PKSATTRIBUTE_LIST;
2122
2123 typedef
2124 NTSTATUS
2125 (NTAPI *PFNKSPINSETDATAFORMAT)(
2126 IN PKSPIN Pin,
2127 IN PKSDATAFORMAT OldFormat OPTIONAL,
2128 IN PKSMULTIPLE_ITEM OldAttributeList OPTIONAL,
2129 IN const KSDATARANGE* DataRange,
2130 IN const KSATTRIBUTE_LIST* AttributeRange OPTIONAL
2131 );
2132
2133 typedef
2134 NTSTATUS
2135 (NTAPI *PFNKSPINSETDEVICESTATE)(
2136 IN PKSPIN Pin,
2137 IN KSSTATE ToState,
2138 IN KSSTATE FromState
2139 );
2140
2141 typedef struct _KSCLOCK_DISPATCH KSCLOCK_DISPATCH, *PKSCLOCK_DISPATCH;
2142 typedef struct _KSALLOCATOR_DISPATCH KSALLOCATOR_DISPATCH, *PKSALLOCATOR_DISPATCH;
2143
2144 typedef struct
2145 {
2146 PFNKSPINIRP Create;
2147 PFNKSPINIRP Close;
2148 PFNKSPIN Process;
2149 PFNKSPINVOID Reset;
2150 PFNKSPINSETDATAFORMAT SetDataFormat;
2151 PFNKSPINSETDEVICESTATE SetDeviceState;
2152 PFNKSPIN Connect;
2153 PFNKSPINVOID Disconnect;
2154 const KSCLOCK_DISPATCH* Clock;
2155 const KSALLOCATOR_DISPATCH* Allocator;
2156 } KSPIN_DISPATCH, *PKSPIN_DISPATCH;
2157
2158 typedef
2159 BOOLEAN
2160 (NTAPI *PFNKSPINSETTIMER)(
2161 IN PKSPIN Pin,
2162 IN PKTIMER Timer,
2163 IN LARGE_INTEGER DueTime,
2164 IN PKDPC Dpc
2165 );
2166
2167 typedef
2168 BOOLEAN
2169 (NTAPI *PFNKSPINCANCELTIMER)(
2170 IN PKSPIN Pin,
2171 IN PKTIMER Timer
2172 );
2173
2174 typedef
2175 LONGLONG
2176 (FASTCALL *PFNKSPINCORRELATEDTIME)(
2177 IN PKSPIN Pin,
2178 OUT PLONGLONG SystemTime
2179 );
2180
2181 typedef
2182 void
2183 (NTAPI *PFNKSPINRESOLUTION)(
2184 IN PKSPIN Pin,
2185 OUT PKSRESOLUTION Resolution
2186 );
2187
2188 struct _KSCLOCK_DISPATCH {
2189 PFNKSPINSETTIMER SetTimer;
2190 PFNKSPINCANCELTIMER CancelTimer;
2191 PFNKSPINCORRELATEDTIME CorrelatedTime;
2192 PFNKSPINRESOLUTION Resolution;
2193 };
2194
2195 typedef
2196 NTSTATUS
2197 (NTAPI *PFNKSPININITIALIZEALLOCATOR)(
2198 IN PKSPIN Pin,
2199 IN PKSALLOCATOR_FRAMING AllocatorFraming,
2200 OUT PVOID* Context
2201 );
2202
2203 typedef PVOID (NTAPI *PFNKSDELETEALLOCATOR)(
2204 IN PVOID Context);
2205
2206 typedef PVOID (NTAPI *PFNKSDEFAULTALLOCATE)(
2207 IN PVOID Context);
2208
2209 typedef PVOID (NTAPI *PFNKSDEFAULTFREE)(
2210 IN PVOID Context,
2211 IN PVOID Buffer);
2212
2213 struct _KSALLOCATOR_DISPATCH {
2214 PFNKSPININITIALIZEALLOCATOR InitializeAllocator;
2215 PFNKSDELETEALLOCATOR DeleteAllocator;
2216 PFNKSDEFAULTALLOCATE Allocate;
2217 PFNKSDEFAULTFREE Free;
2218 };
2219
2220 typedef struct
2221 {
2222 ULONG PropertySetsCount;
2223 ULONG PropertyItemSize;
2224 const KSPROPERTY_SET* PropertySets;
2225 ULONG MethodSetsCount;
2226 ULONG MethodItemSize;
2227 const KSMETHOD_SET* MethodSets;
2228 ULONG EventSetsCount;
2229 ULONG EventItemSize;
2230 const KSEVENT_SET* EventSets;
2231 #if !defined(_WIN64)
2232 PVOID Alignment;
2233 #endif
2234 } KSAUTOMATION_TABLE, *PKSAUTOMATION_TABLE;
2235
2236
2237
2238 typedef struct
2239 {
2240 ULONG InterfacesCount;
2241 const KSPIN_INTERFACE* Interfaces;
2242 ULONG MediumsCount;
2243 const KSPIN_MEDIUM* Mediums;
2244 ULONG DataRangesCount;
2245 const PKSDATARANGE* DataRanges;
2246 KSPIN_DATAFLOW DataFlow;
2247 KSPIN_COMMUNICATION Communication;
2248 const GUID* Category;
2249 const GUID* Name;
2250 union {
2251 LONGLONG Reserved;
2252 struct {
2253 ULONG ConstrainedDataRangesCount;
2254 PKSDATARANGE* ConstrainedDataRanges;
2255 };
2256 };
2257 } KSPIN_DESCRIPTOR, *PKSPIN_DESCRIPTOR;
2258
2259 typedef
2260 NTSTATUS
2261 (NTAPI *PFNKSINTERSECTHANDLER)(
2262 IN PIRP Irp,
2263 IN PKSP_PIN Pin,
2264 IN PKSDATARANGE DataRange,
2265 OUT PVOID Data OPTIONAL
2266 );
2267
2268 typedef
2269 NTSTATUS
2270 (NTAPI *PFNKSINTERSECTHANDLEREX)(
2271 IN PVOID Context,
2272 IN PIRP Irp,
2273 IN PKSP_PIN Pin,
2274 IN PKSDATARANGE DataRange,
2275 IN PKSDATARANGE MatchingDataRange,
2276 IN ULONG DataBufferSize,
2277 OUT PVOID Data OPTIONAL,
2278 OUT PULONG DataSize
2279 );
2280
2281 typedef struct
2282 {
2283 const KSPIN_DISPATCH* Dispatch;
2284 const KSAUTOMATION_TABLE* AutomationTable;
2285 KSPIN_DESCRIPTOR PinDescriptor;
2286 ULONG Flags;
2287 ULONG InstancesPossible;
2288 ULONG InstancesNecessary;
2289 const KSALLOCATOR_FRAMING_EX* AllocatorFraming;
2290 PFNKSINTERSECTHANDLEREX IntersectHandler;
2291 } KSPIN_DESCRIPTOR_EX, *PKSPIN_DESCRIPTOR_EX;
2292
2293 #define KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING 0x00000001
2294 #define KSFILTER_FLAG_CRITICAL_PROCESSING 0x00000002
2295 #define KSFILTER_FLAG_HYPERCRITICAL_PROCESSING 0x00000004
2296 #define KSFILTER_FLAG_RECEIVE_ZERO_LENGTH_SAMPLES 0x00000008
2297 #if (NTDDI_VERSION >= NTDDI_WINXPSP2)
2298 #define KSFILTER_FLAG_DENY_USERMODE_ACCESS 0x80000000
2299 #endif
2300
2301
2302 #define KSPIN_FLAG_DISPATCH_LEVEL_PROCESSING KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING
2303 #define KSPIN_FLAG_CRITICAL_PROCESSING KSFILTER_FLAG_CRITICAL_PROCESSING
2304 #define KSPIN_FLAG_HYPERCRITICAL_PROCESSING KSFILTER_FLAG_HYPERCRITICAL_PROCESSING
2305 #define KSPIN_FLAG_ASYNCHRONOUS_PROCESSING 0x00000008
2306 #define KSPIN_FLAG_DO_NOT_INITIATE_PROCESSING 0x00000010
2307 #define KSPIN_FLAG_INITIATE_PROCESSING_ON_EVERY_ARRIVAL 0x00000020
2308 #define KSPIN_FLAG_FRAMES_NOT_REQUIRED_FOR_PROCESSING 0x00000040
2309 #define KSPIN_FLAG_ENFORCE_FIFO 0x00000080
2310
2311 #define KSPIN_FLAG_GENERATE_MAPPINGS 0x00000100
2312 #define KSPIN_FLAG_DISTINCT_TRAILING_EDGE 0x00000200
2313
2314 #define KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY 0x00010000
2315 #define KSPIN_FLAG_SPLITTER 0x00020000
2316 #define KSPIN_FLAG_USE_STANDARD_TRANSPORT 0x00040000
2317 #define KSPIN_FLAG_DO_NOT_USE_STANDARD_TRANSPORT 0x00080000
2318 #define KSPIN_FLAG_FIXED_FORMAT 0x00100000
2319 #define KSPIN_FLAG_GENERATE_EOS_EVENTS 0x00200000
2320 #define KSPIN_FLAG_RENDERER (KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY|KSPIN_FLAG_GENERATE_EOS_EVENTS)
2321 #define KSPIN_FLAG_IMPLEMENT_CLOCK 0x00400000
2322 #define KSPIN_FLAG_SOME_FRAMES_REQUIRED_FOR_PROCESSING 0x00800000
2323 #define KSPIN_FLAG_PROCESS_IF_ANY_IN_RUN_STATE 0x01000000
2324 #if (NTDDI_VERSION >= NTDDI_WINXPSP2)
2325 #define KSPIN_FLAG_DENY_USERMODE_ACCESS 0x80000000
2326 #endif
2327
2328 struct _KSPIN
2329 {
2330 const KSPIN_DESCRIPTOR_EX* Descriptor;
2331 KSOBJECT_BAG Bag;
2332 PVOID Context;
2333 ULONG Id;
2334 KSPIN_COMMUNICATION Communication;
2335 BOOLEAN ConnectionIsExternal;
2336 KSPIN_INTERFACE ConnectionInterface;
2337 KSPIN_MEDIUM ConnectionMedium;
2338 KSPRIORITY ConnectionPriority;
2339 PKSDATAFORMAT ConnectionFormat;
2340 PKSMULTIPLE_ITEM AttributeList;
2341 ULONG StreamHeaderSize;
2342 KSPIN_DATAFLOW DataFlow;
2343 KSSTATE DeviceState;
2344 KSRESET ResetState;
2345 KSSTATE ClientState;
2346 };
2347
2348 #define DEFINE_KSPROPERTY_ITEM_PIN_CINSTANCES(Handler)\
2349 DEFINE_KSPROPERTY_ITEM(\
2350 KSPROPERTY_PIN_CINSTANCES,\
2351 (Handler),\
2352 sizeof(KSP_PIN),\
2353 sizeof(KSPIN_CINSTANCES),\
2354 NULL, NULL, 0, NULL, NULL, 0)
2355
2356 #define DEFINE_KSPROPERTY_ITEM_PIN_CTYPES(Handler)\
2357 DEFINE_KSPROPERTY_ITEM(\
2358 KSPROPERTY_PIN_CTYPES,\
2359 (Handler),\
2360 sizeof(KSPROPERTY),\
2361 sizeof(ULONG),\
2362 NULL, NULL, 0, NULL, NULL, 0)
2363
2364 #define DEFINE_KSPROPERTY_ITEM_PIN_DATAFLOW(Handler)\
2365 DEFINE_KSPROPERTY_ITEM(\
2366 KSPROPERTY_PIN_DATAFLOW,\
2367 (Handler),\
2368 sizeof(KSP_PIN),\
2369 sizeof(KSPIN_DATAFLOW),\
2370 NULL, NULL, 0, NULL, NULL, 0)
2371
2372 #define DEFINE_KSPROPERTY_ITEM_PIN_DATARANGES(Handler)\
2373 DEFINE_KSPROPERTY_ITEM(\
2374 KSPROPERTY_PIN_DATARANGES,\
2375 (Handler),\
2376 sizeof(KSP_PIN),\
2377 0,\
2378 NULL, NULL, 0, NULL, NULL, 0)
2379
2380 #define DEFINE_KSPROPERTY_ITEM_PIN_DATAINTERSECTION(Handler)\
2381 DEFINE_KSPROPERTY_ITEM(\
2382 KSPROPERTY_PIN_DATAINTERSECTION,\
2383 (Handler),\
2384 sizeof(KSP_PIN) + sizeof(KSMULTIPLE_ITEM),\
2385 0,\
2386 NULL, NULL, 0, NULL, NULL, 0)
2387
2388 #define DEFINE_KSPROPERTY_ITEM_PIN_INTERFACES(Handler)\
2389 DEFINE_KSPROPERTY_ITEM(\
2390 KSPROPERTY_PIN_INTERFACES,\
2391 (Handler),\
2392 sizeof(KSP_PIN),\
2393 0,\
2394 NULL, NULL, 0, NULL, NULL, 0)
2395
2396 #define DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(Handler)\
2397 DEFINE_KSPROPERTY_ITEM(\
2398 KSPROPERTY_PIN_MEDIUMS,\
2399 (Handler),\
2400 sizeof(KSP_PIN),\
2401 0,\
2402 NULL, NULL, 0, NULL, NULL, 0)
2403
2404 #define DEFINE_KSPROPERTY_ITEM_PIN_COMMUNICATION(Handler)\
2405 DEFINE_KSPROPERTY_ITEM(\
2406 KSPROPERTY_PIN_COMMUNICATION,\
2407 (Handler),\
2408 sizeof(KSP_PIN),\
2409 sizeof(KSPIN_COMMUNICATION),\
2410 NULL, NULL, 0, NULL, NULL, 0)
2411
2412 #define DEFINE_KSPROPERTY_ITEM_PIN_GLOBALCINSTANCES(Handler)\
2413 DEFINE_KSPROPERTY_ITEM(\
2414 KSPROPERTY_PIN_GLOBALCINSTANCES,\
2415 (Handler),\
2416 sizeof(KSP_PIN),\
2417 sizeof(KSPIN_CINSTANCES),\
2418 NULL, NULL, 0, NULL, NULL, 0)
2419
2420 #define DEFINE_KSPROPERTY_ITEM_PIN_NECESSARYINSTANCES(Handler)\
2421 DEFINE_KSPROPERTY_ITEM(\
2422 KSPROPERTY_PIN_NECESSARYINSTANCES,\
2423 (Handler),\
2424 sizeof(KSP_PIN),\
2425 sizeof(ULONG),\
2426 NULL, NULL, 0, NULL, NULL, 0)
2427
2428 #define DEFINE_KSPROPERTY_ITEM_PIN_PHYSICALCONNECTION(Handler)\
2429 DEFINE_KSPROPERTY_ITEM(\
2430 KSPROPERTY_PIN_PHYSICALCONNECTION,\
2431 (Handler),\
2432 sizeof(KSP_PIN),\
2433 0,\
2434 NULL, NULL, 0, NULL, NULL, 0)
2435
2436 #define DEFINE_KSPROPERTY_ITEM_PIN_CATEGORY(Handler)\
2437 DEFINE_KSPROPERTY_ITEM(\
2438 KSPROPERTY_PIN_CATEGORY,\
2439 (Handler),\
2440 sizeof(KSP_PIN),\
2441 sizeof(GUID),\
2442 NULL, NULL, 0, NULL, NULL, 0)
2443
2444 #define DEFINE_KSPROPERTY_ITEM_PIN_NAME(Handler)\
2445 DEFINE_KSPROPERTY_ITEM(\
2446 KSPROPERTY_PIN_NAME,\
2447 (Handler),\
2448 sizeof(KSP_PIN),\
2449 0,\
2450 NULL, NULL, 0, NULL, NULL, 0)
2451
2452 #define DEFINE_KSPROPERTY_ITEM_PIN_CONSTRAINEDDATARANGES(Handler)\
2453 DEFINE_KSPROPERTY_ITEM(\
2454 KSPROPERTY_PIN_CONSTRAINEDDATARANGES,\
2455 (Handler),\
2456 sizeof(KSP_PIN),\
2457 0,\
2458 NULL, NULL, 0, NULL, NULL, 0)
2459
2460 #define DEFINE_KSPROPERTY_ITEM_PIN_PROPOSEDATAFORMAT(Handler)\
2461 DEFINE_KSPROPERTY_ITEM(\
2462 KSPROPERTY_PIN_PROPOSEDATAFORMAT,\
2463 NULL,\
2464 sizeof(KSP_PIN),\
2465 sizeof(KSDATAFORMAT),\
2466 (Handler), NULL, 0, NULL, NULL, 0)
2467
2468 #define DEFINE_KSPROPERTY_PINSET(PinSet,\
2469 PropGeneral, PropInstances, PropIntersection)\
2470 DEFINE_KSPROPERTY_TABLE(PinSet) {\
2471 DEFINE_KSPROPERTY_ITEM_PIN_CINSTANCES(PropInstances),\
2472 DEFINE_KSPROPERTY_ITEM_PIN_CTYPES(PropGeneral),\
2473 DEFINE_KSPROPERTY_ITEM_PIN_DATAFLOW(PropGeneral),\
2474 DEFINE_KSPROPERTY_ITEM_PIN_DATARANGES(PropGeneral),\
2475 DEFINE_KSPROPERTY_ITEM_PIN_DATAINTERSECTION(PropIntersection),\
2476 DEFINE_KSPROPERTY_ITEM_PIN_INTERFACES(PropGeneral),\
2477 DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(PropGeneral),\
2478 DEFINE_KSPROPERTY_ITEM_PIN_COMMUNICATION(PropGeneral),\
2479 DEFINE_KSPROPERTY_ITEM_PIN_CATEGORY(PropGeneral),\
2480 DEFINE_KSPROPERTY_ITEM_PIN_NAME(PropGeneral)\
2481 }
2482
2483 #define DEFINE_KSPROPERTY_PINSETCONSTRAINED(PinSet,\
2484 PropGeneral, PropInstances, PropIntersection)\
2485 DEFINE_KSPROPERTY_TABLE(PinSet) {\
2486 DEFINE_KSPROPERTY_ITEM_PIN_CINSTANCES(PropInstances),\
2487 DEFINE_KSPROPERTY_ITEM_PIN_CTYPES(PropGeneral),\
2488 DEFINE_KSPROPERTY_ITEM_PIN_DATAFLOW(PropGeneral),\
2489 DEFINE_KSPROPERTY_ITEM_PIN_DATARANGES(PropGeneral),\
2490 DEFINE_KSPROPERTY_ITEM_PIN_DATAINTERSECTION(PropIntersection),\
2491 DEFINE_KSPROPERTY_ITEM_PIN_INTERFACES(PropGeneral),\
2492 DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(PropGeneral),\
2493 DEFINE_KSPROPERTY_ITEM_PIN_COMMUNICATION(PropGeneral),\
2494 DEFINE_KSPROPERTY_ITEM_PIN_CATEGORY(PropGeneral),\
2495 DEFINE_KSPROPERTY_ITEM_PIN_NAME(PropGeneral),\
2496 DEFINE_KSPROPERTY_ITEM_PIN_CONSTRAINEDDATARANGES(PropGeneral)\
2497 }
2498
2499
2500
2501 typedef
2502 void
2503 (NTAPI *PFNKSFREE)(
2504 IN PVOID Data
2505 );
2506
2507
2508
2509 #define DEFINE_KSPROPERTY_TABLE(tablename)\
2510 const KSPROPERTY_ITEM tablename[] =
2511
2512 #endif
2513
2514 typedef struct
2515 {
2516 KSPIN_INTERFACE Interface;
2517 KSPIN_MEDIUM Medium;
2518 ULONG PinId;
2519 HANDLE PinToHandle;
2520 KSPRIORITY Priority;
2521 } KSPIN_CONNECT, *PKSPIN_CONNECT;
2522
2523 /* ===============================================================
2524 Topology
2525 */
2526
2527 typedef struct
2528 {
2529 ULONG FromNode;
2530 ULONG FromNodePin;
2531 ULONG ToNode;
2532 ULONG ToNodePin;
2533 } KSTOPOLOGY_CONNECTION, *PKSTOPOLOGY_CONNECTION;
2534
2535 typedef struct
2536 {
2537 ULONG CategoriesCount;
2538 const GUID* Categories;
2539 ULONG TopologyNodesCount;
2540 const GUID* TopologyNodes;
2541 ULONG TopologyConnectionsCount;
2542 const KSTOPOLOGY_CONNECTION* TopologyConnections;
2543 const GUID* TopologyNodesNames;
2544 ULONG Reserved;
2545 } KSTOPOLOGY, *PKSTOPOLOGY;
2546
2547
2548 #define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CATEGORIES(Handler)\
2549 DEFINE_KSPROPERTY_ITEM(\
2550 KSPROPERTY_TOPOLOGY_CATEGORIES,\
2551 (Handler),\
2552 sizeof(KSPROPERTY),\
2553 0,\
2554 NULL, NULL, 0, NULL, NULL, 0)
2555
2556 #define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NODES(Handler)\
2557 DEFINE_KSPROPERTY_ITEM(\
2558 KSPROPERTY_TOPOLOGY_NODES,\
2559 (Handler),\
2560 sizeof(KSPROPERTY),\
2561 0,\
2562 NULL, NULL, 0, NULL, NULL, 0)
2563
2564 #define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CONNECTIONS(Handler)\
2565 DEFINE_KSPROPERTY_ITEM(\
2566 KSPROPERTY_TOPOLOGY_CONNECTIONS,\
2567 (Handler),\
2568 sizeof(KSPROPERTY),\
2569 0,\
2570 NULL, NULL, 0, NULL, NULL, 0)
2571
2572 #define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NAME(Handler)\
2573 DEFINE_KSPROPERTY_ITEM(\
2574 KSPROPERTY_TOPOLOGY_NAME,\
2575 (Handler),\
2576 sizeof(KSP_NODE),\
2577 0,\
2578 NULL, NULL, 0, NULL, NULL, 0)
2579
2580 #define DEFINE_KSPROPERTY_TOPOLOGYSET(TopologySet, Handler)\
2581 DEFINE_KSPROPERTY_TABLE(TopologySet) {\
2582 DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CATEGORIES(Handler),\
2583 DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NODES(Handler),\
2584 DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CONNECTIONS(Handler),\
2585 DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NAME(Handler)\
2586 }
2587
2588 /* ===============================================================
2589 ??? SORT ME
2590 */
2591
2592 /* TODO */
2593 typedef void* UNKNOWN;
2594
2595 typedef PVOID (NTAPI *PFNKSINITIALIZEALLOCATOR)(
2596 IN PVOID InitialContext,
2597 IN PKSALLOCATOR_FRAMING AllocatorFraming,
2598 OUT PVOID* Context);
2599
2600 #if defined(_NTDDK_)
2601 typedef NTSTATUS (NTAPI *PFNKSALLOCATOR)(
2602 IN PIRP Irp,
2603 IN ULONG BufferSize,
2604 IN BOOLEAN InputOperation);
2605
2606 typedef NTSTATUS (NTAPI *PFNKINTERSECTHANDLEREX)(
2607 IN PVOID Context,
2608 IN PIRP Irp,
2609 IN PKSP_PIN Pin,
2610 IN PKSDATARANGE DataRange,
2611 IN PKSDATARANGE MatchingDataRange,
2612 IN ULONG DataBufferSize,
2613 OUT PVOID Data OPTIONAL,
2614 OUT PULONG DataSize);
2615
2616
2617 typedef
2618 NTSTATUS
2619 (NTAPI *PFNALLOCATOR_ALLOCATEFRAME)(
2620 IN PFILE_OBJECT FileObject,
2621 PVOID *Frame
2622 );
2623
2624 typedef
2625 VOID
2626 (NTAPI *PFNALLOCATOR_FREEFRAME)(
2627 IN PFILE_OBJECT FileObject,
2628 IN PVOID Frame
2629 );
2630
2631 typedef struct {
2632 PFNALLOCATOR_ALLOCATEFRAME AllocateFrame;
2633 PFNALLOCATOR_FREEFRAME FreeFrame;
2634 } KSSTREAMALLOCATOR_FUNCTIONTABLE, *PKSSTREAMALLOCATOR_FUNCTIONTABLE;
2635
2636 #endif
2637
2638 typedef struct
2639 {
2640 KSALLOCATOR_FRAMING Framing;
2641 ULONG AllocatedFrames;
2642 ULONG Reserved;
2643 } KSSTREAMALLOCATOR_STATUS, *PKSSTREAMALLOCATOR_STATUS;
2644
2645 typedef struct
2646 {
2647 KSALLOCATOR_FRAMING_EX Framing;
2648 ULONG AllocatedFrames;
2649 ULONG Reserved;
2650 } KSSTREAMALLOCATOR_STATUS_EX, *PKSSTREAMALLOCATOR_STATUS_EX;
2651
2652 typedef struct
2653 {
2654 ULONG Size;
2655 ULONG TypeSpecificFlags;
2656 KSTIME PresentationTime;
2657 LONGLONG Duration;
2658 ULONG FrameExtent;
2659 ULONG DataUsed;
2660 PVOID Data;
2661 ULONG OptionsFlags;
2662 #ifdef _WIN64
2663 ULONG Reserved;
2664 #endif
2665 } KSSTREAM_HEADER, *PKSSTREAM_HEADER;
2666
2667 #define KSSTREAM_HEADER_OPTIONSF_SPLICEPOINT 0x00000001
2668 #define KSSTREAM_HEADER_OPTIONSF_PREROLL 0x00000002
2669 #define KSSTREAM_HEADER_OPTIONSF_DATADISCONTINUITY 0x00000004
2670 #define KSSTREAM_HEADER_OPTIONSF_TYPECHANGED 0x00000008
2671 #define KSSTREAM_HEADER_OPTIONSF_TIMEVALID 0x00000010
2672 #define KSSTREAM_HEADER_OPTIONSF_TIMEDISCONTINUITY 0x00000040
2673 #define KSSTREAM_HEADER_OPTIONSF_FLUSHONPAUSE 0x00000080
2674 #define KSSTREAM_HEADER_OPTIONSF_DURATIONVALID 0x00000100
2675 #define KSSTREAM_HEADER_OPTIONSF_ENDOFSTREAM 0x00000200
2676 #define KSSTREAM_HEADER_OPTIONSF_BUFFEREDTRANSFER 0x00000400
2677 #define KSSTREAM_HEADER_OPTIONSF_VRAM_DATA_TRANSFER 0x00000800
2678 #define KSSTREAM_HEADER_OPTIONSF_LOOPEDDATA 0x80000000
2679
2680 /* ===============================================================
2681 XP / DX8
2682 */
2683 #if defined(_NTDDK_)
2684 struct _KSMAPPING {
2685 PHYSICAL_ADDRESS PhysicalAddress;
2686 ULONG ByteCount;
2687 ULONG Alignment;
2688 };
2689 #endif
2690
2691 typedef enum {
2692 KSSTREAM_POINTER_STATE_UNLOCKED = 0,
2693 KSSTREAM_POINTER_STATE_LOCKED
2694 } KSSTREAM_POINTER_STATE;
2695
2696 typedef struct _KSGATE KSGATE, *PKSGATE;
2697 typedef struct _KSPROCESSPIN_INDEXENTRY KSPROCESSPIN_INDEXENTRY, *PKSPROCESSPIN_INDEXENTRY;
2698
2699 struct _KSGATE {
2700 LONG Count;
2701 PKSGATE NextGate;
2702 };
2703
2704 struct _KSSTREAM_POINTER_OFFSET
2705 {
2706 #if defined(_NTDDK_)
2707 union {
2708 PUCHAR Data;
2709 PKSMAPPING Mappings;
2710 };
2711 #else
2712 PUCHAR Data;
2713 #endif
2714 #if !defined(_WIN64)
2715 PVOID Alignment;
2716 #endif
2717 ULONG Count;
2718 ULONG Remaining;
2719 };
2720 #if defined(_NTDDK_)
2721 struct _KSSTREAM_POINTER
2722 {
2723 PVOID Context;
2724 PKSPIN Pin;
2725 PKSSTREAM_HEADER StreamHeader;
2726 PKSSTREAM_POINTER_OFFSET Offset;
2727 KSSTREAM_POINTER_OFFSET OffsetIn;
2728 KSSTREAM_POINTER_OFFSET OffsetOut;
2729 };
2730
2731 struct _KSPROCESSPIN
2732 {
2733 PKSPIN Pin;
2734 PKSSTREAM_POINTER StreamPointer;
2735 PKSPROCESSPIN InPlaceCounterpart;
2736 PKSPROCESSPIN DelegateBranch;
2737 PKSPROCESSPIN CopySource;
2738 PVOID Data;
2739 ULONG BytesAvailable;
2740 ULONG BytesUsed;
2741 ULONG Flags;
2742 BOOLEAN Terminate;
2743 };
2744
2745 struct _KSPROCESSPIN_INDEXENTRY
2746 {
2747 PKSPROCESSPIN* Pins;
2748 ULONG Count;
2749 };
2750 #endif
2751
2752 /* ===============================================================
2753 Device Dispatch
2754 */
2755
2756
2757
2758 #if defined(_NTDDK_)
2759
2760 typedef struct _KSFILTER_DISPATCH KSFILTER_DISPATCH, *PKSFILTER_DISPATCH;
2761 typedef struct _KSDEVICE KSDEVICE, *PKSDEVICE;
2762 typedef struct _KSFILTER KSFILTER, *PKSFILTER;
2763 typedef struct _KSNODE_DESCRIPTOR KSNODE_DESCRIPTOR, *PKSNODE_DESCRIPTOR;
2764 typedef struct _KSFILTER_DESCRIPTOR KSFILTER_DESCRIPTOR, *PKSFILTER_DESCRIPTOR;
2765 typedef struct _KSDEVICE_DESCRIPTOR KSDEVICE_DESCRIPTOR, *PKSDEVICE_DESCRIPTOR;
2766
2767 typedef NTSTATUS (NTAPI *PFNKSDEVICECREATE)(
2768 IN PKSDEVICE Device);
2769
2770 typedef NTSTATUS (NTAPI *PFNKSDEVICEPNPSTART)(
2771 IN PKSDEVICE Device,
2772 IN PIRP Irp,
2773 IN PCM_RESOURCE_LIST TranslatedResourceList OPTIONAL,
2774 IN PCM_RESOURCE_LIST UntranslatedResourceList OPTIONAL);
2775
2776 typedef NTSTATUS (NTAPI *PFNKSDEVICE)(
2777 IN PKSDEVICE Device);
2778
2779 typedef NTSTATUS (NTAPI *PFNKSDEVICEIRP)(
2780 IN PKSDEVICE Device,
2781 IN PIRP Irp);
2782
2783 typedef VOID (NTAPI *PFNKSDEVICEIRPVOID)(
2784 IN PKSDEVICE Device,
2785 IN PIRP Irp);
2786
2787 typedef NTSTATUS (NTAPI *PFNKSDEVICEQUERYCAPABILITIES)(
2788 IN PKSDEVICE Device,
2789 IN PIRP Irp,
2790 IN OUT PDEVICE_CAPABILITIES Capabilities);
2791
2792 typedef NTSTATUS (NTAPI *PFNKSDEVICEQUERYPOWER)(
2793 IN PKSDEVICE Device,
2794 IN PIRP Irp,
2795 IN DEVICE_POWER_STATE DeviceTo,
2796 IN DEVICE_POWER_STATE DeviceFrom,
2797 IN SYSTEM_POWER_STATE SystemTo,
2798 IN SYSTEM_POWER_STATE SystemFrom,
2799 IN POWER_ACTION Action);
2800
2801 typedef VOID (NTAPI *PFNKSDEVICESETPOWER)(
2802 IN PKSDEVICE Device,
2803 IN PIRP Irp,
2804 IN DEVICE_POWER_STATE To,
2805 IN DEVICE_POWER_STATE From);
2806
2807 typedef struct _KSDEVICE_DISPATCH {
2808 PFNKSDEVICECREATE Add;
2809 PFNKSDEVICEPNPSTART Start;
2810 PFNKSDEVICE PostStart;
2811 PFNKSDEVICEIRP QueryStop;
2812 PFNKSDEVICEIRPVOID CancelStop;
2813 PFNKSDEVICEIRPVOID Stop;
2814 PFNKSDEVICEIRP QueryRemove;
2815 PFNKSDEVICEIRPVOID CancelRemove;
2816 PFNKSDEVICEIRPVOID Remove;
2817 PFNKSDEVICEQUERYCAPABILITIES QueryCapabilities;
2818 PFNKSDEVICEIRPVOID SurpriseRemoval;
2819 PFNKSDEVICEQUERYPOWER QueryPower;
2820 PFNKSDEVICESETPOWER SetPower;
2821 PFNKSDEVICEIRP QueryInterface;
2822 }KSDEVICE_DISPATCH, *PKSDEVICE_DISPATCH;
2823
2824 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
2825 #define KSDEVICE_DESCRIPTOR_VERSION_2 (0x110)
2826 #define MIN_DEV_VER_FOR_FLAGS (0x110)
2827 #endif
2828
2829 struct _KSDEVICE
2830 {
2831 const KSDEVICE_DESCRIPTOR* Descriptor;
2832 KSOBJECT_BAG Bag;
2833 PVOID Context;
2834 PDEVICE_OBJECT FunctionalDeviceObject;
2835 PDEVICE_OBJECT PhysicalDeviceObject;
2836 PDEVICE_OBJECT NextDeviceObject;
2837 BOOLEAN Started;
2838 SYSTEM_POWER_STATE SystemPowerState;
2839 DEVICE_POWER_STATE DevicePowerState;
2840 };
2841 #endif
2842
2843 /* ===============================================================
2844 Filter Dispatch
2845 */
2846 #if defined(_NTDDK_)
2847 struct _KSFILTER
2848 {
2849 const KSFILTER_DESCRIPTOR* Descriptor;
2850 KSOBJECT_BAG Bag;
2851 PVOID Context;
2852 };
2853
2854 typedef
2855 void
2856 (NTAPI *PFNKSFILTERPOWER)(
2857 IN PKSFILTER Filter,
2858 IN DEVICE_POWER_STATE State
2859 );
2860
2861 typedef NTSTATUS (NTAPI *PFNKSFILTERIRP)(
2862 IN PKSFILTER Filter,
2863 IN PIRP Irp);
2864
2865 typedef NTSTATUS (NTAPI *PFNKSFILTERPROCESS)(
2866 IN PKSFILTER Filter,
2867 IN PKSPROCESSPIN_INDEXENTRY ProcessPinsIndex);
2868
2869 typedef NTSTATUS (NTAPI *PFNKSFILTERVOID)(
2870 IN PKSFILTER Filter);
2871
2872 struct _KSFILTER_DISPATCH
2873 {
2874 PFNKSFILTERIRP Create;
2875 PFNKSFILTERIRP Close;
2876 PFNKSFILTERPROCESS Process;
2877 PFNKSFILTERVOID Reset;
2878 };
2879
2880 struct _KSNODE_DESCRIPTOR
2881 {
2882 const KSAUTOMATION_TABLE* AutomationTable;
2883 const GUID* Type;
2884 const GUID* Name;
2885 };
2886
2887 struct _KSFILTER_DESCRIPTOR
2888 {
2889 const KSFILTER_DISPATCH* Dispatch;
2890 const KSAUTOMATION_TABLE* AutomationTable;
2891 ULONG Version;
2892 ULONG Flags;
2893 const GUID* ReferenceGuid;
2894 ULONG PinDescriptorsCount;
2895 ULONG PinDescriptorSize;
2896 const KSPIN_DESCRIPTOR_EX* PinDescriptors;
2897 ULONG CategoriesCount;
2898 const GUID* Categories;
2899 ULONG NodeDescriptorsCount;
2900 ULONG NodeDescriptorSize;
2901 const KSNODE_DESCRIPTOR* NodeDescriptors;
2902 ULONG ConnectionsCount;
2903 const KSTOPOLOGY_CONNECTION* Connections;
2904 const KSCOMPONENTID* ComponentId;
2905 };
2906
2907 #define KSFILTER_DESCRIPTOR_VERSION ((ULONG)-1)
2908
2909 struct _KSDEVICE_DESCRIPTOR
2910 {
2911 const KSDEVICE_DISPATCH* Dispatch;
2912 ULONG FilterDescriptorsCount;
2913 const KSFILTER_DESCRIPTOR*const* FilterDescriptors;
2914 ULONG Version;
2915 ULONG Flags;
2916 };
2917
2918 struct _KSFILTERFACTORY {
2919 const KSFILTER_DESCRIPTOR* FilterDescriptor;
2920 KSOBJECT_BAG Bag;
2921 PVOID Context;
2922 };
2923
2924 #define DEFINE_KSFILTER_DESCRIPTOR(descriptor)\
2925 const KSFILTER_DESCRIPTOR descriptor =
2926
2927 #define DEFINE_KSFILTER_PIN_DESCRIPTORS(table)\
2928 SIZEOF_ARRAY(table),\
2929 sizeof(table[0]),\
2930 table
2931
2932 #define DEFINE_KSFILTER_CATEGORIES(table)\
2933 SIZEOF_ARRAY(table),\
2934 table
2935
2936 #define DEFINE_KSFILTER_CATEGORY(category)\
2937 1,\
2938 &(category)
2939
2940 #define DEFINE_KSFILTER_CATEGORIES_NULL\
2941 0,\
2942 NULL
2943
2944 #define DEFINE_KSFILTER_NODE_DESCRIPTORS(table)\
2945 SIZEOF_ARRAY(table),\
2946 sizeof(table[0]),\
2947 table
2948
2949 #define DEFINE_KSFILTER_NODE_DESCRIPTORS_NULL\
2950 0,\
2951 sizeof(KSNODE_DESCRIPTOR),\
2952 NULL
2953
2954 #define DEFINE_KSFILTER_CONNECTIONS(table)\
2955 SIZEOF_ARRAY(table),\
2956 table
2957
2958 #define DEFINE_KSFILTER_DEFAULT_CONNECTIONS\
2959 0,\
2960 NULL
2961
2962 #endif
2963 /* ===============================================================
2964 Minidriver Callbacks
2965 */
2966 #if defined(_NTDDK_)
2967 typedef NTSTATUS (NTAPI *KStrMethodHandler)(
2968 IN PIRP Irp,
2969 IN PKSIDENTIFIER Request,
2970 IN OUT PVOID Data);
2971
2972 typedef NTSTATUS (NTAPI *KStrSupportHandler)(
2973 IN PIRP Irp,
2974 IN PKSIDENTIFIER Request,
2975 IN OUT PVOID Data);
2976 #endif
2977
2978 /* ===============================================================
2979 Allocator Functions
2980 */
2981 #if defined(_NTDDK_)
2982 KSDDKAPI NTSTATUS NTAPI
2983 KsCreateAllocator(
2984 IN HANDLE ConnectionHandle,
2985 IN PKSALLOCATOR_FRAMING AllocatorFraming,
2986 OUT PHANDLE AllocatorHandle);
2987
2988 KSDDKAPI NTSTATUS NTAPI
2989 KsCreateDefaultAllocator(
2990 IN PIRP Irp);
2991
2992 KSDDKAPI NTSTATUS NTAPI
2993 KsValidateAllocatorCreateRequest(
2994 IN PIRP Irp,
2995 OUT PKSALLOCATOR_FRAMING* AllocatorFraming);
2996
2997 KSDDKAPI NTSTATUS NTAPI
2998 KsCreateDefaultAllocatorEx(
2999 IN PIRP Irp,
3000 IN PVOID InitializeContext OPTIONAL,
3001 IN PFNKSDEFAULTALLOCATE DefaultAllocate OPTIONAL,
3002 IN PFNKSDEFAULTFREE DefaultFree OPTIONAL,
3003 IN PFNKSINITIALIZEALLOCATOR InitializeAllocator OPTIONAL,
3004 IN PFNKSDELETEALLOCATOR DeleteAllocator OPTIONAL);
3005
3006 KSDDKAPI NTSTATUS NTAPI
3007 KsValidateAllocatorFramingEx(
3008 IN PKSALLOCATOR_FRAMING_EX Framing,
3009 IN ULONG BufferSize,
3010 IN const KSALLOCATOR_FRAMING_EX* PinFraming);
3011 #endif
3012
3013 /* ===============================================================
3014 Clock Functions
3015 */
3016 #if defined(_NTDDK_)
3017 typedef BOOLEAN (NTAPI *PFNKSSETTIMER)(
3018 IN PVOID Context,
3019 IN PKTIMER Timer,
3020 IN LARGE_INTEGER DueTime,
3021 IN PKDPC Dpc);
3022
3023 typedef BOOLEAN (NTAPI *PFNKSCANCELTIMER)(
3024 IN PVOID Context,
3025 IN PKTIMER Timer);
3026
3027 typedef LONGLONG (FASTCALL *PFNKSCORRELATEDTIME)(
3028 IN PVOID Context,
3029 OUT PLONGLONG SystemTime);
3030
3031 KSDDKAPI NTSTATUS NTAPI
3032 KsCreateClock(
3033 IN HANDLE ConnectionHandle,
3034 IN PKSCLOCK_CREATE ClockCreate,
3035 OUT PHANDLE ClockHandle);
3036
3037 KSDDKAPI NTSTATUS NTAPI
3038 KsCreateDefaultClock(
3039 IN PIRP Irp,
3040 IN PKSDEFAULTCLOCK DefaultClock);
3041
3042 KSDDKAPI NTSTATUS NTAPI
3043 KsAllocateDefaultClock(
3044 OUT PKSDEFAULTCLOCK* DefaultClock);
3045
3046 KSDDKAPI NTSTATUS NTAPI
3047 KsAllocateDefaultClockEx(
3048 OUT PKSDEFAULTCLOCK* DefaultClock,
3049 IN PVOID Context OPTIONAL,
3050 IN PFNKSSETTIMER SetTimer OPTIONAL,
3051 IN PFNKSCANCELTIMER CancelTimer OPTIONAL,
3052 IN PFNKSCORRELATEDTIME CorrelatedTime OPTIONAL,
3053 IN const KSRESOLUTION* Resolution OPTIONAL,
3054 IN ULONG Flags);
3055
3056 KSDDKAPI VOID NTAPI
3057 KsFreeDefaultClock(
3058 IN PKSDEFAULTCLOCK DefaultClock);
3059
3060 KSDDKAPI NTSTATUS NTAPI
3061 KsValidateClockCreateRequest(
3062 IN PIRP Irp,
3063 OUT PKSCLOCK_CREATE* ClockCreate);
3064
3065 KSDDKAPI KSSTATE NTAPI
3066 KsGetDefaultClockState(
3067 IN PKSDEFAULTCLOCK DefaultClock);
3068
3069 KSDDKAPI VOID NTAPI
3070 KsSetDefaultClockState(
3071 IN PKSDEFAULTCLOCK DefaultClock,
3072 IN KSSTATE State);
3073
3074 KSDDKAPI LONGLONG NTAPI
3075 KsGetDefaultClockTime(
3076 IN PKSDEFAULTCLOCK DefaultClock);
3077
3078 KSDDKAPI VOID NTAPI
3079 KsSetDefaultClockTime(
3080 IN PKSDEFAULTCLOCK DefaultClock,
3081 IN LONGLONG Time);
3082 #endif
3083
3084 /* ===============================================================
3085 Method Functions
3086 */
3087
3088 /* Method sets - TODO: Make into macros! */
3089 #if defined(_NTDDK_)
3090 #if 0
3091 VOID
3092 KSMETHOD_SET_IRP_STORAGE(
3093 IN IRP Irp);
3094
3095 VOID
3096 KSMETHOD_ITEM_IRP_STORAGE(
3097 IN IRP Irp);
3098
3099 VOID
3100 KSMETHOD_TYPE_IRP_STORAGE(
3101 IN IRP Irp);
3102 #endif
3103
3104 KSDDKAPI NTSTATUS NTAPI
3105 KsMethodHandler(
3106 IN PIRP Irp,
3107 IN ULONG MethodSetsCount,
3108 IN PKSMETHOD_SET MethodSet);
3109
3110 KSDDKAPI NTSTATUS NTAPI
3111 KsMethodHandlerWithAllocator(
3112 IN PIRP Irp,
3113 IN ULONG MethodSetsCount,
3114 IN PKSMETHOD_SET MethodSet,
3115 IN PFNKSALLOCATOR Allocator OPTIONAL,
3116 IN ULONG MethodItemSize OPTIONAL);
3117
3118 KSDDKAPI BOOLEAN NTAPI
3119 KsFastMethodHandler(
3120 IN PFILE_OBJECT FileObject,
3121 IN PKSMETHOD UNALIGNED Method,
3122 IN ULONG MethodLength,
3123 IN OUT PVOID UNALIGNED Data,
3124 IN ULONG DataLength,
3125 OUT PIO_STATUS_BLOCK IoStatus,
3126 IN ULONG MethodSetsCount,
3127 IN const KSMETHOD_SET* MethodSet);
3128 #endif
3129
3130 /* ===============================================================
3131 Property Functions
3132 */
3133 #if defined(_NTDDK_)
3134 KSDDKAPI NTSTATUS NTAPI
3135 KsPropertyHandler(
3136 IN PIRP Irp,
3137 IN ULONG PropertySetsCount,
3138 IN const KSPROPERTY_SET* PropertySet);
3139
3140 KSDDKAPI NTSTATUS NTAPI
3141 KsPropertyHandlerWithAllocator(
3142 IN PIRP Irp,
3143 IN ULONG PropertySetsCount,
3144 IN PKSPROPERTY_SET PropertySet,
3145 IN PFNKSALLOCATOR Allocator OPTIONAL,
3146 IN ULONG PropertyItemSize OPTIONAL);
3147
3148 KSDDKAPI NTSTATUS NTAPI
3149 KsUnserializeObjectPropertiesFromRegistry(
3150 IN PFILE_OBJECT FileObject,
3151 IN HANDLE ParentKey OPTIONAL,
3152 IN PUNICODE_STRING RegistryPath OPTIONAL);
3153
3154 KSDDKAPI BOOLEAN NTAPI
3155 KsFastPropertyHandler(
3156 IN PFILE_OBJECT FileObject,
3157 IN PKSPROPERTY UNALIGNED Property,
3158 IN ULONG PropertyLength,
3159 IN OUT PVOID UNALIGNED Data,
3160 IN ULONG DataLength,
3161 OUT PIO_STATUS_BLOCK IoStatus,
3162 IN ULONG PropertySetsCount,
3163 IN const KSPROPERTY_SET* PropertySet);
3164 #endif
3165
3166 /* ===============================================================
3167 Event Functions
3168 */
3169
3170 #if defined(_NTDDK_)
3171
3172 #define KSPROBE_STREAMREAD 0x00000000
3173 #define KSPROBE_STREAMWRITE 0x00000001
3174 #define KSPROBE_ALLOCATEMDL 0x00000010
3175 #define KSPROBE_PROBEANDLOCK 0x00000020
3176 #define KSPROBE_SYSTEMADDRESS 0x00000040
3177 #define KSPROBE_MODIFY 0x00000200
3178 #define KSPROBE_STREAMWRITEMODIFY (KSPROBE_MODIFY | KSPROBE_STREAMWRITE)
3179 #define KSPROBE_ALLOWFORMATCHANGE 0x00000080
3180
3181 #define KSSTREAM_READ KSPROBE_STREAMREAD
3182 #define KSSTREAM_WRITE KSPROBE_STREAMWRITE
3183 #define KSSTREAM_PAGED_DATA 0x00000000
3184 #define KSSTREAM_NONPAGED_DATA 0x00000100
3185 #define KSSTREAM_SYNCHRONOUS 0x00001000
3186 #define KSSTREAM_FAILUREEXCEPTION 0x00002000
3187
3188 typedef
3189 BOOLEAN
3190 (NTAPI *PFNKSGENERATEEVENTCALLBACK)(
3191 IN PVOID Context,
3192 IN PKSEVENT_ENTRY EventEntry
3193 );
3194
3195 KSDDKAPI NTSTATUS NTAPI
3196 KsGenerateEvent(
3197 IN PKSEVENT_ENTRY EntryEvent);
3198
3199 KSDDKAPI void NTAPI
3200 KsGenerateEvents(
3201 IN PVOID Object,
3202 IN const GUID* EventSet OPTIONAL,
3203 IN ULONG EventId,
3204 IN ULONG DataSize,
3205 IN PVOID Data OPTIONAL,
3206 IN PFNKSGENERATEEVENTCALLBACK CallBack OPTIONAL,
3207 IN PVOID CallBackContext OPTIONAL
3208 );
3209
3210
3211 KSDDKAPI NTSTATUS NTAPI
3212 KsEnableEventWithAllocator(
3213 IN PIRP Irp,
3214 IN ULONG EventSetsCount,
3215 IN PKSEVENT_SET EventSet,
3216 IN OUT PLIST_ENTRY EventsList OPTIONAL,
3217 IN KSEVENTS_LOCKTYPE EventsFlags OPTIONAL,
3218 IN PVOID EventsLock OPTIONAL,
3219 IN PFNKSALLOCATOR Allocator OPTIONAL,
3220 IN ULONG EventItemSize OPTIONAL);
3221
3222 KSDDKAPI NTSTATUS NTAPI
3223 KsGenerateDataEvent(
3224 IN PKSEVENT_ENTRY EventEntry,
3225 IN ULONG DataSize,
3226 IN PVOID Data);
3227
3228 KSDDKAPI NTSTATUS NTAPI
3229 KsEnableEvent(
3230 IN PIRP Irp,
3231 IN ULONG EventSetsCount,
3232 IN KSEVENT_SET* EventSet,
3233 IN OUT PLIST_ENTRY EventsList OPTIONAL,
3234 IN KSEVENTS_LOCKTYPE EventsFlags OPTIONAL,
3235 IN PVOID EventsLock OPTIONAL);
3236
3237 KSDDKAPI VOID NTAPI
3238 KsDiscardEvent(
3239 IN PKSEVENT_ENTRY EventEntry);
3240
3241 KSDDKAPI NTSTATUS NTAPI
3242 KsDisableEvent(
3243 IN PIRP Irp,
3244 IN OUT PLIST_ENTRY EventsList,
3245 IN KSEVENTS_LOCKTYPE EventsFlags,
3246 IN PVOID EventsLock);
3247
3248 KSDDKAPI VOID NTAPI
3249 KsFreeEventList(
3250 IN PFILE_OBJECT FileObject,
3251 IN OUT PLIST_ENTRY EventsList,
3252 IN KSEVENTS_LOCKTYPE EVentsFlags,
3253 IN PVOID EventsLock);
3254
3255 /* ===============================================================
3256 Topology Functions
3257 */
3258
3259 KSDDKAPI NTSTATUS NTAPI
3260 KsValidateTopologyNodeCreateRequest(
3261 IN PIRP Irp,
3262 IN PKSTOPOLOGY Topology,
3263 OUT PKSNODE_CREATE* NodeCreate);
3264
3265 KSDDKAPI NTSTATUS NTAPI
3266 KsCreateTopologyNode(
3267 IN HANDLE ParentHandle,
3268 IN PKSNODE_CREATE NodeCreate,
3269 IN ACCESS_MASK DesiredAccess,
3270 OUT PHANDLE NodeHandle);
3271
3272 KSDDKAPI NTSTATUS NTAPI
3273 KsTopologyPropertyHandler(
3274 IN PIRP Irp,
3275 IN PKSPROPERTY Property,
3276 IN OUT PVOID Data,
3277 IN const KSTOPOLOGY* Topology);
3278
3279
3280
3281 /* ===============================================================
3282 Connectivity Functions
3283 */
3284
3285 KSDDKAPI NTSTATUS NTAPI
3286 KsCreatePin(
3287 IN HANDLE FilterHandle,
3288 IN PKSPIN_CONNECT Connect,
3289 IN ACCESS_MASK DesiredAccess,
3290 OUT PHANDLE ConnectionHandle);
3291
3292 KSDDKAPI NTSTATUS NTAPI
3293 KsValidateConnectRequest(
3294 IN PIRP Irp,
3295 IN ULONG DescriptorsCount,
3296 IN KSPIN_DESCRIPTOR* Descriptor,
3297 OUT PKSPIN_CONNECT* Connect);
3298
3299 KSDDKAPI NTSTATUS NTAPI
3300 KsPinPropertyHandler(
3301 IN PIRP Irp,
3302 IN PKSPROPERTY Property,
3303 IN OUT PVOID Data,
3304 IN ULONG DescriptorsCount,
3305 IN const KSPIN_DESCRIPTOR* Descriptor);
3306
3307 KSDDKAPI NTSTATUS NTAPI
3308 KsPinDataIntersection(
3309 IN PIRP Irp,
3310 IN PKSP_PIN Pin,
3311 OUT PVOID Data,
3312 IN ULONG DescriptorsCount,
3313 IN const KSPIN_DESCRIPTOR* Descriptor,
3314 IN PFNKSINTERSECTHANDLER IntersectHandler);
3315
3316 KSDDKAPI NTSTATUS NTAPI
3317 KsPinDataIntersectionEx(
3318 IN PIRP Irp,
3319 IN PKSP_PIN Pin,
3320 OUT PVOID Data,
3321 IN ULONG DescriptorsCount,
3322 IN const KSPIN_DESCRIPTOR* Descriptor,
3323 IN ULONG DescriptorSize,
3324 IN PFNKSINTERSECTHANDLEREX IntersectHandler OPTIONAL,
3325 IN PVOID HandlerContext OPTIONAL);
3326
3327 KSDDKAPI PKSFILTER NTAPI
3328 KsPinGetParentFilter(
3329 IN PKSPIN Pin
3330 );
3331
3332 KSDDKAPI PKSPIN NTAPI
3333 KsPinGetNextSiblingPin(
3334 IN PKSPIN Pin
3335 );
3336
3337
3338 /* Does this belong here? */
3339
3340 KSDDKAPI NTSTATUS NTAPI
3341 KsHandleSizedListQuery(
3342 IN PIRP Irp,
3343 IN ULONG DataItemsCount,
3344 IN ULONG DataItemSize,
3345 IN const VOID* DataItems);
3346
3347
3348 /* ===============================================================
3349 IRP Helper Functions
3350 */
3351
3352 typedef NTSTATUS (NTAPI *PFNKSIRPLISTCALLBACK)(
3353 IN PIRP Irp,
3354 IN PVOID Context);
3355
3356 KSDDKAPI NTSTATUS NTAPI
3357 KsAcquireResetValue(
3358 IN PIRP Irp,
3359 OUT KSRESET* ResetValue);
3360
3361 KSDDKAPI VOID NTAPI
3362 KsAddIrpToCancelableQueue(
3363 IN OUT PLIST_ENTRY QueueHead,
3364 IN PKSPIN_LOCK SpinLock,
3365 IN PIRP Irp,
3366 IN KSLIST_ENTRY_LOCATION ListLocation,
3367 IN PDRIVER_CANCEL DriverCancel OPTIONAL);
3368
3369 KSDDKAPI NTSTATUS NTAPI
3370 KsAddObjectCreateItemToDeviceHeader(
3371 IN KSDEVICE_HEADER Header,
3372 IN PDRIVER_DISPATCH Create,
3373 IN PVOID Context,
3374 IN PWCHAR ObjectClass,
3375 IN PSECURITY_DESCRIPTOR SecurityDescriptor);
3376
3377 KSDDKAPI NTSTATUS NTAPI
3378 KsAddObjectCreateItemToObjectHeader(
3379 IN KSOBJECT_HEADER Header,
3380 IN PDRIVER_DISPATCH Create,
3381 IN PVOID Context,
3382 IN PWCHAR ObjectClass,
3383 IN PSECURITY_DESCRIPTOR SecurityDescriptor);
3384
3385 KSDDKAPI NTSTATUS NTAPI
3386 KsAllocateDeviceHeader(
3387 OUT KSDEVICE_HEADER* Header,
3388 IN ULONG ItemsCount,
3389 IN PKSOBJECT_CREATE_ITEM ItemsList OPTIONAL);
3390
3391 KSDDKAPI NTSTATUS NTAPI
3392 KsAllocateExtraData(
3393 IN PIRP Irp,
3394 IN ULONG ExtraSize,
3395 OUT PVOID* ExtraBuffer);
3396
3397 KSDDKAPI NTSTATUS NTAPI
3398 KsAllocateObjectCreateItem(
3399 IN KSDEVICE_HEADER Header,
3400 IN PKSOBJECT_CREATE_ITEM CreateItem,
3401 IN BOOLEAN AllocateEntry,
3402 IN PFNKSITEMFREECALLBACK ItemFreeCallback OPTIONAL);
3403
3404 KSDDKAPI NTSTATUS NTAPI
3405 KsAllocateObjectHeader(
3406 OUT KSOBJECT_HEADER *Header,
3407 IN ULONG ItemsCount,
3408 IN PKSOBJECT_CREATE_ITEM ItemsList OPTIONAL,
3409 IN PIRP Irp,
3410 IN KSDISPATCH_TABLE* Table);
3411
3412 KSDDKAPI VOID NTAPI
3413 KsCancelIo(
3414 IN OUT PLIST_ENTRY QueueHead,
3415 IN PKSPIN_LOCK SpinLock);
3416
3417 KSDDKAPI VOID NTAPI
3418 KsCancelRoutine(
3419 IN PDEVICE_OBJECT DeviceObject,
3420 IN PIRP Irp);
3421
3422 KSDDKAPI NTSTATUS NTAPI
3423 KsDefaultDeviceIoCompletion(
3424 IN PDEVICE_OBJECT DeviceObject,
3425 IN PIRP Irp);
3426
3427 /* ELSEWHERE
3428 KSDDKAPI ULONG NTAPI
3429 KsDecrementCountedWorker(
3430 IN PKSWORKER Worker);
3431 */
3432
3433 KSDDKAPI BOOLEAN NTAPI
3434 KsDispatchFastIoDeviceControlFailure(
3435 IN PFILE_OBJECT FileObject,
3436 IN BOOLEAN Wait,
3437 IN PVOID InputBuffer OPTIONAL,
3438 IN ULONG InputBufferLength,
3439 OUT PVOID OutputBuffer OPTIONAL,
3440 IN ULONG OutputBufferLength,
3441 IN ULONG IoControlCode,
3442 OUT PIO_STATUS_BLOCK IoStatus,
3443 IN PDEVICE_OBJECT DeviceObject); /* always return false */
3444
3445 KSDDKAPI BOOLEAN NTAPI
3446 KsDispatchFastReadFailure(
3447 IN PFILE_OBJECT FileObject,
3448 IN PLARGE_INTEGER FileOffset,
3449 IN ULONG Length,
3450 IN BOOLEAN Wait,
3451 IN ULONG LockKey,
3452 OUT PVOID Buffer,
3453 OUT PIO_STATUS_BLOCK IoStatus,
3454 IN PDEVICE_OBJECT DeviceObject); /* always return false */
3455
3456 /* This function does the same as the above */
3457 #define KsDispatchFastWriteFailure KsDispatchFastReadFailure
3458
3459 KSDDKAPI NTSTATUS NTAPI
3460 KsDispatchInvalidDeviceRequest(
3461 IN PDEVICE_OBJECT DeviceObject,
3462 IN PIRP Irp);
3463
3464 KSDDKAPI NTSTATUS NTAPI
3465 KsDispatchIrp(
3466 IN PDEVICE_OBJECT DeviceObject,
3467 IN PIRP Irp);
3468
3469 KSDDKAPI NTSTATUS NTAPI
3470 KsDispatchSpecificMethod(
3471 IN PIRP Irp,
3472 IN PFNKSHANDLER Handler);
3473
3474 KSDDKAPI NTSTATUS NTAPI
3475 KsDispatchSpecificProperty(
3476 IN PIRP Irp,
3477 IN PFNKSHANDLER Handler);
3478
3479 KSDDKAPI NTSTATUS NTAPI
3480 KsForwardAndCatchIrp(
3481 IN PDEVICE_OBJECT DeviceObject,
3482 IN PIRP Irp,
3483 IN PFILE_OBJECT FileObject,
3484 IN KSSTACK_USE StackUse);
3485
3486 KSDDKAPI NTSTATUS NTAPI
3487 KsForwardIrp(
3488 IN PIRP Irp,
3489 IN PFILE_OBJECT FileObject,
3490 IN BOOLEAN ReuseStackLocation);
3491
3492 KSDDKAPI VOID NTAPI
3493 KsFreeDeviceHeader(
3494 IN KSDEVICE_HEADER Header);
3495
3496 KSDDKAPI VOID NTAPI
3497 KsFreeObjectHeader(
3498 IN PVOID Header);
3499
3500 KSDDKAPI NTSTATUS NTAPI
3501 KsGetChildCreateParameter(
3502 IN PIRP Irp,
3503 OUT PVOID* CreateParameter);
3504
3505 KSDDKAPI NTSTATUS NTAPI
3506 KsMoveIrpsOnCancelableQueue(
3507 IN OUT PLIST_ENTRY SourceList,
3508 IN PKSPIN_LOCK SourceLock,
3509 IN OUT PLIST_ENTRY DestinationList,
3510 IN PKSPIN_LOCK DestinationLock OPTIONAL,
3511 IN KSLIST_ENTRY_LOCATION ListLocation,
3512 IN PFNKSIRPLISTCALLBACK ListCallback,
3513 IN PVOID Context);
3514
3515 KSDDKAPI NTSTATUS NTAPI
3516 KsProbeStreamIrp(
3517 IN PIRP Irp,
3518 IN ULONG ProbeFlags,
3519 IN ULONG HeaderSize);
3520
3521 KSDDKAPI NTSTATUS NTAPI
3522 KsQueryInformationFile(
3523 IN PFILE_OBJECT FileObject,
3524 OUT PVOID FileInformation,
3525 IN ULONG Length,
3526 IN FILE_INFORMATION_CLASS FileInformationClass);
3527
3528 KSDDKAPI ACCESS_MASK NTAPI
3529 KsQueryObjectAccessMask(
3530 IN KSOBJECT_HEADER Header);
3531
3532 KSDDKAPI PKSOBJECT_CREATE_ITEM NTAPI
3533 KsQueryObjectCreateItem(
3534 IN KSOBJECT_HEADER Header);
3535
3536 KSDDKAPI NTSTATUS NTAPI
3537 KsReadFile(
3538 IN PFILE_OBJECT FileObject,
3539 IN PKEVENT Event OPTIONAL,
3540 IN PVOID PortContext OPTIONAL,
3541 OUT PIO_STATUS_BLOCK IoStatusBlock,
3542 OUT PVOID Buffer,
3543 IN ULONG Length,
3544 IN ULONG Key OPTIONAL,
3545 IN KPROCESSOR_MODE RequestorMode);
3546
3547 KSDDKAPI VOID NTAPI
3548 KsReleaseIrpOnCancelableQueue(
3549 IN PIRP Irp,
3550 IN PDRIVER_CANCEL DriverCancel OPTIONAL);
3551
3552 KSDDKAPI PIRP NTAPI
3553 KsRemoveIrpFromCancelableQueue(
3554 IN OUT PLIST_ENTRY QueueHead,
3555 IN PKSPIN_LOCK SpinLock,
3556 IN KSLIST_ENTRY_LOCATION ListLocation,
3557 IN KSIRP_REMOVAL_OPERATION RemovalOperation);
3558
3559 KSDDKAPI VOID NTAPI
3560 KsRemoveSpecificIrpFromCancelableQueue(
3561 IN PIRP Irp);
3562
3563 KSDDKAPI NTSTATUS NTAPI
3564 KsSetInformationFile(
3565 IN PFILE_OBJECT FileObject,
3566 IN PVOID FileInformation,
3567 IN ULONG Length,
3568 IN FILE_INFORMATION_CLASS FileInformationClass);
3569
3570 KSDDKAPI NTSTATUS NTAPI
3571 KsSetMajorFunctionHandler(
3572 IN PDRIVER_OBJECT DriverObject,
3573 IN ULONG MajorFunction);
3574
3575 KSDDKAPI NTSTATUS NTAPI
3576 KsStreamIo(
3577 IN PFILE_OBJECT FileObject,
3578 IN PKEVENT Event OPTIONAL,
3579 IN PVOID PortContext OPTIONAL,
3580 IN PIO_COMPLETION_ROUTINE CompletionRoutine OPTIONAL,
3581 IN PVOID CompletionContext OPTIONAL,
3582 IN KSCOMPLETION_INVOCATION CompletionInvocationFlags OPTIONAL,
3583 OUT PIO_STATUS_BLOCK IoStatusBlock,
3584 IN OUT PVOID StreamHeaders,
3585 IN ULONG Length,
3586 IN ULONG Flags,
3587 IN KPROCESSOR_MODE RequestorMode);
3588
3589 KSDDKAPI NTSTATUS NTAPI
3590 KsWriteFile(
3591 IN PFILE_OBJECT FileObject,
3592 IN PKEVENT Event OPTIONAL,
3593 IN PVOID PortContext OPTIONAL,
3594 OUT PIO_STATUS_BLOCK IoStatusBlock,
3595 IN PVOID Buffer,
3596 IN ULONG Length,
3597 IN ULONG Key OPTIONAL,
3598 IN KPROCESSOR_MODE RequestorMode);
3599
3600
3601 KSDDKAPI NTSTATUS NTAPI
3602 KsDefaultForwardIrp(
3603 IN PDEVICE_OBJECT DeviceObject,
3604 IN PIRP Irp);
3605
3606 /* ===============================================================
3607 Worker Management Functions
3608 */
3609
3610 KSDDKAPI NTSTATUS NTAPI
3611 KsRegisterWorker(
3612 IN WORK_QUEUE_TYPE WorkQueueType,
3613 OUT PKSWORKER* Worker);
3614
3615 KSDDKAPI VOID NTAPI
3616 KsUnregisterWorker(
3617 IN PKSWORKER Worker);
3618
3619 KSDDKAPI NTSTATUS NTAPI
3620 KsRegisterCountedWorker(
3621 IN WORK_QUEUE_TYPE WorkQueueType,
3622 IN PWORK_QUEUE_ITEM CountedWorkItem,
3623 OUT PKSWORKER* Worker);
3624
3625 KSDDKAPI ULONG NTAPI
3626 KsDecrementCountedWorker(
3627 IN PKSWORKER Worker);
3628
3629 KSDDKAPI ULONG NTAPI
3630 KsIncrementCountedWorker(
3631 IN PKSWORKER Worker);
3632
3633 KSDDKAPI NTSTATUS NTAPI
3634 KsQueueWorkItem(
3635 IN PKSWORKER Worker,
3636 IN PWORK_QUEUE_ITEM WorkItem);
3637
3638
3639 /* ===============================================================
3640 Resources / Images
3641 */
3642
3643 KSDDKAPI NTSTATUS NTAPI
3644 KsLoadResource(
3645 IN PVOID ImageBase,
3646 IN POOL_TYPE PoolType,
3647 IN ULONG_PTR ResourceName,
3648 IN ULONG ResourceType,
3649 OUT PVOID* Resource,
3650 OUT PULONG ResourceSize);
3651
3652 /* TODO: Implement
3653 KSDDKAPI NTSTATUS NTAPI
3654 KsGetImageNameAndResourceId(
3655 IN HANDLE RegKey,
3656 OUT PUNICODE_STRING ImageName,
3657 OUT PULONG_PTR ResourceId,
3658 OUT PULONG ValueType);
3659
3660 KSDDKAPI NTSTATUS NTAPI
3661 KsMapModuleName(
3662 IN PDEVICE_OBJECT PhysicalDeviceObject,
3663 IN PUNICODE_STRING ModuleName,
3664 OUT PUNICODE_STRING ImageName,
3665 OUT PULONG_PTR ResourceId,
3666 OUT PULONG ValueType);
3667 */
3668
3669
3670 /* ===============================================================
3671 Misc. Helper Functions
3672 */
3673
3674 KSDDKAPI PVOID NTAPI
3675 KsGetNextSibling(
3676 IN PVOID Object);
3677
3678
3679 KSDDKAPI NTSTATUS NTAPI
3680 KsCacheMedium(
3681 IN PUNICODE_STRING SymbolicLink,
3682 IN PKSPIN_MEDIUM Medium,
3683 IN ULONG PinDirection);
3684
3685 KSDDKAPI NTSTATUS NTAPI
3686 KsDefaultDispatchPnp(
3687 IN PDEVICE_OBJECT DeviceObject,
3688 IN PIRP Irp);
3689
3690 KSDDKAPI VOID NTAPI
3691 KsSetDevicePnpAndBaseObject(
3692 IN KSDEVICE_HEADER Header,
3693 IN PDEVICE_OBJECT PnpDeviceObject,
3694 IN PDEVICE_OBJECT BaseDevice);
3695
3696 KSDDKAPI NTSTATUS NTAPI
3697 KsDefaultDispatchPower(
3698 IN PDEVICE_OBJECT DeviceObject,
3699 IN PIRP Irp);
3700
3701 KSDDKAPI VOID NTAPI
3702 KsSetPowerDispatch(
3703 IN KSOBJECT_HEADER Header,
3704 IN PFNKSCONTEXT_DISPATCH PowerDispatch OPTIONAL,
3705 IN PVOID PowerContext OPTIONAL);
3706
3707 KSDDKAPI NTSTATUS NTAPI
3708 KsReferenceBusObject(
3709 IN KSDEVICE_HEADER Header);
3710
3711 KSDDKAPI VOID NTAPI
3712 KsDereferenceBusObject(
3713 IN KSDEVICE_HEADER Header);
3714
3715 KSDDKAPI NTSTATUS NTAPI
3716 KsFreeObjectCreateItem(
3717 IN KSDEVICE_HEADER Header,
3718 IN PUNICODE_STRING CreateItem);
3719
3720 KSDDKAPI NTSTATUS NTAPI
3721 KsFreeObjectCreateItemsByContext(
3722 IN KSDEVICE_HEADER Header,
3723 IN PVOID Context);
3724
3725 KSDDKAPI VOID NTAPI
3726 KsNullDriverUnload(
3727 IN PDRIVER_OBJECT DriverObject);
3728
3729 KSDDKAPI PDEVICE_OBJECT NTAPI
3730 KsQueryDevicePnpObject(
3731 IN KSDEVICE_HEADER Header);
3732
3733 KSDDKAPI VOID NTAPI
3734 KsRecalculateStackDepth(
3735 IN KSDEVICE_HEADER Header,
3736 IN BOOLEAN ReuseStackLocation);
3737
3738 KSDDKAPI VOID NTAPI
3739 KsSetTargetDeviceObject(
3740 IN KSOBJECT_HEADER Header,
3741 IN PDEVICE_OBJECT TargetDevice OPTIONAL);
3742
3743 KSDDKAPI VOID NTAPI
3744 KsSetTargetState(
3745 IN KSOBJECT_HEADER Header,
3746 IN KSTARGET_STATE TargetState);
3747
3748 KSDDKAPI NTSTATUS NTAPI
3749 KsSynchronousIoControlDevice(
3750 IN PFILE_OBJECT FileObject,
3751 IN KPROCESSOR_MODE RequestorMode,
3752 IN ULONG IoControl,
3753 IN PVOID InBuffer,
3754 IN ULONG InSize,
3755 OUT PVOID OutBuffer,
3756 IN ULONG OUtSize,
3757 OUT PULONG BytesReturned);
3758
3759 KSDDKAPI
3760 PKSPIN
3761 NTAPI
3762 KsFilterGetFirstChildPin(
3763 IN PKSFILTER Filter,
3764 IN ULONG PinId
3765 );
3766
3767 KSDDKAPI
3768 PFILE_OBJECT
3769 NTAPI
3770 KsPinGetConnectedPinFileObject(
3771 IN PKSPIN Pin
3772 );
3773
3774 #else
3775
3776 KSDDKAPI
3777 DWORD
3778 WINAPI
3779 KsCreatePin(
3780 IN HANDLE FilterHandle,
3781 IN PKSPIN_CONNECT Connect,
3782 IN ACCESS_MASK DesiredAccess,
3783 OUT PHANDLE ConnectionHandle
3784 );
3785
3786
3787 #endif
3788
3789 /* ===============================================================
3790 AVStream Functions (XP / DirectX 8)
3791 NOT IMPLEMENTED YET
3792 http://www.osronline.com/ddkx/stream/avstream_5q9f.htm
3793 */
3794
3795 #if defined(_NTDDK_)
3796
3797 KSDDKAPI
3798 NTSTATUS
3799 NTAPI
3800 KsMergeAutomationTables(
3801 OUT PKSAUTOMATION_TABLE* AutomationTableAB,
3802 IN PKSAUTOMATION_TABLE AutomationTableA OPTIONAL,
3803 IN PKSAUTOMATION_TABLE AutomationTableB OPTIONAL,
3804 IN KSOBJECT_BAG Bag OPTIONAL
3805 );
3806
3807 KSDDKAPI
3808 NTSTATUS
3809 NTAPI
3810 KsInitializeDriver(
3811 IN PDRIVER_OBJECT DriverObject,
3812 IN PUNICODE_STRING RegistryPath,
3813 IN const KSDEVICE_DESCRIPTOR *Descriptor OPTIONAL);
3814
3815 typedef struct _KSFILTERFACTORY KSFILTERFACTORY, *PKSFILTERFACTORY; //FIXME
3816
3817
3818
3819 KSDDKAPI
3820 NTSTATUS
3821 NTAPI
3822 KsInitializeDevice (
3823 IN PDEVICE_OBJECT FunctionalDeviceObject,
3824 IN PDEVICE_OBJECT PhysicalDeviceObject,
3825 IN PDEVICE_OBJECT NextDeviceObject,
3826 IN const KSDEVICE_DESCRIPTOR* Descriptor OPTIONAL);
3827
3828
3829 typedef void (NTAPI *PFNKSFILTERFACTORYPOWER)(
3830 IN PKSFILTERFACTORY FilterFactory,
3831 IN DEVICE_POWER_STATE State);
3832
3833 KSDDKAPI
3834 NTSTATUS
3835 NTAPI
3836 _KsEdit(
3837 IN KSOBJECT_BAG ObjectBag,
3838 IN OUT PVOID* PointerToPointerToItem,
3839 IN ULONG NewSize,
3840 IN ULONG OldSize,
3841 IN ULONG Tag);
3842
3843 KSDDKAPI
3844 VOID
3845 NTAPI
3846 KsAcquireControl(
3847 IN PVOID Object);
3848
3849 KSDDKAPI
3850 VOID
3851 NTAPI
3852 KsAcquireDevice(
3853 IN PKSDEVICE Device);
3854
3855 KSDDKAPI
3856 NTSTATUS
3857 NTAPI
3858 KsAddDevice(
3859 IN PDRIVER_OBJECT DriverObject,
3860 IN PDEVICE_OBJECT PhysicalDeviceObject);
3861
3862 KSDDKAPI
3863 VOID
3864 NTAPI
3865 KsAddEvent(
3866 IN PVOID Object,
3867 IN PKSEVENT_ENTRY EventEntry);
3868
3869 KSDDKAPI
3870 NTSTATUS
3871 NTAPI
3872 KsAddItemToObjectBag(
3873 IN KSOBJECT_BAG ObjectBag,
3874 IN PVOID Item,
3875 IN PFNKSFREE Free OPTIONAL);
3876
3877 KSDDKAPI
3878 ULONG
3879 NTAPI
3880 KsRemoveItemFromObjectBag(
3881 IN KSOBJECT_BAG ObjectBag,
3882 IN PVOID Item,
3883 IN BOOLEAN Free);
3884
3885 KSDDKAPI
3886 NTSTATUS
3887 NTAPI
3888 KsAllocateObjectBag(
3889 IN PKSDEVICE Device,
3890 OUT KSOBJECT_BAG* ObjectBag);
3891
3892 KSDDKAPI
3893 VOID
3894 NTAPI
3895 KsFreeObjectBag(
3896 IN KSOBJECT_BAG ObjectBag
3897 );
3898
3899 KSDDKAPI
3900 VOID
3901 NTAPI
3902 KsCompletePendingRequest(
3903 IN PIRP Irp);
3904
3905 KSDDKAPI
3906 NTSTATUS
3907 NTAPI
3908 KsCopyObjectBagItems(
3909 IN KSOBJECT_BAG ObjectBagDestination,
3910 IN KSOBJECT_BAG ObjectBagSource);
3911
3912 KSDDKAPI
3913 NTSTATUS
3914 NTAPI
3915 KsCreateDevice(
3916 IN PDRIVER_OBJECT DriverObject,
3917 IN PDEVICE_OBJECT PhysicalDeviceObject,
3918 IN const KSDEVICE_DESCRIPTOR* Descriptor OPTIONAL,
3919 IN ULONG ExtensionSize OPTIONAL,
3920 OUT PKSDEVICE* Device OPTIONAL);
3921
3922 KSDDKAPI
3923 NTSTATUS
3924 NTAPI
3925 KsCreateFilterFactory(
3926 IN PDEVICE_OBJECT DeviceObject,
3927 IN const KSFILTER_DESCRIPTOR* Descriptor,
3928 IN PWCHAR RefString OPTIONAL,
3929 IN PSECURITY_DESCRIPTOR SecurityDescriptor OPTIONAL,
3930 IN ULONG CreateItemFlags,
3931 IN PFNKSFILTERFACTORYPOWER SleepCallback OPTIONAL,
3932 IN PFNKSFILTERFACTORYPOWER WakeCallback OPTIONAL,
3933 OUT PKSFILTERFACTORY *FilterFactory OPTIONAL);
3934
3935 KSDDKAPI
3936 NTSTATUS
3937 NTAPI
3938 KsFilterFactoryUpdateCacheData(
3939 IN PKSFILTERFACTORY FilterFactory,
3940 IN const KSFILTER_DESCRIPTOR *FilterDescriptor OPTIONAL
3941 );
3942
3943 KSDDKAPI
3944 PKSPIN
3945 NTAPI
3946 KsGetPinFromIrp(
3947 IN PIRP Irp
3948 );
3949
3950 KSDDKAPI
3951 PKSFILTER
3952 NTAPI
3953 KsGetFilterFromIrp(
3954 IN PIRP Irp
3955 );
3956
3957 KSDDKAPI
3958 NTSTATUS
3959 NTAPI
3960 KsDefaultAddEventHandler(
3961 IN PIRP Irp,
3962 IN PKSEVENTDATA EventData,
3963 IN OUT PKSEVENT_ENTRY EventEntry);
3964
3965 KSDDKAPI
3966 NTSTATUS
3967 NTAPI
3968 KsDispatchQuerySecurity(
3969 IN PDEVICE_OBJECT DeviceObject,
3970 IN PIRP Irp
3971 );
3972
3973 KSDDKAPI
3974 NTSTATUS
3975 NTAPI
3976 KsDispatchSetSecurity(
3977 IN PDEVICE_OBJECT DeviceObject,
3978 IN PIRP Irp
3979 );
3980
3981 KSDDKAPI
3982 PVOID
3983 NTAPI
3984 KsGetParent(
3985 IN PVOID Object
3986 );
3987
3988
3989 static
3990 PKSFILTERFACTORY
3991 __inline
3992 KsFilterGetParentFilterFactory(
3993 IN PKSFILTER Filter
3994 )
3995 {
3996 return (PKSFILTERFACTORY) KsGetParent((PVOID) Filter);
3997 }
3998
3999 static
4000 PKSDEVICE
4001 __inline
4002 KsFilterFactoryGetParentDevice(
4003 IN PKSFILTERFACTORY FilterFactory
4004 )
4005 {
4006 return (PKSDEVICE) KsGetParent((PVOID) FilterFactory);
4007 }
4008
4009
4010
4011 #define KsDeleteFilterFactory(FilterFactory) \
4012 KsFreeObjectCreateItemsByContext( \
4013 *(KSDEVICE_HEADER *)( \
4014 KsFilterFactoryGetParentDevice(FilterFactory)->FunctionalDeviceObject-> \
4015 DeviceExtension), \
4016 FilterFactory)
4017
4018 KSDDKAPI
4019 ULONG
4020 NTAPI
4021 KsDeviceGetBusData(
4022 IN PKSDEVICE Device,
4023 IN ULONG DataType,
4024 IN PVOID Buffer,
4025 IN ULONG Offset,
4026 IN ULONG Length);
4027
4028
4029 KSDDKAPI
4030 PVOID
4031 NTAPI
4032 KsGetFirstChild(
4033 IN PVOID Object
4034 );
4035
4036 KSDDKAPI
4037 PKSFILTERFACTORY
4038 NTAPI
4039 KsDeviceGetFirstChildFilterFactory(
4040 IN PKSDEVICE Device);
4041
4042 #if defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__)
4043
4044 KSDDKAPI
4045 PUNKNOWN
4046 NTAPI
4047 KsGetOuterUnknown(
4048 IN PVOID Object
4049 );
4050
4051 static
4052 __inline
4053 PUNKNOWN
4054 KsDeviceGetOuterUnknown(
4055 IN PKSDEVICE Device)
4056 {
4057 return KsGetOuterUnknown((PVOID) Device);
4058 }
4059
4060 KSDDKAPI
4061 PUNKNOWN
4062 NTAPI
4063 KsDeviceRegisterAggregatedClientUnknown(
4064 IN PKSDEVICE Device,
4065 IN PUNKNOWN ClientUnknown);
4066
4067
4068 #endif
4069
4070 #if defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__)
4071
4072 typedef interface IKsReferenceClock* PIKSREFERENCECLOCK;
4073
4074 #undef INTERFACE
4075 #define INTERFACE IKsReferenceClock
4076 DECLARE_INTERFACE_(IKsReferenceClock,IUnknown)
4077 {
4078 DEFINE_ABSTRACT_UNKNOWN() // For C
4079
4080 STDMETHOD_(LONGLONG,GetTime)(THIS
4081 ) PURE;
4082 STDMETHOD_(LONGLONG,GetPhysicalTime)(THIS
4083 ) PURE;
4084 STDMETHOD_(LONGLONG,GetCorrelatedTime)(THIS_
4085 OUT PLONGLONG SystemTime
4086 ) PURE;
4087 STDMETHOD_(LONGLONG,GetCorrelatedPhysicalTime)(THIS_
4088 OUT PLONGLONG SystemTime
4089 ) PURE;
4090 STDMETHOD_(NTSTATUS, GetResolution)(THIS_
4091 OUT PKSRESOLUTION Resolution
4092 ) PURE;
4093 STDMETHOD_(NTSTATUS, GetState)(THIS_
4094 OUT PKSSTATE State
4095 ) PURE;
4096 };
4097
4098 #undef INTERFACE
4099 #define INTERFACE IKsControl
4100
4101 DEFINE_GUID(IID_IKsControl, 0x28F54685L, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96);
4102
4103 DECLARE_INTERFACE_(IKsControl,IUnknown)
4104 {
4105 STDMETHOD_(NTSTATUS, QueryInterface)( THIS_
4106 REFIID InterfaceId,
4107 PVOID* Interface)PURE;
4108
4109 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
4110
4111 STDMETHOD_(ULONG, Release)(THIS) PURE;
4112
4113 STDMETHOD_(NTSTATUS, KsProperty)(THIS_
4114 IN PKSPROPERTY Property,
4115 IN ULONG PropertyLength,
4116 IN OUT PVOID PropertyData,
4117 IN ULONG DataLength,
4118 OUT ULONG* BytesReturned
4119 ) PURE;
4120 STDMETHOD_(NTSTATUS, KsMethod)(THIS_
4121 IN PKSMETHOD Method,
4122 IN ULONG MethodLength,
4123 IN OUT PVOID MethodData,
4124 IN ULONG DataLength,
4125 OUT ULONG* BytesReturned
4126 ) PURE;
4127 STDMETHOD_(NTSTATUS, KsEvent)(THIS_
4128 IN PKSEVENT Event OPTIONAL,
4129 IN ULONG EventLength,
4130 IN OUT PVOID EventData,
4131 IN ULONG DataLength,
4132 OUT ULONG* BytesReturned
4133 ) PURE;
4134 };
4135
4136 #undef INTERFACE
4137 typedef IKsControl* PIKSCONTROL;
4138
4139 #endif
4140
4141 KSDDKAPI
4142 VOID
4143 NTAPI
4144 KsDeviceRegisterAdapterObject(
4145 IN PKSDEVICE Device,
4146 IN PADAPTER_OBJECT AdapterObject,
4147 IN ULONG MaxMappingByteCount,
4148 IN ULONG MappingTableStride);
4149
4150 KSDDKAPI
4151 ULONG
4152 NTAPI
4153 KsDeviceSetBusData(
4154 IN PKSDEVICE Device,
4155 IN ULONG DataType,
4156 IN PVOID Buffer,
4157 IN ULONG Offset,
4158 IN ULONG Length);
4159
4160
4161 KSDDKAPI
4162 VOID
4163 NTAPI
4164 KsReleaseControl(
4165 IN PVOID Object
4166 );
4167
4168 #define KsDiscard(object, pointer) \
4169 KsRemoveItemFromObjectBag(object->Bag, pointer, TRUE)
4170
4171 #define KsFilterAcquireControl(Filter) \
4172 KsAcquireControl((PVOID) Filter);
4173
4174 #define KsFilterReleaseControl(Filter) \
4175 KsReleaseControl((PVOID) Filter);
4176
4177 #define KsFilterAddEvent(Filter, EventEntry) \
4178 KsAddEvent(Filter,EventEntry);
4179
4180 KSDDKAPI
4181 VOID
4182 NTAPI
4183 KsFilterAcquireProcessingMutex(
4184 IN PKSFILTER Filter);
4185
4186
4187 KSDDKAPI
4188 NTSTATUS
4189 NTAPI
4190 KsFilterAddTopologyConnections(
4191 IN PKSFILTER Filter,
4192 IN ULONG NewConnectionsCount,
4193 IN const KSTOPOLOGY_CONNECTION *const NewTopologyConnections);
4194
4195 KSDDKAPI
4196 VOID
4197 NTAPI
4198 KsFilterAttemptProcessing(
4199 IN PKSFILTER Filter,
4200 IN BOOLEAN Asynchronous);
4201
4202 KSDDKAPI
4203 NTSTATUS
4204 NTAPI
4205 KsFilterCreateNode(
4206 IN PKSFILTER Filter,
4207 IN const KSNODE_DESCRIPTOR *const NodeDescriptor,
4208 OUT PULONG NodeID);
4209
4210 KSDDKAPI
4211 NTSTATUS
4212 NTAPI
4213 KsFilterCreatePinFactory(
4214 IN PKSFILTER Filter,
4215 IN const KSPIN_DESCRIPTOR_EX *const PinDescriptor,
4216 OUT PULONG PinID);
4217
4218 KSDDKAPI
4219 PKSDEVICE
4220 __inline
4221 KsFilterFactoryGetDevice(
4222 IN PKSFILTERFACTORY FilterFactory);
4223
4224 /* etc. */
4225 #endif /* avstream */
4226
4227 #ifdef __cplusplus
4228 }
4229 #endif
4230
4231 #endif