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