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