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