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