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