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