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