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