ReactOS 0.4.15-dev-7907-g95bf896
ks.h
Go to the documentation of this file.
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
34extern "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_)
58typedef 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
71#ifndef DEFINE_GUIDEX
72#ifdef _MSC_VER
73#define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name
74#else
75#define DEFINE_GUIDEX(name) EXTERN_C const GUID name
76#endif
77#endif /* !DEFINE_GUIDEX */
78
79#ifndef STATICGUIDOF
80#define STATICGUIDOF(guid) STATIC_##guid
81#endif
82
83#endif /* !_NTRTL_ */
84
85#if defined(__cplusplus)
86
87#if _MSC_VER >= 1100
88#define DEFINE_GUIDSTRUCT(guid, name) struct __declspec(uuid(guid)) name
89#define DEFINE_GUIDNAMED(name) __uuidof(struct name)
90#else
91#define DEFINE_GUIDSTRUCT(guid, name) \
92 extern const DECLSPEC_SELECTANY GUID __uuid__##name={STATIC_##name};
93#define DEFINE_GUIDNAMED(name) __uuid__##name
94#endif
95
96#else /* __cplusplus */
97
98#define DEFINE_GUIDSTRUCT(guid, name) DEFINE_GUIDEX(name)
99#define DEFINE_GUIDNAMED(name) name
100
101#endif /* __cplusplus */
102
103#define STATIC_GUID_NULL \
104 0x00000000L, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
105DEFINE_GUIDSTRUCT("00000000-0000-0000-0000-000000000000", GUID_NULL);
106#define GUID_NULL DEFINE_GUIDNAMED(GUID_NULL)
107
108#define STATIC_KSNAME_Filter\
109 0x9b365890L, 0x165f, 0x11d0, {0xa1, 0x95, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4}
110DEFINE_GUIDSTRUCT("9b365890-165f-11d0-a195-0020afd156e4", KSNAME_Filter);
111#define KSNAME_Filter DEFINE_GUIDNAMED(KSNAME_Filter)
112
113#define STATIC_KSMEMORY_TYPE_KERNEL_PAGED \
114 0xd833f8f8L, 0x7894, 0x11d1, {0xb0, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02}
115DEFINE_GUIDSTRUCT("d833f8f8-7894-11d1-b069-00a0c9062802", KSMEMORY_TYPE_KERNEL_PAGED);
116#define KSMEMORY_TYPE_KERNEL_PAGED DEFINE_GUIDNAMED(KSMEMORY_TYPE_KERNEL_PAGED)
117
118#define STATIC_KSDATAFORMAT_SUBTYPE_NONE \
119 0xe436eb8eL, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}
120DEFINE_GUIDSTRUCT("e436eb8e-524f-11ce-9f53-0020af0ba770", KSDATAFORMAT_SUBTYPE_NONE);
121#define KSDATAFORMAT_SUBTYPE_NONE DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_NONE)
122
123/* ===============================================================
124 I/O Control Codes
125*/
126
127#define IOCTL_KS_PROPERTY \
128 CTL_CODE(FILE_DEVICE_KS, 0x000, METHOD_NEITHER, FILE_ANY_ACCESS)
129
130#define IOCTL_KS_ENABLE_EVENT \
131 CTL_CODE(FILE_DEVICE_KS, 0x001, METHOD_NEITHER, FILE_ANY_ACCESS)
132
133#define IOCTL_KS_DISABLE_EVENT \
134 CTL_CODE(FILE_DEVICE_KS, 0x002, METHOD_NEITHER, FILE_ANY_ACCESS)
135
136#define IOCTL_KS_METHOD \
137 CTL_CODE(FILE_DEVICE_KS, 0x003, METHOD_NEITHER, FILE_ANY_ACCESS)
138
139#define IOCTL_KS_WRITE_STREAM \
140 CTL_CODE(FILE_DEVICE_KS, 0x004, METHOD_NEITHER, FILE_WRITE_ACCESS)
141
142#define IOCTL_KS_READ_STREAM \
143 CTL_CODE(FILE_DEVICE_KS, 0x005, METHOD_NEITHER, FILE_READ_ACCESS)
144
145#define IOCTL_KS_RESET_STATE \
146 CTL_CODE(FILE_DEVICE_KS, 0x006, METHOD_NEITHER, FILE_ANY_ACCESS)
147
148/* ===============================================================
149 Categories
150*/
151
152#define STATIC_KSCATEGORY_BRIDGE \
153 0x085AFF00L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
154DEFINE_GUIDSTRUCT("085AFF00-62CE-11CF-A5D6-28DB04C10000", KSCATEGORY_BRIDGE);
155#define KSCATEGORY_BRIDGE DEFINE_GUIDNAMED(KSCATEGORY_BRIDGE)
156
157#define STATIC_KSCATEGORY_CAPTURE \
158 0x65E8773DL, 0x8F56, 0x11D0, {0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
159DEFINE_GUIDSTRUCT("65E8773D-8F56-11D0-A3B9-00A0C9223196", KSCATEGORY_CAPTURE);
160#define KSCATEGORY_CAPTURE DEFINE_GUIDNAMED(KSCATEGORY_CAPTURE)
161
162#define STATIC_KSCATEGORY_RENDER \
163 0x65E8773EL, 0x8F56, 0x11D0, {0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
164DEFINE_GUIDSTRUCT("65E8773E-8F56-11D0-A3B9-00A0C9223196", KSCATEGORY_RENDER);
165#define KSCATEGORY_RENDER DEFINE_GUIDNAMED(KSCATEGORY_RENDER)
166
167#define STATIC_KSCATEGORY_MIXER \
168 0xAD809C00L, 0x7B88, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
169DEFINE_GUIDSTRUCT("AD809C00-7B88-11D0-A5D6-28DB04C10000", KSCATEGORY_MIXER);
170#define KSCATEGORY_MIXER DEFINE_GUIDNAMED(KSCATEGORY_MIXER)
171
172#define STATIC_KSCATEGORY_SPLITTER \
173 0x0A4252A0L, 0x7E70, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
174DEFINE_GUIDSTRUCT("0A4252A0-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_SPLITTER);
175#define KSCATEGORY_SPLITTER DEFINE_GUIDNAMED(KSCATEGORY_SPLITTER)
176
177#define STATIC_KSCATEGORY_DATACOMPRESSOR \
178 0x1E84C900L, 0x7E70, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
179DEFINE_GUIDSTRUCT("1E84C900-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_DATACOMPRESSOR);
180#define KSCATEGORY_DATACOMPRESSOR DEFINE_GUIDNAMED(KSCATEGORY_DATACOMPRESSOR)
181
182#define STATIC_KSCATEGORY_DATADECOMPRESSOR \
183 0x2721AE20L, 0x7E70, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
184DEFINE_GUIDSTRUCT("2721AE20-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_DATADECOMPRESSOR);
185#define KSCATEGORY_DATADECOMPRESSOR DEFINE_GUIDNAMED(KSCATEGORY_DATADECOMPRESSOR)
186
187#define STATIC_KSCATEGORY_DATATRANSFORM \
188 0x2EB07EA0L, 0x7E70, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
189DEFINE_GUIDSTRUCT("2EB07EA0-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_DATATRANSFORM);
190#define KSCATEGORY_DATATRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_DATATRANSFORM)
191
192#define STATIC_KSCATEGORY_COMMUNICATIONSTRANSFORM \
193 0xCF1DDA2CL, 0x9743, 0x11D0, {0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
194DEFINE_GUIDSTRUCT("CF1DDA2C-9743-11D0-A3EE-00A0C9223196", KSCATEGORY_COMMUNICATIONSTRANSFORM);
195#define KSCATEGORY_COMMUNICATIONSTRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_COMMUNICATIONSTRANSFORM)
196
197#define STATIC_KSCATEGORY_INTERFACETRANSFORM \
198 0xCF1DDA2DL, 0x9743, 0x11D0, {0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
199DEFINE_GUIDSTRUCT("CF1DDA2D-9743-11D0-A3EE-00A0C9223196", KSCATEGORY_INTERFACETRANSFORM);
200#define KSCATEGORY_INTERFACETRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_INTERFACETRANSFORM)
201
202#define STATIC_KSCATEGORY_MEDIUMTRANSFORM \
203 0xCF1DDA2EL, 0x9743, 0x11D0, {0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
204DEFINE_GUIDSTRUCT("CF1DDA2E-9743-11D0-A3EE-00A0C9223196", KSCATEGORY_MEDIUMTRANSFORM);
205#define KSCATEGORY_MEDIUMTRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_MEDIUMTRANSFORM)
206
207#define STATIC_KSCATEGORY_FILESYSTEM \
208 0x760FED5EL, 0x9357, 0x11D0, {0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
209DEFINE_GUIDSTRUCT("760FED5E-9357-11D0-A3CC-00A0C9223196", KSCATEGORY_FILESYSTEM);
210#define KSCATEGORY_FILESYSTEM DEFINE_GUIDNAMED(KSCATEGORY_FILESYSTEM)
211
212#define STATIC_KSCATEGORY_CLOCK \
213 0x53172480L, 0x4791, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
214DEFINE_GUIDSTRUCT("53172480-4791-11D0-A5D6-28DB04C10000", KSCATEGORY_CLOCK);
215#define KSCATEGORY_CLOCK DEFINE_GUIDNAMED(KSCATEGORY_CLOCK)
216
217#define STATIC_KSCATEGORY_PROXY \
218 0x97EBAACAL, 0x95BD, 0x11D0, {0xA3, 0xEA, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
219DEFINE_GUIDSTRUCT("97EBAACA-95BD-11D0-A3EA-00A0C9223196", KSCATEGORY_PROXY);
220#define KSCATEGORY_PROXY DEFINE_GUIDNAMED(KSCATEGORY_PROXY)
221
222#define STATIC_KSCATEGORY_QUALITY \
223 0x97EBAACBL, 0x95BD, 0x11D0, {0xA3, 0xEA, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
224DEFINE_GUIDSTRUCT("97EBAACB-95BD-11D0-A3EA-00A0C9223196", KSCATEGORY_QUALITY);
225#define KSCATEGORY_QUALITY DEFINE_GUIDNAMED(KSCATEGORY_QUALITY)
226
227/* ===============================================================
228 Common
229*/
230
231typedef struct {
232 GUID Set;
233 ULONG Id;
234 ULONG Flags;
236
240
242
245
246typedef union {
247 struct {
248 ULONG FormatSize;
249 ULONG Flags;
250 ULONG SampleSize;
252 GUID MajorFormat;
253 GUID SubFormat;
254 GUID Specifier;
255 };
258
259typedef struct {
264
265
266/* ===============================================================
267 Interface Sets - TODO
268*/
269
270#if 0
271#define KSINTERFACESETID_Media
272#define KSINTERFACE_STANDARD_STREAMING
273#define KSINTERFACE_STANDARD_LOOPED_STREAMING
274#define KSINTERFACE_STANDARD_CONTROL
275#endif
276
277#define STATIC_KSINTERFACESETID_Standard \
278 0x1A8766A0L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
279DEFINE_GUIDSTRUCT("1A8766A0-62CE-11CF-A5D6-28DB04C10000", KSINTERFACESETID_Standard);
280#define KSINTERFACESETID_Standard DEFINE_GUIDNAMED(KSINTERFACESETID_Standard)
281
282typedef enum {
287
288#define STATIC_KSINTERFACESETID_FileIo \
289 0x8C6F932CL, 0xE771, 0x11D0, {0xB8, 0xFF, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
290DEFINE_GUIDSTRUCT("8C6F932C-E771-11D0-B8FF-00A0C9223196", KSINTERFACESETID_FileIo);
291#define KSINTERFACESETID_FileIo DEFINE_GUIDNAMED(KSINTERFACESETID_FileIo)
292
293/* ===============================================================
294 Mediums
295*/
296
297typedef enum {
300
301#define KSMEDIUM_TYPE_ANYINSTANCE 0
302
303#define STATIC_KSMEDIUMSETID_Standard \
304 0x4747B320L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
305DEFINE_GUIDSTRUCT("4747B320-62CE-11CF-A5D6-28DB04C10000", KSMEDIUMSETID_Standard);
306#define KSMEDIUMSETID_Standard DEFINE_GUIDNAMED(KSMEDIUMSETID_Standard)
307
308/* ===============================================================
309 Clock Properties/Methods/Events
310*/
311
312#define STATIC_KSPROPSETID_Clock \
313 0xDF12A4C0L, 0xAC17, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
314DEFINE_GUIDSTRUCT("DF12A4C0-AC17-11CF-A5D6-28DB04C10000", KSPROPSETID_Clock);
315#define KSPROPSETID_Clock DEFINE_GUIDNAMED(KSPROPSETID_Clock)
316
317typedef enum {
324#if defined(_NTDDK_)
325 KSPROPERTY_CLOCK_FUNCTIONTABLE
326#endif // defined(_NTDDK_)
328
329#define STATIC_KSEVENTSETID_Clock \
330 0x364D8E20L, 0x62C7, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
331DEFINE_GUIDSTRUCT("364D8E20-62C7-11CF-A5D6-28DB04C10000", KSEVENTSETID_Clock);
332#define KSEVENTSETID_Clock DEFINE_GUIDNAMED(KSEVENTSETID_Clock)
333
334typedef enum {
338
339/* ===============================================================
340 Connection Properties/Methods/Events
341*/
342
343#define STATIC_KSPROPSETID_Connection \
344 0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
345DEFINE_GUIDSTRUCT("1D58C920-AC9B-11CF-A5D6-28DB04C10000", KSPROPSETID_Connection);
346#define KSPROPSETID_Connection DEFINE_GUIDNAMED(KSPROPSETID_Connection)
347
348typedef enum {
358
359#define DEFINE_KSPROPERTY_ITEM_CONNECTION_STATE(GetHandler, SetHandler)\
360 DEFINE_KSPROPERTY_ITEM(\
361 KSPROPERTY_CONNECTION_STATE,\
362 (GetHandler),\
363 sizeof(KSPROPERTY),\
364 sizeof(KSSTATE),\
365 (SetHandler),\
366 NULL, 0, NULL, NULL, 0)
367
368#define DEFINE_KSPROPERTY_ITEM_CONNECTION_PRIORITY(GetHandler, SetHandler)\
369 DEFINE_KSPROPERTY_ITEM(\
370 KSPROPERTY_CONNECTION_PRIORITY,\
371 (GetHandler),\
372 sizeof(KSPROPERTY),\
373 sizeof(KSPRIORITY),\
374 (SetHandler),\
375 NULL, 0, NULL, NULL, 0)
376
377#define DEFINE_KSPROPERTY_ITEM_CONNECTION_DATAFORMAT(GetHandler, SetHandler)\
378 DEFINE_KSPROPERTY_ITEM(\
379 KSPROPERTY_CONNECTION_DATAFORMAT,\
380 (GetHandler),\
381 sizeof(KSPROPERTY),\
382 0,\
383 (SetHandler),\
384 NULL, 0, NULL, NULL, 0)
385
386#define DEFINE_KSPROPERTY_ITEM_CONNECTION_ALLOCATORFRAMING(Handler)\
387 DEFINE_KSPROPERTY_ITEM(\
388 KSPROPERTY_CONNECTION_ALLOCATORFRAMING,\
389 (Handler),\
390 sizeof(KSPROPERTY),\
391 sizeof(KSALLOCATOR_FRAMING),\
392 NULL, NULL, 0, NULL, NULL, 0)
393
394#define DEFINE_KSPROPERTY_ITEM_CONNECTION_ALLOCATORFRAMING_EX(Handler)\
395 DEFINE_KSPROPERTY_ITEM(\
396 KSPROPERTY_CONNECTION_ALLOCATORFRAMING_EX,\
397 (Handler),\
398 sizeof(KSPROPERTY),\
399 0,\
400 NULL, NULL, 0, NULL, NULL, 0)
401
402#define DEFINE_KSPROPERTY_ITEM_CONNECTION_PROPOSEDATAFORMAT(Handler)\
403 DEFINE_KSPROPERTY_ITEM(\
404 KSPROPERTY_CONNECTION_PROPOSEDATAFORMAT,\
405 NULL,\
406 sizeof(KSPROPERTY),\
407 sizeof(KSDATAFORMAT),\
408 (Handler),\
409 NULL, 0, NULL, NULL, 0)
410
411#define DEFINE_KSPROPERTY_ITEM_CONNECTION_ACQUIREORDERING(Handler)\
412 DEFINE_KSPROPERTY_ITEM(\
413 KSPROPERTY_CONNECTION_ACQUIREORDERING,\
414 (Handler),\
415 sizeof(KSPROPERTY),\
416 sizeof(int),\
417 NULL, NULL, 0, NULL, NULL, 0)
418
419#define DEFINE_KSPROPERTY_ITEM_CONNECTION_STARTAT(Handler)\
420 DEFINE_KSPROPERTY_ITEM(\
421 KSPROPERTY_CONNECTION_STARTAT,\
422 NULL,\
423 sizeof(KSPROPERTY),\
424 sizeof(KSRELATIVEEVENT),\
425 (Handler),\
426 NULL, 0, NULL, NULL, 0)
427
428typedef enum {
435
436/* ===============================================================
437 General
438 Properties/Methods/Events
439*/
440
441#define STATIC_KSPROPSETID_General\
442 0x1464EDA5L, 0x6A8F, 0x11D1, {0x9A, 0xA7, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
443DEFINE_GUIDSTRUCT("1464EDA5-6A8F-11D1-9AA7-00A0C9223196", KSPROPSETID_General);
444#define KSPROPSETID_General DEFINE_GUIDNAMED(KSPROPSETID_General)
445
446typedef enum {
449
450/* ===============================================================
451 Graph Manager
452 Properties/Methods/Events
453*/
454
455#define KSPROPSETID_GM \
456 0xAF627536L, 0xE719, 0x11D2, {0x8A, 0x1D, 0x00, 0x60, 0x97, 0xD2, 0xDF, 0x5D}
457
458typedef enum {
464
465/* ===============================================================
466 Media Seeking
467 Properties/Methods/Events
468*/
469
470#define STATIC_KSPROPSETID_MediaSeeking\
471 0xEE904F0CL, 0xD09B, 0x11D0, {0xAB, 0xE9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
472DEFINE_GUIDSTRUCT("EE904F0C-D09B-11D0-ABE9-00A0C9223196", KSPROPSETID_MediaSeeking);
473#define KSPROPSETID_MediaSeeking DEFINE_GUIDNAMED(KSPROPSETID_MediaSeeking)
474
475typedef enum {
487
488typedef enum {
497
498typedef enum {
507
508typedef struct {
514
515typedef struct {
519
520typedef struct {
526
527#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_CAPABILITIES(Handler)\
528 DEFINE_KSPROPERTY_ITEM(\
529 KSPROPERTY_MEDIASEEKING_CAPABILITIES,\
530 (Handler),\
531 sizeof(KSPROPERTY),\
532 sizeof(KS_SEEKING_CAPABILITIES),\
533 NULL, NULL, 0, NULL, NULL, 0)
534
535#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_FORMATS(Handler)\
536 DEFINE_KSPROPERTY_ITEM(\
537 KSPROPERTY_MEDIASEEKING_FORMATS,\
538 (Handler),\
539 sizeof(KSPROPERTY),\
540 0,\
541 NULL, NULL, 0, NULL, NULL, 0)
542
543#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_TIMEFORMAT(GetHandler, SetHandler)\
544 DEFINE_KSPROPERTY_ITEM(\
545 KSPROPERTY_MEDIASEEKING_TIMEFORMAT,\
546 (GetHandler),\
547 sizeof(KSPROPERTY),\
548 sizeof(GUID),\
549 (SetHandler),\
550 NULL, 0, NULL, NULL, 0)
551
552#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_POSITION(Handler)\
553 DEFINE_KSPROPERTY_ITEM(\
554 KSPROPERTY_MEDIASEEKING_POSITION,\
555 (Handler),\
556 sizeof(KSPROPERTY),\
557 sizeof(LONGLONG),\
558 NULL, NULL, 0, NULL, NULL, 0)
559
560#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_STOPPOSITION(Handler)\
561 DEFINE_KSPROPERTY_ITEM(\
562 KSPROPERTY_MEDIASEEKING_STOPPOSITION,\
563 (Handler),\
564 sizeof(KSPROPERTY),\
565 sizeof(LONGLONG),\
566 NULL, NULL, 0, NULL, NULL, 0)
567
568#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_POSITIONS(Handler)\
569 DEFINE_KSPROPERTY_ITEM(\
570 KSPROPERTY_MEDIASEEKING_POSITIONS,\
571 NULL,\
572 sizeof(KSPROPERTY),\
573 sizeof(KSPROPERTY_POSITIONS),\
574 (Handler),\
575 NULL, 0, NULL, NULL, 0)
576
577#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_DURATION(Handler)\
578 DEFINE_KSPROPERTY_ITEM(\
579 KSPROPERTY_MEDIASEEKING_DURATION,\
580 (Handler),\
581 sizeof(KSPROPERTY),\
582 sizeof(LONGLONG),\
583 NULL, NULL, 0, NULL, NULL, 0)
584
585#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_AVAILABLE(Handler)\
586 DEFINE_KSPROPERTY_ITEM(\
587 KSPROPERTY_MEDIASEEKING_AVAILABLE,\
588 (Handler),\
589 sizeof(KSPROPERTY),\
590 sizeof(KSPROPERTY_MEDIAAVAILABLE),\
591 NULL, NULL, 0, NULL, NULL, 0)
592
593#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_PREROLL(Handler)\
594 DEFINE_KSPROPERTY_ITEM(\
595 KSPROPERTY_MEDIASEEKING_PREROLL,\
596 (Handler),\
597 sizeof(KSPROPERTY),\
598 sizeof(LONGLONG),\
599 NULL, NULL, 0, NULL, NULL, 0)
600
601#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_CONVERTTIMEFORMAT(Handler)\
602 DEFINE_KSPROPERTY_ITEM(\
603 KSPROPERTY_MEDIASEEKING_CONVERTTIMEFORMAT,\
604 (Handler),\
605 sizeof(KSP_TIMEFORMAT),\
606 sizeof(LONGLONG),\
607 NULL, NULL, 0, NULL, NULL, 0)
608
609/* ===============================================================
610 Pin
611 Properties/Methods/Events
612*/
613
614#define STATIC_KSPROPSETID_Pin\
615 0x8C134960L, 0x51AD, 0x11CF, {0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00}
616DEFINE_GUIDSTRUCT("8C134960-51AD-11CF-878A-94F801C10000", KSPROPSETID_Pin);
617#define KSPROPSETID_Pin DEFINE_GUIDNAMED(KSPROPSETID_Pin)
618
619#define STATIC_KSNAME_Pin\
620 0x146F1A80L, 0x4791, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
621DEFINE_GUIDSTRUCT("146F1A80-4791-11D0-A5D6-28DB04C10000", KSNAME_Pin);
622#define KSNAME_Pin DEFINE_GUIDNAMED(KSNAME_Pin)
623
624typedef enum {
641
642typedef struct {
647
648#define KSINSTANCE_INDETERMINATE ((ULONG)-1)
649
650typedef struct {
654
655typedef struct {
660
661/* ===============================================================
662 Quality
663 Properties/Methods/Events
664*/
665
666#define KSPROPSETID_Quality \
667 0xD16AD380L, 0xAC1A, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
668
669typedef enum {
673
674/* ===============================================================
675 Stream
676 Properties/Methods/Events
677*/
678
679#define STATIC_KSPROPSETID_Stream\
680 0x65aaba60L, 0x98ae, 0x11cf, {0xa1, 0x0d, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4}
681DEFINE_GUIDSTRUCT("65aaba60-98ae-11cf-a10d-0020afd156e4", KSPROPSETID_Stream);
682#define KSPROPSETID_Stream DEFINE_GUIDNAMED(KSPROPSETID_Stream)
683
684typedef enum {
697
698#define DEFINE_KSPROPERTY_ITEM_STREAM_ALLOCATOR(GetHandler, SetHandler)\
699 DEFINE_KSPROPERTY_ITEM(\
700 KSPROPERTY_STREAM_ALLOCATOR,\
701 (GetHandler),\
702 sizeof(KSPROPERTY),\
703 sizeof(HANDLE),\
704 (SetHandler),\
705 NULL, 0, NULL, NULL, 0)
706
707#define DEFINE_KSPROPERTY_ITEM_STREAM_QUALITY(Handler)\
708 DEFINE_KSPROPERTY_ITEM(\
709 KSPROPERTY_STREAM_QUALITY,\
710 (Handler),\
711 sizeof(KSPROPERTY),\
712 sizeof(KSQUALITY_MANAGER),\
713 NULL, NULL, 0, NULL, NULL, 0)
714
715#define DEFINE_KSPROPERTY_ITEM_STREAM_DEGRADATION(GetHandler, SetHandler)\
716 DEFINE_KSPROPERTY_ITEM(\
717 KSPROPERTY_STREAM_DEGRADATION,\
718 (GetHandler),\
719 sizeof(KSPROPERTY),\
720 0,\
721 (SetHandler),\
722 NULL, 0, NULL, NULL, 0)
723
724#define DEFINE_KSPROPERTY_ITEM_STREAM_MASTERCLOCK(GetHandler, SetHandler)\
725 DEFINE_KSPROPERTY_ITEM(\
726 KSPROPERTY_STREAM_MASTERCLOCK,\
727 (GetHandler),\
728 sizeof(KSPROPERTY),\
729 sizeof(HANDLE),\
730 (SetHandler),\
731 NULL, 0, NULL, NULL, 0)
732
733#define DEFINE_KSPROPERTY_ITEM_STREAM_TIMEFORMAT(Handler)\
734 DEFINE_KSPROPERTY_ITEM(\
735 KSPROPERTY_STREAM_TIMEFORMAT,\
736 (Handler),\
737 sizeof(KSPROPERTY),\
738 sizeof(GUID),\
739 NULL, NULL, 0, NULL, NULL, 0)
740
741#define DEFINE_KSPROPERTY_ITEM_STREAM_PRESENTATIONTIME(GetHandler, SetHandler)\
742 DEFINE_KSPROPERTY_ITEM(\
743 KSPROPERTY_STREAM_PRESENTATIONTIME,\
744 (GetHandler),\
745 sizeof(KSPROPERTY),\
746 sizeof(KSTIME),\
747 (SetHandler),\
748 NULL, 0, NULL, NULL, 0)
749
750#define DEFINE_KSPROPERTY_ITEM_STREAM_PRESENTATIONEXTENT(Handler)\
751 DEFINE_KSPROPERTY_ITEM(\
752 KSPROPERTY_STREAM_PRESENTATIONEXTENT,\
753 (Handler),\
754 sizeof(KSPROPERTY),\
755 sizeof(LONGLONG),\
756 NULL, NULL, 0, NULL, NULL, 0)
757
758#define DEFINE_KSPROPERTY_ITEM_STREAM_FRAMETIME(Handler)\
759 DEFINE_KSPROPERTY_ITEM(\
760 KSPROPERTY_STREAM_FRAMETIME,\
761 (Handler),\
762 sizeof(KSPROPERTY),\
763 sizeof(KSFRAMETIME),\
764 NULL, NULL, 0, NULL, NULL, 0)
765
766#define DEFINE_KSPROPERTY_ITEM_STREAM_RATECAPABILITY(Handler)\
767 DEFINE_KSPROPERTY_ITEM(\
768 KSPROPERTY_STREAM_RATECAPABILITY,\
769 (Handler),\
770 sizeof(KSRATE_CAPABILITY),\
771 sizeof(KSRATE),\
772 NULL, NULL, 0, NULL, NULL, 0)
773
774#define DEFINE_KSPROPERTY_ITEM_STREAM_RATE(GetHandler, SetHandler)\
775 DEFINE_KSPROPERTY_ITEM(\
776 KSPROPERTY_STREAM_RATE,\
777 (GetHandler),\
778 sizeof(KSPROPERTY),\
779 sizeof(KSRATE),\
780 (SetHandler),\
781 NULL, 0, NULL, NULL, 0)
782
783#define DEFINE_KSPROPERTY_ITEM_STREAM_PIPE_ID(GetHandler, SetHandler)\
784 DEFINE_KSPROPERTY_ITEM(\
785 KSPROPERTY_STREAM_PIPE_ID,\
786 (GetHandler),\
787 sizeof(KSPROPERTY),\
788 sizeof(HANDLE),\
789 (SetHandler),\
790 NULL, 0, NULL, NULL, 0)
791
792/* ===============================================================
793 StreamAllocator
794 Properties/Methods/Events
795*/
796
797#define STATIC_KSPROPSETID_StreamAllocator\
798 0xcf6e4342L, 0xec87, 0x11cf, {0xa1, 0x30, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4}
799DEFINE_GUIDSTRUCT("cf6e4342-ec87-11cf-a130-0020afd156e4", KSPROPSETID_StreamAllocator);
800#define KSPROPSETID_StreamAllocator DEFINE_GUIDNAMED(KSPROPSETID_StreamAllocator)
801
802typedef enum {
806
807#define KSMETHODSETID_StreamAllocator \
808 0xcf6e4341L, 0xec87, 0x11cf, {0xa1, 0x30, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4}
809
810typedef enum {
814
815#define KSEVENTSETID_StreamAllocator
816
817typedef enum {
821
822/* ===============================================================
823 StreamInterface
824 Properties/Methods/Events
825*/
826
827#define KSPROPSETID_StreamInterface \
828 0x1fdd8ee1L, 0x9cd3, 0x11d0, 0x82, 0xaa, 0x00, 0x00, 0xf8, 0x22, 0xfe, 0x8a
829
830typedef enum {
833
834/* ===============================================================
835 Topology
836 Properties/Methods/Events
837*/
838
839#define STATIC_KSPROPSETID_Topology\
840 0x720D4AC0L, 0x7533, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
841DEFINE_GUIDSTRUCT("720D4AC0-7533-11D0-A5D6-28DB04C10000", KSPROPSETID_Topology);
842#define KSPROPSETID_Topology DEFINE_GUIDNAMED(KSPROPSETID_Topology)
843
844typedef enum {
850
851/* ===============================================================
852 Property Sets for audio drivers - TODO
853*/
854
855#define STATIC_KSPROPTYPESETID_General \
856 0x97E99BA0L, 0xBDEA, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
857DEFINE_GUIDSTRUCT("97E99BA0-BDEA-11CF-A5D6-28DB04C10000", KSPROPTYPESETID_General);
858#define KSPROPTYPESETID_General DEFINE_GUIDNAMED(KSPROPTYPESETID_General)
859
860/*
861 KSPROPERTY_AC3_ALTERNATE_AUDIO
862 KSPROPERTY_AC3_BIT_STREAM_MODE
863 KSPROPERTY_AC3_DIALOGUE_LEVEL
864 KSPROPERTY_AC3_DOWNMIX
865 KSPROPERTY_AC3_ERROR_CONCEALMENT
866 KSPROPERTY_AC3_LANGUAGE_CODE
867 KSPROPERTY_AC3_ROOM_TYPE
868*/
869
870#define KSPROPSETID_Acoustic_Echo_Cancel
871/*
872 KSPROPERTY_AEC_MODE
873 KSPROPERTY_AEC_NOISE_FILL_ENABLE
874 KSPROPERTY_AEC_STATUS
875*/
876
877/*
878 KSPROPERTY_AUDIO_3D_INTERFACE
879 KSPROPERTY_AUDIO_AGC
880 KSPROPERTY_AUDIO_ALGORITHM_INSTANCE
881 KSPROPERTY_AUDIO_BASS
882 KSPROPERTY_AUDIO_BASS_BOOST
883 KSPROPERTY_AUDIO_CHANNEL_CONFIG
884 KSPROPERTY_AUDIO_CHORUS_LEVEL
885 KSPROPERTY_AUDIO_COPY_PROTECTION
886 KSPROPERTY_AUDIO_CPU_RESOURCES
887 KSPROPERTY_AUDIO_DELAY
888 KSPROPERTY_AUDIO_DEMUX_DEST
889 KSPROPERTY_AUDIO_DEV_SPECIFIC
890 KSPROPERTY_AUDIO_DYNAMIC_RANGE
891 KSPROPERTY_AUDIO_DYNAMIC_SAMPLING_RATE
892 KSPROPERTY_AUDIO_EQ_BANDS
893 KSPROPERTY_AUDIO_EQ_LEVEL
894 KSPROPERTY_AUDIO_FILTER_STATE
895 KSPROPERTY_AUDIO_LATENCY
896 KSPROPERTY_AUDIO_LOUDNESS
897 KSPROPERTY_AUDIO_MANUFACTURE_GUID
898 KSPROPERTY_AUDIO_MID
899 KSPROPERTY_AUDIO_MIX_LEVEL_CAPS
900 KSPROPERTY_AUDIO_MIX_LEVEL_TABLE
901 KSPROPERTY_AUDIO_MUTE
902 KSPROPERTY_AUDIO_MUX_SOURCE
903 KSPROPERTY_AUDIO_NUM_EQ_BANDS
904 KSPROPERTY_AUDIO_PEAKMETER
905 KSPROPERTY_AUDIO_POSITION
906 KSPROPERTY_AUDIO_PREFERRED_STATUS
907 KSPROPERTY_AUDIO_PRODUCT_GUID
908 KSPROPERTY_AUDIO_QUALITY
909 KSPROPERTY_AUDIO_REVERB_LEVEL
910 KSPROPERTY_AUDIO_SAMPLING_RATE
911 KSPROPERTY_AUDIO_STEREO_ENHANCE
912 KSPROPERTY_AUDIO_STEREO_SPEAKER_GEOMETRY
913 KSPROPERTY_AUDIO_SURROUND_ENCODE
914 KSPROPERTY_AUDIO_TREBLE
915 KSPROPERTY_AUDIO_VOLUMELEVEL
916 KSPROPERTY_AUDIO_WIDE_MODE
917 KSPROPERTY_AUDIO_WIDENESS
918*/
919
920#define KSPROPSETID_AudioGfx
921/*
922 KSPROPERTY_AUDIOGFX_CAPTURETARGETDEVICEID
923 KSPROPERTY_AUDIOGFX_RENDERTARGETDEVICEID
924*/
925
926#define KSPROPSETID_DirectSound3DBuffer
927/*
928 KSPROPERTY_DIRECTSOUND3DBUFFER_ALL
929 KSPROPERTY_DIRECTSOUND3DBUFFER_CONEANGLES
930 KSPROPERTY_DIRECTSOUND3DBUFFER_CONEORIENTATION
931 KSPROPERTY_DIRECTSOUND3DBUFFER_CONEOUTSIDEVOLUME
932 KSPROPERTY_DIRECTSOUND3DBUFFER_MAXDISTANCE
933 KSPROPERTY_DIRECTSOUND3DBUFFER_MINDISTANCE
934 KSPROPERTY_DIRECTSOUND3DBUFFER_MODE
935 KSPROPERTY_DIRECTSOUND3DBUFFER_POSITION
936 KSPROPERTY_DIRECTSOUND3DBUFFER_VELOCITY
937*/
938
939#define KSPROPSETID_DirectSound3DListener
940/*
941 KSPROPERTY_DIRECTSOUND3DLISTENER_ALL
942 KSPROPERTY_DIRECTSOUND3DLISTENER_ALLOCATION
943 KSPROPERTY_DIRECTSOUND3DLISTENER_BATCH
944 KSPROPERTY_DIRECTSOUND3DLISTENER_DISTANCEFACTOR
945 KSPROPERTY_DIRECTSOUND3DLISTENER_DOPPLERFACTOR
946 KSPROPERTY_DIRECTSOUND3DLISTENER_ORIENTATION
947 KSPROPERTY_DIRECTSOUND3DLISTENER_POSITION
948 KSPROPERTY_DIRECTSOUND3DLISTENER_ROLLOFFFACTOR
949 KSPROPERTY_DIRECTSOUND3DLISTENER_VELOCITY
950*/
951
952#define KSPROPSETID_Hrtf3d
953/*
954 KSPROPERTY_HRTF3D_FILTER_FORMAT
955 KSPROPERTY_HRTF3D_INITIALIZE
956 KSPROPERTY_HRTF3D_PARAMS
957*/
958
959#define KSPROPSETID_Itd3d
960/*
961 KSPROPERTY_ITD3D_PARAMS
962*/
963
964#define KSPROPSETID_TopologyNode
965/*
966 KSPROPERTY_TOPOLOGYNODE_ENABLE
967 KSPROPERTY_TOPOLOGYNODE_RESET
968*/
969
970
971/* ===============================================================
972 Node Types
973*/
974/*
975 KSNODETYPE_3D_EFFECTS
976 KSNODETYPE_ACOUSTIC_ECHO_CANCEL
977 KSNODETYPE_ADC
978 KSNODETYPE_AGC
979 KSNODETYPE_CHORUS
980 KSNODETYPE_DAC
981 KSNODETYPE_DELAY
982 KSNODETYPE_DEMUX
983 KSNODETYPE_DEV_SPECIFIC
984 KSNODETYPE_DMSYNTH
985 KSNODETYPE_DMSYNTH_CAPS
986 KSNODETYPE_DRM_DESCRAMBLE
987 KSNODETYPE_EQUALIZER
988 KSNODETYPE_LOUDNESS
989 KSNODETYPE_MUTE
990 KSNODETYPE_MUX
991 KSNODETYPE_PEAKMETER
992 KSNODETYPE_PROLOGIC_DECODER
993 KSNODETYPE_PROLOGIC_ENCODER
994 KSNODETYPE_REVERB
995 KSNODETYPE_SRC
996 KSNODETYPE_STEREO_ENHANCE
997 KSNODETYPE_STEREO_WIDE
998 KSNODETYPE_SUM
999 KSNODETYPE_SUPERMIX
1000 KSNODETYPE_SWMIDI
1001 KSNODETYPE_SWSYNTH
1002 KSNODETYPE_SYNTHESIZER
1003 KSNODETYPE_TONE
1004 KSNODETYPE_VOLUME
1005*/
1006
1008
1009/* ===============================================================
1010 Method Types
1011*/
1012
1013#define KSMETHOD_TYPE_NONE 0x00000000
1014#define KSMETHOD_TYPE_READ 0x00000001
1015#define KSMETHOD_TYPE_WRITE 0x00000002
1016#define KSMETHOD_TYPE_MODIFY 0x00000003
1017#define KSMETHOD_TYPE_SOURCE 0x00000004
1018#define KSMETHOD_TYPE_SEND 0x00000001
1019#define KSMETHOD_TYPE_SETSUPPORT 0x00000100
1020#define KSMETHOD_TYPE_BASICSUPPORT 0x00000200
1021
1022/* ===============================================================
1023 Property Types
1024*/
1025
1026#define KSPROPERTY_TYPE_GET 0x00000001
1027#define KSPROPERTY_TYPE_SET 0x00000002
1028#define KSPROPERTY_TYPE_SETSUPPORT 0x00000100
1029#define KSPROPERTY_TYPE_BASICSUPPORT 0x00000200
1030#define KSPROPERTY_TYPE_RELATIONS 0x00000400
1031#define KSPROPERTY_TYPE_SERIALIZESET 0x00000800
1032#define KSPROPERTY_TYPE_UNSERIALIZESET 0x00001000
1033#define KSPROPERTY_TYPE_SERIALIZERAW 0x00002000
1034#define KSPROPERTY_TYPE_UNSERIALIZERAW 0x00004000
1035#define KSPROPERTY_TYPE_SERIALIZESIZE 0x00008000
1036#define KSPROPERTY_TYPE_DEFAULT_VALUES 0x00010000
1037
1038/* ===============================================================
1039 Topology Methods/Properties
1040*/
1041
1042#define KSMETHOD_TYPE_TOPOLOGY 0x10000000
1043#define KSPROPERTY_TYPE_TOPOLOGY 0x10000000
1044
1045/*
1046#define DEFINE_KS_GUID(GA,GB,GC,GD,GE,GF,GG,GH,GI,GJ,GK) \
1047 DEFINE_GUID(??, 0x#GA#L, 0xGB, 0xGC, 0xGD, 0xGE, 0xGF, 0xGG, 0xGH, 0xGI, 0xGJ, 0xGK) \
1048 "GA-GB-GC-GDGE-GFGGGHGIGJGK"
1049*/
1050
1051/* ===============================================================
1052 KS Category GUIDs
1053
1054 BRIDGE - 0x085AFF00L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1055 CAPTURE - 0x65E8773DL, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
1056 RENDER - 0x65E8773EL, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
1057 MIXER - 0xAD809C00L, 0x7B88, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1058 SPLITTER - 0x0A4252A0L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1059 DATACOMPRESSOR - 0x1E84C900L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1060 DATADECOMPRESSOR - 0x2721AE20L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1061 DATATRANSFORM - 0x2EB07EA0L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1062 COMMUNICATIONSTRANSFORM - 0xCF1DDA2CL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
1063 INTERFACETRANSFORM - 0xCF1DDA2DL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
1064 MEDIUMTRANSFORM - 0xCF1DDA2EL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
1065 FILESYSTEM - 0x760FED5EL, 0x9357, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
1066 CLOCK - 0x53172480L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1067 PROXY - 0x97EBAACAL, 0x95BD, 0x11D0, 0xA3, 0xEA, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
1068 QUALITY - 0x97EBAACBL, 0x95BD, 0x11D0, 0xA3, 0xEA, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
1069*/
1070
1071/* ===============================================================
1072 KSNAME GUIDs (defined also as KSSTRING_Xxx L"{...}"
1073
1074 Filter - 0x9b365890L, 0x165f, 0x11d0, 0xa1, 0x95, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4
1075 Pin - 0x146F1A80L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1076 Clock - 0x53172480L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1077 Allocator - 0x642F5D00L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1078 TopologyNode - 0x0621061AL, 0xEE75, 0x11D0, 0xB9, 0x15, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
1079*/
1080
1081/* ===============================================================
1082 Interface GUIDs
1083
1084 Standard - 0x1A8766A0L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1085 FileIo - 0x8C6F932CL, 0xE771, 0x11D0, 0xB8, 0xFF, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
1086*/
1087
1088/* ===============================================================
1089 Medium Type GUIDs
1090
1091 Standard - 0x4747B320L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1092*/
1093
1094/* ===============================================================
1095 Property Set GUIDs
1096
1097 General - 0x1464EDA5L, 0x6A8F, 0x11D1, 0x9A, 0xA7, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
1098 StreamIo - 0x65D003CAL, 0x1523, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
1099 MediaSeeking - 0xEE904F0CL, 0xD09B, 0x11D0, 0xAB, 0xE9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
1100 Topology - 0x720D4AC0L, 0x7533, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1101 GM - 0xAF627536L, 0xE719, 0x11D2, 0x8A, 0x1D, 0x00, 0x60, 0x97, 0xD2, 0xDF, 0x5D
1102 Quality - 0xD16AD380L, 0xAC1A, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1103 Connection - 0x1D58C920L, 0xAC9B, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1104*/
1105
1106/* ===============================================================
1107 StreamAllocator Sets
1108
1109 Event set - 0x75d95571L, 0x073c, 0x11d0, 0xa1, 0x61, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4
1110 Method set - 0xcf6e4341L, 0xec87, 0x11cf, 0xa1, 0x30, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4
1111 Property set - 0xcf6e4342L, 0xec87, 0x11cf, 0xa1, 0x30, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4
1112*/
1113
1114/* ===============================================================
1115 StreamInterface Sets
1116
1117 Property set - 0x1fdd8ee1L, 0x9cd3, 0x11d0, 0x82, 0xaa, 0x00, 0x00, 0xf8, 0x22, 0xfe, 0x8a
1118*/
1119
1120/* ===============================================================
1121 Clock Sets
1122
1123 Property set - 0xDF12A4C0L, 0xAC17, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1124 Event sets - 0x364D8E20L, 0x62C7, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
1125*/
1126
1127/* ===============================================================
1128 Connection Sets
1129
1130 Event set - 0x7f4bcbe0L, 0x9ea5, 0x11cf, 0xa5, 0xd6, 0x28, 0xdb, 0x04, 0xc1, 0x00, 0x00
1131*/
1132
1133/* ===============================================================
1134 Time Format GUIDs
1135
1136 KSTIME_FORMAT_NONE (null guid)
1137 FRAME - 0x7b785570L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6
1138 BYTE - 0x7b785571L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6
1139 SAMPLE - 0x7b785572L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6
1140 FIELD - 0x7b785573L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6
1141 MEDIA_TIME - 0x7b785574L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6
1142*/
1143
1144/* ===============================================================
1145 Media Type GUIDs
1146
1147 NULL
1148 Stream -
1149 None -
1150
1151 TODO ...
1152*/
1153
1154#define STATIC_KSDATAFORMAT_SPECIFIER_NONE\
1155 0x0F6417D6L, 0xC318, 0x11D0, {0xA4, 0x3F, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
1156DEFINE_GUIDSTRUCT("0F6417D6-C318-11D0-A43F-00A0C9223196", KSDATAFORMAT_SPECIFIER_NONE);
1157#define KSDATAFORMAT_SPECIFIER_NONE DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_NONE)
1158
1159/* ===============================================================
1160 KSMEMORY_TYPE_xxx
1161
1162 WILDCARD, DONT_CARE = NULL
1163 SYSTEM - 0x091bb638L, 0x603f, 0x11d1, 0xb0, 0x67, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02
1164 USER - 0x8cb0fc28L, 0x7893, 0x11d1, 0xb0, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02
1165 KERNEL_PAGED - 0xd833f8f8L, 0x7894, 0x11d1, 0xb0, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02
1166 KERNEL_NONPAGED - 0x4a6d5fc4L, 0x7895, 0x11d1, 0xb0, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02
1167 DEVICE_UNKNOWN - 0x091bb639L, 0x603f, 0x11d1, 0xb0, 0x67, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02
1168*/
1169
1170/* ===============================================================
1171 Enums
1172 (values have been checked)
1173*/
1174
1175#ifndef _MSC_VER
1176
1177#define DEFINE_KSPROPERTY_ITEM(PropertyId, GetHandler,\
1178 MinProperty,\
1179 MinData,\
1180 SetHandler,\
1181 Values, RelationsCount, Relations, SupportHandler,\
1182 SerializedSize)\
1183{\
1184 PropertyId, {(PFNKSHANDLER)GetHandler}, MinProperty, MinData,\
1185 {(PFNKSHANDLER)SetHandler},\
1186 (PKSPROPERTY_VALUES)Values, RelationsCount, (PKSPROPERTY)Relations,\
1187 (PFNKSHANDLER)SupportHandler, (ULONG)SerializedSize\
1188}
1189
1190#else
1191
1192#define DEFINE_KSPROPERTY_ITEM(PropertyId, GetHandler,\
1193 MinProperty,\
1194 MinData,\
1195 SetHandler,\
1196 Values, RelationsCount, Relations, SupportHandler,\
1197 SerializedSize)\
1198{\
1199 PropertyId, (PFNKSHANDLER)GetHandler, MinProperty, MinData,\
1200 (PFNKSHANDLER)SetHandler,\
1201 (PKSPROPERTY_VALUES)Values, RelationsCount, (PKSPROPERTY)Relations,\
1202 (PFNKSHANDLER)SupportHandler, (ULONG)SerializedSize\
1203}
1204
1205#endif
1206
1207typedef enum {
1213
1214typedef enum {
1220
1221typedef enum {
1225
1226typedef enum {
1230
1231typedef enum {
1240
1241typedef enum {
1247
1248typedef enum {
1252
1253typedef enum {
1260
1261typedef enum {
1265
1266typedef enum {
1271
1272typedef enum {
1278
1279typedef enum {
1284
1285#if defined(_NTDDK_) && !defined(__wtypes_h__)
1286enum VARENUM {
1287 VT_EMPTY = 0,
1288 VT_NULL = 1,
1289 VT_I2 = 2,
1290 VT_I4 = 3,
1291 VT_R4 = 4,
1292 VT_R8 = 5,
1293 VT_CY = 6,
1294 VT_DATE = 7,
1295 VT_BSTR = 8,
1296 VT_DISPATCH = 9,
1297 VT_ERROR = 10,
1298 VT_BOOL = 11,
1299 VT_VARIANT = 12,
1300 VT_UNKNOWN = 13,
1301 VT_DECIMAL = 14,
1302 VT_I1 = 16,
1303 VT_UI1 = 17,
1304 VT_UI2 = 18,
1305 VT_UI4 = 19,
1306 VT_I8 = 20,
1307 VT_UI8 = 21,
1308 VT_INT = 22,
1309 VT_UINT = 23,
1310 VT_VOID = 24,
1311 VT_HRESULT = 25,
1312 VT_PTR = 26,
1313 VT_SAFEARRAY = 27,
1314 VT_CARRAY = 28,
1315 VT_USERDEFINED = 29,
1316 VT_LPSTR = 30,
1317 VT_LPWSTR = 31,
1318 VT_FILETIME = 64,
1319 VT_BLOB = 65,
1320 VT_STREAM = 66,
1321 VT_STORAGE = 67,
1322 VT_STREAMED_OBJECT = 68,
1323 VT_STORED_OBJECT = 69,
1324 VT_BLOB_OBJECT = 70,
1325 VT_CF = 71,
1326 VT_CLSID = 72,
1327 VT_VECTOR = 0x1000,
1328 VT_ARRAY = 0x2000,
1329 VT_BYREF = 0x4000,
1330 VT_RESERVED = 0x8000,
1331 VT_ILLEGAL = 0xffff,
1332 VT_ILLEGALMASKED = 0xfff,
1333 VT_TYPEMASK = 0xfff
1334};
1335#endif
1336
1337#define STATIC_KSDATAFORMAT_TYPE_WILDCARD STATIC_GUID_NULL
1338#define KSDATAFORMAT_TYPE_WILDCARD GUID_NULL
1339
1340#define STATIC_KSDATAFORMAT_SUBTYPE_WILDCARD STATIC_GUID_NULL
1341#define KSDATAFORMAT_SUBTYPE_WILDCARD GUID_NULL
1342
1343#define STATIC_KSDATAFORMAT_SPECIFIER_WILDCARD STATIC_GUID_NULL
1344#define KSDATAFORMAT_SPECIFIER_WILDCARD GUID_NULL
1345
1346/* ===============================================================
1347 Framing
1348*/
1349
1350typedef struct {
1355
1356typedef struct {
1361
1362typedef struct {
1374
1375typedef struct {
1380
1381/* ===============================================================
1382 Priorities
1383*/
1384
1385#define KSPRIORITY_LOW 0x00000001
1386#define KSPRIORITY_NORMAL 0x40000000
1387#define KSPRIORITY_HIGH 0x80000000
1388#define KSPRIORITY_EXCLUSIVE 0xFFFFFFFF
1389
1390typedef struct {
1394
1395/* ===============================================================
1396 Dispatch Table
1397 http://www.osronline.com/DDKx/stream/ks-struct_494j.htm
1398*/
1399
1400#if defined(_NTDDK_)
1401
1402typedef struct {
1408 PDRIVER_DISPATCH QuerySecurity;
1409 PDRIVER_DISPATCH SetSecurity;
1410 PFAST_IO_DEVICE_CONTROL FastDeviceIoControl;
1411 PFAST_IO_READ FastRead;
1412 PFAST_IO_WRITE FastWrite;
1413} KSDISPATCH_TABLE, *PKSDISPATCH_TABLE;
1414
1415#define KSCREATE_ITEM_IRP_STORAGE(Irp) (*(PKSOBJECT_CREATE_ITEM*)&(Irp)->Tail.Overlay.DriverContext[0])
1416#define KSEVENT_SET_IRP_STORAGE(Irp) (*(const KSEVENT_SET**)&(Irp)->Tail.Overlay.DriverContext[0])
1417#define KSEVENT_ITEM_IRP_STORAGE(Irp) (*(const KSEVENT_ITEM**)&(Irp)->Tail.Overlay.DriverContext[3])
1418#define KSEVENT_ENTRY_IRP_STORAGE(Irp) (*(PKSEVENT_ENTRY*)&(Irp)->Tail.Overlay.DriverContext[0])
1419#define KSMETHOD_SET_IRP_STORAGE(Irp) (*(const KSMETHOD_SET**)&(Irp)->Tail.Overlay.DriverContext[0])
1420#define KSMETHOD_ITEM_IRP_STORAGE(Irp) (*(const KSMETHOD_ITEM**)&(Irp)->Tail.Overlay.DriverContext[3])
1421#define KSMETHOD_TYPE_IRP_STORAGE(Irp) (*(ULONG_PTR*)(&(Irp)->Tail.Overlay.DriverContext[2]))
1422#define KSQUEUE_SPINLOCK_IRP_STORAGE(Irp) (*(PKSPIN_LOCK*)&(Irp)->Tail.Overlay.DriverContext[1])
1423#define KSPROPERTY_SET_IRP_STORAGE(Irp) (*(const KSPROPERTY_SET**)&(Irp)->Tail.Overlay.DriverContext[0])
1424#define KSPROPERTY_ITEM_IRP_STORAGE(Irp) (*(const KSPROPERTY_ITEM**)&(Irp)->Tail.Overlay.DriverContext[3])
1425#define KSPROPERTY_ATTRIBUTES_IRP_STORAGE(Irp) (*(PKSATTRIBUTE_LIST*)&(Irp)->Tail.Overlay.DriverContext[2])
1426
1428typedef VOID
1429(NTAPI *PFNREFERENCEDEVICEOBJECT)(
1431
1433typedef VOID
1434(NTAPI *PFNDEREFERENCEDEVICEOBJECT)(
1436
1438typedef NTSTATUS
1439(NTAPI *PFNQUERYREFERENCESTRING)(
1442
1443typedef struct {
1445 PFNREFERENCEDEVICEOBJECT ReferenceDeviceObject;
1446 PFNDEREFERENCEDEVICEOBJECT DereferenceDeviceObject;
1447 PFNQUERYREFERENCESTRING QueryReferenceString;
1448} BUS_INTERFACE_REFERENCE, *PBUS_INTERFACE_REFERENCE;
1449
1450typedef struct {
1451 KDPC Dpc;
1452 ULONG ReferenceCount;
1453 KSPIN_LOCK AccessLock;
1454} KSDPC_ITEM, *PKSDPC_ITEM;
1455
1456typedef struct {
1457 KSDPC_ITEM DpcItem;
1458 LIST_ENTRY BufferList;
1459} KSBUFFER_ITEM, *PKSBUFFER_ITEM;
1460
1461#endif /* _NTDDK_ */
1462
1463typedef struct {
1471
1472#define DEFINE_KSPROPERTY_ITEM_GENERAL_COMPONENTID(Handler)\
1473 DEFINE_KSPROPERTY_ITEM(\
1474 KSPROPERTY_GENERAL_COMPONENTID,\
1475 (Handler),\
1476 sizeof(KSPROPERTY),\
1477 sizeof(KSCOMPONENTID),\
1478 NULL, NULL, 0, NULL, NULL, 0)
1479
1480/* ===============================================================
1481 Properties
1482*/
1483
1484typedef struct {
1488
1489typedef struct {
1494
1495typedef union {
1496 struct {
1499#if defined( _KS_NO_ANONYMOUS_STRUCTURES_ )
1500 } _SIGNED;
1501#else
1502 };
1503#endif
1504 struct {
1507#if defined( _KS_NO_ANONYMOUS_STRUCTURES_ )
1508 } _UNSIGNED;
1509#else
1510 };
1511#endif
1513
1514typedef union {
1515 struct {
1518#if defined( _KS_NO_ANONYMOUS_STRUCTURES_ )
1519 } _SIGNED64;
1520#else
1521 };
1522#endif
1523 struct {
1524#if defined(_NTDDK_)
1525 ULONGLONG UnsignedMinimum;
1526 ULONGLONG UnsignedMaximum;
1527#else
1530#endif
1531#if defined( _KS_NO_ANONYMOUS_STRUCTURES_ )
1532 } _UNSIGNED64;
1533#else
1534 };
1535#endif
1537
1538typedef struct {
1545
1546typedef struct {
1552
1553typedef struct {
1557
1558#define KSPROPERTY_MEMBER_RANGES 0x00000001
1559#define KSPROPERTY_MEMBER_STEPPEDRANGES 0x00000002
1560#define KSPROPERTY_MEMBER_VALUES 0x00000003
1561
1562#define KSPROPERTY_MEMBER_FLAG_DEFAULT 0x00000001
1563#if (NTDDI_VERSION >= NTDDI_WINXP)
1564#define KSPROPERTY_MEMBER_FLAG_BASICSUPPORT_MULTICHANNEL 0x00000002
1565#define KSPROPERTY_MEMBER_FLAG_BASICSUPPORT_UNIFORM 0x00000004
1566#endif
1567
1568typedef struct {
1571 _Field_size_(MembersListCount) const KSPROPERTY_MEMBERSLIST *MembersList;
1573
1574#if defined(_NTDDK_)
1575
1577typedef NTSTATUS
1578(NTAPI *PFNKSCONTEXT_DISPATCH)(
1580 _In_ PIRP Irp);
1581
1583typedef NTSTATUS
1584(NTAPI *PFNKSHANDLER)(
1585 _In_ PIRP Irp,
1588
1589typedef struct {
1591 union {
1592 PFNKSHANDLER GetPropertyHandler;
1593 BOOLEAN GetSupported;
1594 };
1595 ULONG MinProperty;
1596 ULONG MinData;
1597 union {
1598 PFNKSHANDLER SetPropertyHandler;
1599 BOOLEAN SetSupported;
1600 };
1601 const KSPROPERTY_VALUES *Values;
1602 ULONG RelationsCount;
1603 _Field_size_(RelationsCount) const KSPROPERTY *Relations;
1604 PFNKSHANDLER SupportHandler;
1605 ULONG SerializedSize;
1606} KSPROPERTY_ITEM, *PKSPROPERTY_ITEM;
1607
1609typedef BOOLEAN
1610(NTAPI *PFNKSFASTHANDLER)(
1612 _In_reads_bytes_(RequestLength) PKSIDENTIFIER Request,
1613 _In_ ULONG RequestLength,
1617
1618typedef struct {
1620 union {
1621 PFNKSFASTHANDLER GetPropertyHandler;
1622 BOOLEAN GetSupported;
1623 };
1624 union {
1625 PFNKSFASTHANDLER SetPropertyHandler;
1626 BOOLEAN SetSupported;
1627 };
1629} KSFASTPROPERTY_ITEM, *PKSFASTPROPERTY_ITEM;
1630
1631typedef struct {
1632 const GUID *Set;
1633 ULONG PropertiesCount;
1634 _Field_size_(PropertiesCount) const KSPROPERTY_ITEM *PropertyItem;
1635 ULONG FastIoCount;
1636 const KSFASTPROPERTY_ITEM *FastIoTable;
1637} KSPROPERTY_SET, *PKSPROPERTY_SET;
1638
1639#endif /* _NTDDK_ */
1640
1641typedef struct {
1646
1647typedef struct {
1648#if defined(_NTDDK_)
1649 ULONGLONG SteppingDelta;
1650#else
1652#endif
1655
1656/* ===============================================================
1657 Allocator Framing
1658*/
1659
1660typedef struct {
1661 union {
1664 };
1665#if defined(_NTDDK_)
1667#else
1669#endif
1675
1676typedef struct {
1681 KS_FRAMING_ITEM FramingItem[1];
1683
1684#define KSALLOCATOR_REQUIREMENTF_INPLACE_MODIFIER 0x00000001
1685#define KSALLOCATOR_REQUIREMENTF_SYSTEM_MEMORY 0x00000002
1686#define KSALLOCATOR_REQUIREMENTF_FRAME_INTEGRITY 0x00000004
1687#define KSALLOCATOR_REQUIREMENTF_MUST_ALLOCATE 0x00000008
1688#define KSALLOCATOR_REQUIREMENTF_PREFERENCES_ONLY 0x80000000
1689
1690#define KSALLOCATOR_OPTIONF_COMPATIBLE 0x00000001
1691#define KSALLOCATOR_OPTIONF_SYSTEM_MEMORY 0x00000002
1692#define KSALLOCATOR_OPTIONF_VALID 0x00000003
1693
1694#define KSALLOCATOR_FLAG_PARTIAL_READ_SUPPORT 0x00000010
1695#define KSALLOCATOR_FLAG_DEVICE_SPECIFIC 0x00000020
1696#define KSALLOCATOR_FLAG_CAN_ALLOCATE 0x00000040
1697#define KSALLOCATOR_FLAG_INSIST_ON_FRAMESIZE_RATIO 0x00000080
1698
1699/* ===============================================================
1700 Quality
1701*/
1702
1703typedef struct {
1708
1709typedef struct {
1713
1714typedef struct {
1721
1722typedef struct {
1726
1727typedef struct {
1731
1732typedef struct {
1734 union {
1735 struct {
1739 struct {
1743 } SemaphoreHandle;
1744#if defined(_NTDDK_)
1745 struct {
1746 PVOID Event;
1749 } EventObject;
1750 struct {
1751 PVOID Semaphore;
1755 struct {
1756 PKDPC Dpc;
1757 ULONG ReferenceCount;
1759 } Dpc;
1760 struct {
1761 PWORK_QUEUE_ITEM WorkQueueItem;
1762 WORK_QUEUE_TYPE WorkQueueType;
1764 } WorkItem;
1765 struct {
1766 PWORK_QUEUE_ITEM WorkQueueItem;
1767 PKSWORKER KsWorkerObject;
1769 } KsWorkItem;
1770#endif
1771 struct {
1775 };
1777
1778#define KSEVENTF_EVENT_HANDLE 0x00000001
1779#define KSEVENTF_SEMAPHORE_HANDLE 0x00000002
1780#if defined(_NTDDK_)
1781#define KSEVENTF_EVENT_OBJECT 0x00000004
1782#define KSEVENTF_SEMAPHORE_OBJECT 0x00000008
1783#define KSEVENTF_DPC 0x00000010
1784#define KSEVENTF_WORKITEM 0x00000020
1785#define KSEVENTF_KSWORKITEM 0x00000080
1786#endif
1787
1788
1789#define KSEVENT_TYPE_ENABLE 0x00000001
1790#define KSEVENT_TYPE_ONESHOT 0x00000002
1791#define KSEVENT_TYPE_ENABLEBUFFERED 0x00000004
1792#define KSEVENT_TYPE_SETSUPPORT 0x00000100
1793#define KSEVENT_TYPE_BASICSUPPORT 0x00000200
1794#define KSEVENT_TYPE_QUERYBUFFER 0x00000400
1795
1796#define KSEVENT_TYPE_TOPOLOGY 0x10000000
1797
1798typedef struct {
1801 union {
1804 };
1809
1810#define KSRELATIVEEVENT_FLAG_HANDLE 0x00000001
1811#define KSRELATIVEEVENT_FLAG_POINTER 0x00000002
1812
1813/* ===============================================================
1814 Timing
1815*/
1816
1817typedef struct {
1821
1822typedef struct {
1827
1828typedef struct {
1832
1833typedef struct {
1838
1839typedef struct {
1843
1844typedef struct {
1849
1850/* ===============================================================
1851 Clocks
1852*/
1853
1855
1856typedef struct {
1859
1860#if defined(_NTDDK_)
1861
1863typedef LONGLONG
1864(FASTCALL *PFNKSCLOCK_GETTIME)(
1866
1868typedef LONGLONG
1869(FASTCALL *PFNKSCLOCK_CORRELATEDTIME)(
1871 _Out_ PLONGLONG SystemTime);
1872
1873typedef struct {
1874 PFNKSCLOCK_GETTIME GetTime;
1875 PFNKSCLOCK_GETTIME GetPhysicalTime;
1876 PFNKSCLOCK_CORRELATEDTIME GetCorrelatedTime;
1877 PFNKSCLOCK_CORRELATEDTIME GetCorrelatedPhysicalTime;
1878} KSCLOCK_FUNCTIONTABLE, *PKSCLOCK_FUNCTIONTABLE;
1879
1880#define DEFINE_KSPROPERTY_ITEM_CLOCK_TIME(Handler)\
1881 DEFINE_KSPROPERTY_ITEM(\
1882 KSPROPERTY_CLOCK_TIME,\
1883 (Handler),\
1884 sizeof(KSPROPERTY),\
1885 sizeof(LONGLONG),\
1886 NULL, NULL, 0, NULL, NULL, 0)
1887
1888#define DEFINE_KSPROPERTY_ITEM_CLOCK_PHYSICALTIME(Handler)\
1889 DEFINE_KSPROPERTY_ITEM(\
1890 KSPROPERTY_CLOCK_PHYSICALTIME,\
1891 (Handler),\
1892 sizeof(KSPROPERTY),\
1893 sizeof(LONGLONG),\
1894 NULL, NULL, 0, NULL, NULL, 0)
1895
1896#define DEFINE_KSPROPERTY_ITEM_CLOCK_CORRELATEDTIME(Handler)\
1897 DEFINE_KSPROPERTY_ITEM(\
1898 KSPROPERTY_CLOCK_CORRELATEDTIME,\
1899 (Handler),\
1900 sizeof(KSPROPERTY),\
1901 sizeof(KSCORRELATED_TIME),\
1902 NULL, NULL, 0, NULL, NULL, 0)
1903
1904#define DEFINE_KSPROPERTY_ITEM_CLOCK_CORRELATEDPHYSICALTIME(Handler)\
1905 DEFINE_KSPROPERTY_ITEM(\
1906 KSPROPERTY_CLOCK_CORRELATEDPHYSICALTIME,\
1907 (Handler),\
1908 sizeof(KSPROPERTY),\
1909 sizeof(KSCORRELATED_TIME),\
1910 NULL, NULL, 0, NULL, NULL, 0)
1911
1912#define DEFINE_KSPROPERTY_ITEM_CLOCK_RESOLUTION(Handler)\
1913 DEFINE_KSPROPERTY_ITEM(\
1914 KSPROPERTY_CLOCK_RESOLUTION,\
1915 (Handler),\
1916 sizeof(KSPROPERTY),\
1917 sizeof(KSRESOLUTION),\
1918 NULL, NULL, 0, NULL, NULL, 0)
1919
1920#define DEFINE_KSPROPERTY_ITEM_CLOCK_STATE(Handler)\
1921 DEFINE_KSPROPERTY_ITEM(\
1922 KSPROPERTY_CLOCK_STATE,\
1923 (Handler),\
1924 sizeof(KSPROPERTY),\
1925 sizeof(KSSTATE),\
1926 NULL, NULL, 0, NULL, NULL, 0)
1927
1928#define DEFINE_KSPROPERTY_ITEM_CLOCK_FUNCTIONTABLE(Handler)\
1929 DEFINE_KSPROPERTY_ITEM(\
1930 KSPROPERTY_CLOCK_FUNCTIONTABLE,\
1931 (Handler),\
1932 sizeof(KSPROPERTY),\
1933 sizeof(KSCLOCK_FUNCTIONTABLE),\
1934 NULL, NULL, 0, NULL, NULL, 0)
1935
1936#define DEFINE_KSPROPERTY_CLOCKSET(ClockSet,\
1937 PropTime, PropPhysicalTime,\
1938 PropCorrelatedTime, PropCorrelatedPhysicalTime,\
1939 PropResolution, PropState, PropFunctionTable)\
1940DEFINE_KSPROPERTY_TABLE(ClockSet) {\
1941 DEFINE_KSPROPERTY_ITEM_CLOCK_TIME(PropTime),\
1942 DEFINE_KSPROPERTY_ITEM_CLOCK_PHYSICALTIME(PropPhysicalTime),\
1943 DEFINE_KSPROPERTY_ITEM_CLOCK_CORRELATEDTIME(PropCorrelatedTime),\
1944 DEFINE_KSPROPERTY_ITEM_CLOCK_CORRELATEDPHYSICALTIME(PropCorrelatedPhysicalTime),\
1945 DEFINE_KSPROPERTY_ITEM_CLOCK_RESOLUTION(PropResolution),\
1946 DEFINE_KSPROPERTY_ITEM_CLOCK_STATE(PropState),\
1947 DEFINE_KSPROPERTY_ITEM_CLOCK_FUNCTIONTABLE(PropFunctionTable)\
1948}
1949
1950/* ===============================================================
1951 Objects ??? SORT ME!
1952*/
1953
1954#define KSCREATE_ITEM_SECURITYCHANGED 0x1
1955#define KSCREATE_ITEM_WILDCARD 0x2
1956#define KSCREATE_ITEM_NOPARAMETERS 0x4
1957#define KSCREATE_ITEM_FREEONSTOP 0x8
1958
1959typedef struct {
1961 PVOID Context;
1962 UNICODE_STRING ObjectClass;
1964 ULONG Flags;
1965} KSOBJECT_CREATE_ITEM, *PKSOBJECT_CREATE_ITEM;
1966
1967typedef struct {
1968 ULONG CreateItemsCount;
1969 _Field_size_(CreateItemsCount) PKSOBJECT_CREATE_ITEM CreateItemsList;
1970} KSOBJECT_CREATE, *PKSOBJECT_CREATE;
1971
1972typedef VOID
1973(NTAPI *PFNKSITEMFREECALLBACK)(
1974 _In_ PKSOBJECT_CREATE_ITEM CreateItem);
1975
1976#endif /* _NTDDK_ */
1977
1978typedef struct {
1982
1983typedef struct {
1988
1989typedef struct {
1993
1994/* ===============================================================
1995 Methods
1996*/
1997
1998#if defined(_NTDDK_)
1999
2000typedef struct {
2002 union {
2003 PFNKSHANDLER MethodHandler;
2004 BOOLEAN MethodSupported;
2005 };
2006 ULONG MinMethod;
2007 ULONG MinData;
2008 PFNKSHANDLER SupportHandler;
2009 ULONG Flags;
2010} KSMETHOD_ITEM, *PKSMETHOD_ITEM;
2011
2012#ifndef _MSC_VER
2013
2014#define DEFINE_KSMETHOD_ITEM(MethodId, Flags,\
2015 MethodHandler,\
2016 MinMethod, MinData, SupportHandler)\
2017{\
2018 MethodId, {(PFNKSHANDLER)MethodHandler}, MinMethod, MinData,\
2019 SupportHandler, Flags\
2020}
2021
2022#else
2023
2024#define DEFINE_KSMETHOD_ITEM(MethodId, Flags,\
2025 MethodHandler,\
2026 MinMethod, MinData, SupportHandler)\
2027{\
2028 MethodId, (PFNKSHANDLER)MethodHandler, MinMethod, MinData,\
2029 SupportHandler, Flags\
2030}
2031
2032#endif
2033
2034typedef struct {
2036 union {
2037 PFNKSFASTHANDLER MethodHandler;
2038 BOOLEAN MethodSupported;
2039 };
2040} KSFASTMETHOD_ITEM, *PKSFASTMETHOD_ITEM;
2041
2042#define DEFINE_KSFASTMETHOD_ITEM(MethodId, MethodHandler)\
2043{\
2044 MethodId, (PFNKSFASTHANDLER)MethodHandler\
2045}
2046
2047typedef struct {
2048 const GUID *Set;
2049 ULONG MethodsCount;
2050 _Field_size_(MethodsCount) const KSMETHOD_ITEM *MethodItem;
2051 ULONG FastIoCount;
2052 _Field_size_(FastIoCount) const KSFASTMETHOD_ITEM *FastIoTable;
2053} KSMETHOD_SET, *PKSMETHOD_SET;
2054
2055#define DEFINE_KSMETHOD_SET(Set,\
2056 MethodsCount,\
2057 MethodItem,\
2058 FastIoCount,\
2059 FastIoTable)\
2060{\
2061 Set,\
2062 MethodsCount,\
2063 MethodItem,\
2064 FastIoCount,\
2065 FastIoTable\
2066}
2067
2068#endif /* _NTDDK_ */
2069
2070/* ===============================================================
2071 Nodes
2072*/
2073
2074typedef struct {
2079
2080typedef struct {
2085
2086typedef struct {
2091
2092typedef struct {
2096
2097/* ===============================================================
2098 Events
2099*/
2100
2101typedef struct _KSEVENT_ENTRY KSEVENT_ENTRY, *PKSEVENT_ENTRY;
2102
2103#if defined(_NTDDK_)
2104
2105typedef NTSTATUS
2106(NTAPI *PFNKSADDEVENT)(
2107 _In_ PIRP Irp,
2108 _In_ PKSEVENTDATA EventData,
2109 _In_ struct _KSEVENT_ENTRY *EventEntry);
2110
2111typedef VOID
2112(NTAPI *PFNKSREMOVEEVENT)(
2114 _In_ struct _KSEVENT_ENTRY *EventEntry);
2115
2116typedef struct {
2117 ULONG EventId;
2118 ULONG DataInput;
2119 ULONG ExtraEntryData;
2120 PFNKSADDEVENT AddHandler;
2121 PFNKSREMOVEEVENT RemoveHandler;
2122 PFNKSHANDLER SupportHandler;
2123} KSEVENT_ITEM, *PKSEVENT_ITEM;
2124
2125typedef struct {
2126 const GUID *Set;
2127 ULONG EventsCount;
2128 _Field_size_(EventsCount) const KSEVENT_ITEM *EventItem;
2129} KSEVENT_SET, *PKSEVENT_SET;
2130
2131struct _KSEVENT_ENTRY {
2132 LIST_ENTRY ListEntry;
2133 PVOID Object;
2134 union {
2135 PKSDPC_ITEM DpcItem;
2136 PKSBUFFER_ITEM BufferItem;
2137 };
2138 PKSEVENTDATA EventData;
2140 const KSEVENT_SET *EventSet;
2141 const KSEVENT_ITEM *EventItem;
2143 ULONG SemaphoreAdjustment;
2145 ULONG Flags;
2146};
2147
2148#endif /* _NTDDK_ */
2149
2150/* ===============================================================
2151 Pins
2152*/
2153
2154#if defined(_NTDDK_)
2155
2156typedef struct _KSPIN KSPIN, *PKSPIN;
2157typedef struct _KSSTREAM_POINTER KSSTREAM_POINTER, *PKSSTREAM_POINTER;
2158typedef struct _KSSTREAM_POINTER_OFFSET KSSTREAM_POINTER_OFFSET, *PKSSTREAM_POINTER_OFFSET;
2159typedef struct _KSMAPPING KSMAPPING, *PKSMAPPING;
2160typedef struct _KSPROCESSPIN KSPROCESSPIN, *PKSPROCESSPIN;
2161
2162#define IOCTL_KS_HANDSHAKE \
2163 CTL_CODE(FILE_DEVICE_KS, 0x007, METHOD_NEITHER, FILE_ANY_ACCESS)
2164
2165typedef struct {
2169} KSHANDSHAKE, *PKSHANDSHAKE;
2170
2172typedef NTSTATUS
2173(NTAPI *PFNKSPINHANDSHAKE)(
2174 _In_ PKSPIN Pin,
2175 _In_ PKSHANDSHAKE In,
2176 _In_ PKSHANDSHAKE Out);
2177
2179typedef void
2180(NTAPI *PFNKSPINPOWER)(
2181 _In_ PKSPIN Pin,
2183
2184typedef void
2185(NTAPI *PFNKSPINFRAMERETURN)(
2186 _In_ PKSPIN Pin,
2192
2194typedef void
2195(NTAPI *PFNKSPINIRPCOMPLETION)(
2196 _In_ PKSPIN Pin,
2197 _In_ PIRP Irp);
2198
2200typedef NTSTATUS
2201(NTAPI *PFNKSPINIRP)(
2202 _In_ PKSPIN Pin,
2203 _In_ PIRP Irp);
2204
2205typedef NTSTATUS
2206(NTAPI *PFNKSPIN)(
2207 _In_ PKSPIN Pin);
2208
2210typedef void
2211(NTAPI *PFNKSPINVOID)(
2212 _In_ PKSPIN Pin);
2213
2215typedef void
2216(NTAPI *PFNKSSTREAMPOINTER)(
2217 _In_ PKSSTREAM_POINTER StreamPointer);
2218
2219typedef struct {
2220 ULONG Count;
2222} KSATTRIBUTE_LIST, *PKSATTRIBUTE_LIST;
2223
2225typedef NTSTATUS
2226(NTAPI *PFNKSPINSETDATAFORMAT)(
2227 _In_ PKSPIN Pin,
2228 _In_opt_ PKSDATAFORMAT OldFormat,
2229 _In_opt_ PKSMULTIPLE_ITEM OldAttributeList,
2230 _In_ const KSDATARANGE* DataRange,
2231 _In_opt_ const KSATTRIBUTE_LIST* AttributeRange);
2232
2234typedef NTSTATUS
2235(NTAPI *PFNKSPINSETDEVICESTATE)(
2236 _In_ PKSPIN Pin,
2237 _In_ KSSTATE ToState,
2238 _In_ KSSTATE FromState);
2239
2240typedef struct _KSCLOCK_DISPATCH KSCLOCK_DISPATCH, *PKSCLOCK_DISPATCH;
2241typedef struct _KSALLOCATOR_DISPATCH KSALLOCATOR_DISPATCH, *PKSALLOCATOR_DISPATCH;
2242
2243typedef struct {
2244 PFNKSPINIRP Create;
2245 PFNKSPINIRP Close;
2246 PFNKSPIN Process;
2247 PFNKSPINVOID Reset;
2248 PFNKSPINSETDATAFORMAT SetDataFormat;
2249 PFNKSPINSETDEVICESTATE SetDeviceState;
2250 PFNKSPIN Connect;
2251 PFNKSPINVOID Disconnect;
2252 const KSCLOCK_DISPATCH* Clock;
2253 const KSALLOCATOR_DISPATCH* Allocator;
2254} KSPIN_DISPATCH, *PKSPIN_DISPATCH;
2255
2257typedef BOOLEAN
2258(NTAPI *PFNKSPINSETTIMER)(
2259 _In_ PKSPIN Pin,
2262 _In_ PKDPC Dpc);
2263
2265typedef BOOLEAN
2266(NTAPI *PFNKSPINCANCELTIMER)(
2267 _In_ PKSPIN Pin,
2269
2271typedef LONGLONG
2272(FASTCALL *PFNKSPINCORRELATEDTIME)(
2273 _In_ PKSPIN Pin,
2274 _Out_ PLONGLONG SystemTime);
2275
2277typedef void
2278(NTAPI *PFNKSPINRESOLUTION)(
2279 _In_ PKSPIN Pin,
2281
2282struct _KSCLOCK_DISPATCH {
2283 PFNKSPINSETTIMER SetTimer;
2284 PFNKSPINCANCELTIMER CancelTimer;
2285 PFNKSPINCORRELATEDTIME CorrelatedTime;
2286 PFNKSPINRESOLUTION Resolution;
2287};
2288
2290typedef NTSTATUS
2291(NTAPI *PFNKSPININITIALIZEALLOCATOR)(
2292 _In_ PKSPIN Pin,
2295
2296typedef PVOID
2297(NTAPI *PFNKSDELETEALLOCATOR)(
2299
2300typedef PVOID
2301(NTAPI *PFNKSDEFAULTALLOCATE)(
2303
2304typedef PVOID
2305(NTAPI *PFNKSDEFAULTFREE)(
2307 _In_ PVOID Buffer);
2308
2309struct _KSALLOCATOR_DISPATCH {
2310 PFNKSPININITIALIZEALLOCATOR InitializeAllocator;
2311 PFNKSDELETEALLOCATOR DeleteAllocator;
2312 PFNKSDEFAULTALLOCATE Allocate;
2313 PFNKSDEFAULTFREE Free;
2314};
2315
2316typedef struct KSAUTOMATION_TABLE_ {
2317 ULONG PropertySetsCount;
2318 ULONG PropertyItemSize;
2319 _Field_size_bytes_(PropertySetsCount * PropertyItemSize) const KSPROPERTY_SET *PropertySets;
2320 ULONG MethodSetsCount;
2321 ULONG MethodItemSize;
2322 _Field_size_bytes_(MethodSetsCount * MethodItemSize) const KSMETHOD_SET *MethodSets;
2323 ULONG EventSetsCount;
2324 ULONG EventItemSize;
2325 _Field_size_bytes_(EventSetsCount * EventItemSize) const KSEVENT_SET *EventSets;
2326#if !defined(_WIN64)
2328#endif
2329} KSAUTOMATION_TABLE, *PKSAUTOMATION_TABLE;
2330
2331typedef struct {
2332 ULONG InterfacesCount;
2333 _Field_size_(InterfacesCount) const KSPIN_INTERFACE *Interfaces;
2334 ULONG MediumsCount;
2335 _Field_size_(MediumsCount) const KSPIN_MEDIUM *Mediums;
2336 ULONG DataRangesCount;
2337 _Field_size_(DataRangesCount) const PKSDATARANGE *DataRanges;
2339 KSPIN_COMMUNICATION Communication;
2340 const GUID *Category;
2341 const GUID *Name;
2342 union {
2344 struct {
2345 ULONG ConstrainedDataRangesCount;
2346 _Field_size_(ConstrainedDataRangesCount) PKSDATARANGE *ConstrainedDataRanges;
2347 };
2348 };
2349} KSPIN_DESCRIPTOR, *PKSPIN_DESCRIPTOR;
2350
2353typedef NTSTATUS
2354(NTAPI *PFNKSINTERSECTHANDLER)(
2355 _In_ PIRP Irp,
2357 _In_ PKSDATARANGE DataRange,
2359
2362typedef NTSTATUS
2363(NTAPI *PFNKSINTERSECTHANDLEREX)(
2365 _In_ PIRP Irp,
2367 _In_ PKSDATARANGE DataRange,
2368 _In_ PKSDATARANGE MatchingDataRange,
2369 _In_ ULONG DataBufferSize,
2370 _Out_writes_bytes_to_opt_(DataBufferSize, *DataSize) PVOID Data,
2372
2373typedef struct {
2374 const KSPIN_DISPATCH* Dispatch;
2375 const KSAUTOMATION_TABLE* AutomationTable;
2376 KSPIN_DESCRIPTOR PinDescriptor;
2377 ULONG Flags;
2378 ULONG InstancesPossible;
2379 ULONG InstancesNecessary;
2381 PFNKSINTERSECTHANDLEREX IntersectHandler;
2382} KSPIN_DESCRIPTOR_EX, *PKSPIN_DESCRIPTOR_EX;
2383
2384#define KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING 0x00000001
2385#define KSFILTER_FLAG_CRITICAL_PROCESSING 0x00000002
2386#define KSFILTER_FLAG_HYPERCRITICAL_PROCESSING 0x00000004
2387#define KSFILTER_FLAG_RECEIVE_ZERO_LENGTH_SAMPLES 0x00000008
2388#if (NTDDI_VERSION >= NTDDI_WINXPSP2)
2389#define KSFILTER_FLAG_DENY_USERMODE_ACCESS 0x80000000
2390#endif
2391
2392#define KSPIN_FLAG_DISPATCH_LEVEL_PROCESSING KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING
2393#define KSPIN_FLAG_CRITICAL_PROCESSING KSFILTER_FLAG_CRITICAL_PROCESSING
2394#define KSPIN_FLAG_HYPERCRITICAL_PROCESSING KSFILTER_FLAG_HYPERCRITICAL_PROCESSING
2395
2396#define KSPIN_FLAG_ASYNCHRONOUS_PROCESSING 0x00000008
2397#define KSPIN_FLAG_DO_NOT_INITIATE_PROCESSING 0x00000010
2398#define KSPIN_FLAG_INITIATE_PROCESSING_ON_EVERY_ARRIVAL 0x00000020
2399#define KSPIN_FLAG_FRAMES_NOT_REQUIRED_FOR_PROCESSING 0x00000040
2400#define KSPIN_FLAG_ENFORCE_FIFO 0x00000080
2401
2402#define KSPIN_FLAG_GENERATE_MAPPINGS 0x00000100
2403#define KSPIN_FLAG_DISTINCT_TRAILING_EDGE 0x00000200
2404
2405#define KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY 0x00010000
2406#define KSPIN_FLAG_SPLITTER 0x00020000
2407#define KSPIN_FLAG_USE_STANDARD_TRANSPORT 0x00040000
2408#define KSPIN_FLAG_DO_NOT_USE_STANDARD_TRANSPORT 0x00080000
2409#define KSPIN_FLAG_FIXED_FORMAT 0x00100000
2410#define KSPIN_FLAG_GENERATE_EOS_EVENTS 0x00200000
2411
2412#define KSPIN_FLAG_RENDERER (KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY|KSPIN_FLAG_GENERATE_EOS_EVENTS)
2413
2414#define KSPIN_FLAG_IMPLEMENT_CLOCK 0x00400000
2415#define KSPIN_FLAG_SOME_FRAMES_REQUIRED_FOR_PROCESSING 0x00800000
2416#define KSPIN_FLAG_PROCESS_IF_ANY_IN_RUN_STATE 0x01000000
2417#if (NTDDI_VERSION >= NTDDI_WINXPSP2)
2418#define KSPIN_FLAG_DENY_USERMODE_ACCESS 0x80000000
2419#endif
2420
2421struct _KSPIN {
2422 const KSPIN_DESCRIPTOR_EX *Descriptor;
2423 KSOBJECT_BAG Bag;
2424 PVOID Context;
2425 ULONG Id;
2426 KSPIN_COMMUNICATION Communication;
2427 BOOLEAN ConnectionIsExternal;
2428 KSPIN_INTERFACE ConnectionInterface;
2429 KSPIN_MEDIUM ConnectionMedium;
2430 KSPRIORITY ConnectionPriority;
2431 PKSDATAFORMAT ConnectionFormat;
2432 PKSMULTIPLE_ITEM AttributeList;
2433 ULONG StreamHeaderSize;
2437 KSSTATE ClientState;
2438};
2439
2440#define DEFINE_KSPROPERTY_ITEM_PIN_CINSTANCES(Handler)\
2441 DEFINE_KSPROPERTY_ITEM(\
2442 KSPROPERTY_PIN_CINSTANCES,\
2443 (Handler),\
2444 sizeof(KSP_PIN),\
2445 sizeof(KSPIN_CINSTANCES),\
2446 NULL, NULL, 0, NULL, NULL, 0)
2447
2448#define DEFINE_KSPROPERTY_ITEM_PIN_CTYPES(Handler)\
2449 DEFINE_KSPROPERTY_ITEM(\
2450 KSPROPERTY_PIN_CTYPES,\
2451 (Handler),\
2452 sizeof(KSPROPERTY),\
2453 sizeof(ULONG),\
2454 NULL, NULL, 0, NULL, NULL, 0)
2455
2456#define DEFINE_KSPROPERTY_ITEM_PIN_DATAFLOW(Handler)\
2457 DEFINE_KSPROPERTY_ITEM(\
2458 KSPROPERTY_PIN_DATAFLOW,\
2459 (Handler),\
2460 sizeof(KSP_PIN),\
2461 sizeof(KSPIN_DATAFLOW),\
2462 NULL, NULL, 0, NULL, NULL, 0)
2463
2464#define DEFINE_KSPROPERTY_ITEM_PIN_DATARANGES(Handler)\
2465 DEFINE_KSPROPERTY_ITEM(\
2466 KSPROPERTY_PIN_DATARANGES,\
2467 (Handler),\
2468 sizeof(KSP_PIN),\
2469 0,\
2470 NULL, NULL, 0, NULL, NULL, 0)
2471
2472#define DEFINE_KSPROPERTY_ITEM_PIN_DATAINTERSECTION(Handler)\
2473 DEFINE_KSPROPERTY_ITEM(\
2474 KSPROPERTY_PIN_DATAINTERSECTION,\
2475 (Handler),\
2476 sizeof(KSP_PIN) + sizeof(KSMULTIPLE_ITEM),\
2477 0,\
2478 NULL, NULL, 0, NULL, NULL, 0)
2479
2480#define DEFINE_KSPROPERTY_ITEM_PIN_INTERFACES(Handler)\
2481 DEFINE_KSPROPERTY_ITEM(\
2482 KSPROPERTY_PIN_INTERFACES,\
2483 (Handler),\
2484 sizeof(KSP_PIN),\
2485 0,\
2486 NULL, NULL, 0, NULL, NULL, 0)
2487
2488#define DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(Handler)\
2489 DEFINE_KSPROPERTY_ITEM(\
2490 KSPROPERTY_PIN_MEDIUMS,\
2491 (Handler),\
2492 sizeof(KSP_PIN),\
2493 0,\
2494 NULL, NULL, 0, NULL, NULL, 0)
2495
2496#define DEFINE_KSPROPERTY_ITEM_PIN_COMMUNICATION(Handler)\
2497 DEFINE_KSPROPERTY_ITEM(\
2498 KSPROPERTY_PIN_COMMUNICATION,\
2499 (Handler),\
2500 sizeof(KSP_PIN),\
2501 sizeof(KSPIN_COMMUNICATION),\
2502 NULL, NULL, 0, NULL, NULL, 0)
2503
2504#define DEFINE_KSPROPERTY_ITEM_PIN_GLOBALCINSTANCES(Handler)\
2505 DEFINE_KSPROPERTY_ITEM(\
2506 KSPROPERTY_PIN_GLOBALCINSTANCES,\
2507 (Handler),\
2508 sizeof(KSP_PIN),\
2509 sizeof(KSPIN_CINSTANCES),\
2510 NULL, NULL, 0, NULL, NULL, 0)
2511
2512#define DEFINE_KSPROPERTY_ITEM_PIN_NECESSARYINSTANCES(Handler)\
2513 DEFINE_KSPROPERTY_ITEM(\
2514 KSPROPERTY_PIN_NECESSARYINSTANCES,\
2515 (Handler),\
2516 sizeof(KSP_PIN),\
2517 sizeof(ULONG),\
2518 NULL, NULL, 0, NULL, NULL, 0)
2519
2520#define DEFINE_KSPROPERTY_ITEM_PIN_PHYSICALCONNECTION(Handler)\
2521 DEFINE_KSPROPERTY_ITEM(\
2522 KSPROPERTY_PIN_PHYSICALCONNECTION,\
2523 (Handler),\
2524 sizeof(KSP_PIN),\
2525 0,\
2526 NULL, NULL, 0, NULL, NULL, 0)
2527
2528#define DEFINE_KSPROPERTY_ITEM_PIN_CATEGORY(Handler)\
2529 DEFINE_KSPROPERTY_ITEM(\
2530 KSPROPERTY_PIN_CATEGORY,\
2531 (Handler),\
2532 sizeof(KSP_PIN),\
2533 sizeof(GUID),\
2534 NULL, NULL, 0, NULL, NULL, 0)
2535
2536#define DEFINE_KSPROPERTY_ITEM_PIN_NAME(Handler)\
2537 DEFINE_KSPROPERTY_ITEM(\
2538 KSPROPERTY_PIN_NAME,\
2539 (Handler),\
2540 sizeof(KSP_PIN),\
2541 0,\
2542 NULL, NULL, 0, NULL, NULL, 0)
2543
2544#define DEFINE_KSPROPERTY_ITEM_PIN_CONSTRAINEDDATARANGES(Handler)\
2545 DEFINE_KSPROPERTY_ITEM(\
2546 KSPROPERTY_PIN_CONSTRAINEDDATARANGES,\
2547 (Handler),\
2548 sizeof(KSP_PIN),\
2549 0,\
2550 NULL, NULL, 0, NULL, NULL, 0)
2551
2552#define DEFINE_KSPROPERTY_ITEM_PIN_PROPOSEDATAFORMAT(Handler)\
2553 DEFINE_KSPROPERTY_ITEM(\
2554 KSPROPERTY_PIN_PROPOSEDATAFORMAT,\
2555 NULL,\
2556 sizeof(KSP_PIN),\
2557 sizeof(KSDATAFORMAT),\
2558 (Handler), NULL, 0, NULL, NULL, 0)
2559
2560#define DEFINE_KSPROPERTY_PINSET(PinSet,\
2561 PropGeneral, PropInstances, PropIntersection)\
2562DEFINE_KSPROPERTY_TABLE(PinSet) {\
2563 DEFINE_KSPROPERTY_ITEM_PIN_CINSTANCES(PropInstances),\
2564 DEFINE_KSPROPERTY_ITEM_PIN_CTYPES(PropGeneral),\
2565 DEFINE_KSPROPERTY_ITEM_PIN_DATAFLOW(PropGeneral),\
2566 DEFINE_KSPROPERTY_ITEM_PIN_DATARANGES(PropGeneral),\
2567 DEFINE_KSPROPERTY_ITEM_PIN_DATAINTERSECTION(PropIntersection),\
2568 DEFINE_KSPROPERTY_ITEM_PIN_INTERFACES(PropGeneral),\
2569 DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(PropGeneral),\
2570 DEFINE_KSPROPERTY_ITEM_PIN_COMMUNICATION(PropGeneral),\
2571 DEFINE_KSPROPERTY_ITEM_PIN_CATEGORY(PropGeneral),\
2572 DEFINE_KSPROPERTY_ITEM_PIN_NAME(PropGeneral)\
2573}
2574
2575#define DEFINE_KSPROPERTY_PINSETCONSTRAINED(PinSet,\
2576 PropGeneral, PropInstances, PropIntersection)\
2577DEFINE_KSPROPERTY_TABLE(PinSet) {\
2578 DEFINE_KSPROPERTY_ITEM_PIN_CINSTANCES(PropInstances),\
2579 DEFINE_KSPROPERTY_ITEM_PIN_CTYPES(PropGeneral),\
2580 DEFINE_KSPROPERTY_ITEM_PIN_DATAFLOW(PropGeneral),\
2581 DEFINE_KSPROPERTY_ITEM_PIN_DATARANGES(PropGeneral),\
2582 DEFINE_KSPROPERTY_ITEM_PIN_DATAINTERSECTION(PropIntersection),\
2583 DEFINE_KSPROPERTY_ITEM_PIN_INTERFACES(PropGeneral),\
2584 DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(PropGeneral),\
2585 DEFINE_KSPROPERTY_ITEM_PIN_COMMUNICATION(PropGeneral),\
2586 DEFINE_KSPROPERTY_ITEM_PIN_CATEGORY(PropGeneral),\
2587 DEFINE_KSPROPERTY_ITEM_PIN_NAME(PropGeneral),\
2588 DEFINE_KSPROPERTY_ITEM_PIN_CONSTRAINEDDATARANGES(PropGeneral)\
2589}
2590
2591typedef void
2592(NTAPI *PFNKSFREE)(
2593 _In_ PVOID Data);
2594
2595#define DEFINE_KSPROPERTY_TABLE(tablename) \
2596 const KSPROPERTY_ITEM tablename[] =
2597
2598#endif /* _NTDDK_ */
2599
2600typedef struct {
2607
2608/* ===============================================================
2609 Topology
2610*/
2611
2612typedef struct {
2613 ULONG FromNode;
2614 ULONG FromNodePin;
2615 ULONG ToNode;
2616 ULONG ToNodePin;
2618
2619typedef struct {
2621 _Field_size_(CategoriesCount) const GUID *Categories;
2623 _Field_size_(TopologyNodesCount) const GUID *TopologyNodes;
2625 _Field_size_(TopologyConnectionsCount) const KSTOPOLOGY_CONNECTION *TopologyConnections;
2626 _Field_size_(TopologyNodesCount) const GUID *TopologyNodesNames;
2629
2630
2631#define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CATEGORIES(Handler)\
2632 DEFINE_KSPROPERTY_ITEM(\
2633 KSPROPERTY_TOPOLOGY_CATEGORIES,\
2634 (Handler),\
2635 sizeof(KSPROPERTY),\
2636 0,\
2637 NULL, NULL, 0, NULL, NULL, 0)
2638
2639#define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NODES(Handler)\
2640 DEFINE_KSPROPERTY_ITEM(\
2641 KSPROPERTY_TOPOLOGY_NODES,\
2642 (Handler),\
2643 sizeof(KSPROPERTY),\
2644 0,\
2645 NULL, NULL, 0, NULL, NULL, 0)
2646
2647#define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CONNECTIONS(Handler)\
2648 DEFINE_KSPROPERTY_ITEM(\
2649 KSPROPERTY_TOPOLOGY_CONNECTIONS,\
2650 (Handler),\
2651 sizeof(KSPROPERTY),\
2652 0,\
2653 NULL, NULL, 0, NULL, NULL, 0)
2654
2655#define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NAME(Handler)\
2656 DEFINE_KSPROPERTY_ITEM(\
2657 KSPROPERTY_TOPOLOGY_NAME,\
2658 (Handler),\
2659 sizeof(KSP_NODE),\
2660 0,\
2661 NULL, NULL, 0, NULL, NULL, 0)
2662
2663#define DEFINE_KSPROPERTY_TOPOLOGYSET(TopologySet, Handler)\
2664DEFINE_KSPROPERTY_TABLE(TopologySet) {\
2665 DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CATEGORIES(Handler),\
2666 DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NODES(Handler),\
2667 DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CONNECTIONS(Handler),\
2668 DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NAME(Handler)\
2669}
2670
2671/* ===============================================================
2672 ??? SORT ME
2673*/
2674
2675/* TODO */
2676typedef void* UNKNOWN;
2677
2678typedef PVOID
2680 _In_ PVOID InitialContext,
2683
2684#if defined(_NTDDK_)
2685
2687typedef NTSTATUS
2688(NTAPI *PFNKSALLOCATOR)(
2689 _In_ PIRP Irp,
2691 _In_ BOOLEAN InputOperation);
2692
2695typedef NTSTATUS
2696(NTAPI *PFNKINTERSECTHANDLEREX)(
2698 _In_ PIRP Irp,
2700 _In_ PKSDATARANGE DataRange,
2701 _In_ PKSDATARANGE MatchingDataRange,
2702 _In_ ULONG DataBufferSize,
2703 _Out_writes_bytes_to_opt_(DataBufferSize, *DataSize) PVOID Data,
2705
2706typedef NTSTATUS
2707(NTAPI *PFNALLOCATOR_ALLOCATEFRAME)(
2709 _Outptr_ PVOID *Frame);
2710
2711typedef VOID
2712(NTAPI *PFNALLOCATOR_FREEFRAME)(
2714 _In_ PVOID Frame);
2715
2716typedef struct {
2717 PFNALLOCATOR_ALLOCATEFRAME AllocateFrame;
2718 PFNALLOCATOR_FREEFRAME FreeFrame;
2719} KSSTREAMALLOCATOR_FUNCTIONTABLE, *PKSSTREAMALLOCATOR_FUNCTIONTABLE;
2720
2721#endif /* _NTDDK_ */
2722
2723typedef struct {
2728
2729typedef struct {
2734
2735typedef struct {
2744#ifdef _WIN64
2746#endif
2748
2749#define KSSTREAM_HEADER_OPTIONSF_SPLICEPOINT 0x00000001
2750#define KSSTREAM_HEADER_OPTIONSF_PREROLL 0x00000002
2751#define KSSTREAM_HEADER_OPTIONSF_DATADISCONTINUITY 0x00000004
2752#define KSSTREAM_HEADER_OPTIONSF_TYPECHANGED 0x00000008
2753#define KSSTREAM_HEADER_OPTIONSF_TIMEVALID 0x00000010
2754#define KSSTREAM_HEADER_OPTIONSF_TIMEDISCONTINUITY 0x00000040
2755#define KSSTREAM_HEADER_OPTIONSF_FLUSHONPAUSE 0x00000080
2756#define KSSTREAM_HEADER_OPTIONSF_DURATIONVALID 0x00000100
2757#define KSSTREAM_HEADER_OPTIONSF_ENDOFSTREAM 0x00000200
2758#define KSSTREAM_HEADER_OPTIONSF_BUFFEREDTRANSFER 0x00000400
2759#define KSSTREAM_HEADER_OPTIONSF_VRAM_DATA_TRANSFER 0x00000800
2760#define KSSTREAM_HEADER_OPTIONSF_LOOPEDDATA 0x80000000
2761
2762/* ===============================================================
2763 XP / DX8
2764*/
2765
2766#if defined(_NTDDK_)
2767
2768typedef struct _KSGATE KSGATE, *PKSGATE;
2769
2770struct _KSGATE {
2771 LONG Count;
2772 PKSGATE NextGate;
2773};
2774
2775#ifndef _NTOS_
2776
2779PKSGATE
2780NTAPI
2782 _In_ PKSPIN Pin);
2783
2785static
2786__inline
2787void
2788KsGateTurnInputOn(
2789 _In_opt_ PKSGATE Gate)
2790{
2791 while (Gate && (InterlockedIncrement(&Gate->Count) == 1))
2792 {
2793 Gate = Gate->NextGate;
2794 }
2795}
2796
2798static
2799__inline
2800void
2801KsGateTurnInputOff(
2802 _In_opt_ PKSGATE Gate)
2803{
2804 while (Gate && (InterlockedDecrement(&Gate->Count) == 0))
2805 {
2806 Gate = Gate->NextGate;
2807 }
2808}
2809
2811static
2812__inline
2813BOOLEAN
2814KsGateGetStateUnsafe(
2815 _In_ PKSGATE Gate)
2816{
2817 ASSERT(Gate);
2818 return((BOOLEAN)(Gate->Count > 0));
2819}
2820
2822static
2823__inline
2824BOOLEAN
2825KsGateCaptureThreshold(
2826 _In_ PKSGATE Gate)
2827{
2828 BOOLEAN captured;
2829
2830 ASSERT(Gate);
2831
2832 captured = (BOOLEAN)(InterlockedCompareExchange(&Gate->Count,0,1) == 1);
2833
2834 if (captured)
2835 {
2836 KsGateTurnInputOff(Gate->NextGate);
2837 }
2838
2839 return captured;
2840}
2841
2843static
2844__inline
2845void
2846KsGateInitialize(
2847 _In_ PKSGATE Gate,
2848 _In_ LONG InitialCount,
2849 _In_opt_ PKSGATE NextGate,
2850 _In_ BOOLEAN StateToPropagate)
2851{
2852 ASSERT(Gate);
2853 Gate->Count = InitialCount;
2854 Gate->NextGate = NextGate;
2855
2856 if (NextGate)
2857 {
2858 if (InitialCount > 0)
2859 {
2860 if (StateToPropagate)
2861 {
2862 KsGateTurnInputOn(NextGate);
2863 }
2864 }
2865 else
2866 {
2867 if (!StateToPropagate)
2868 {
2869 KsGateTurnInputOff(NextGate);
2870 }
2871 }
2872 }
2873}
2874
2876static
2877__inline
2878void
2879KsGateInitializeAnd(
2880 _In_ PKSGATE AndGate,
2881 _In_opt_ PKSGATE NextOrGate)
2882{
2883 KsGateInitialize(AndGate,1,NextOrGate,TRUE);
2884}
2885
2887static
2888__inline
2889void
2890KsGateInitializeOr(
2891 _In_ PKSGATE OrGate,
2892 _In_opt_ PKSGATE NextAndGate)
2893{
2894 KsGateInitialize(OrGate,0,NextAndGate,FALSE);
2895}
2896
2898static
2899__inline
2900void
2901KsGateAddOnInputToAnd(
2902 _In_ PKSGATE AndGate)
2903{
2904 UNREFERENCED_PARAMETER (AndGate);
2905}
2906
2908static
2909__inline
2910void
2911KsGateAddOffInputToAnd(
2912 _In_ PKSGATE AndGate)
2913{
2914 KsGateTurnInputOff(AndGate);
2915}
2916
2918static
2919__inline
2920void
2921KsGateRemoveOnInputFromAnd(
2922 _In_ PKSGATE AndGate)
2923{
2924 UNREFERENCED_PARAMETER (AndGate);
2925}
2926
2928static
2929__inline
2930void
2931KsGateRemoveOffInputFromAnd(
2932 _In_ PKSGATE AndGate)
2933{
2934 KsGateTurnInputOn(AndGate);
2935}
2936
2938static
2939__inline
2940void
2941KsGateAddOnInputToOr(
2942 _In_ PKSGATE OrGate)
2943{
2944 KsGateTurnInputOn(OrGate);
2945}
2946
2948static
2949__inline
2950void
2951KsGateAddOffInputToOr(
2952 _In_ PKSGATE OrGate)
2953{
2954 UNREFERENCED_PARAMETER (OrGate);
2955}
2956
2958static
2959__inline
2960void
2961KsGateRemoveOnInputFromOr(
2962 _In_ PKSGATE OrGate)
2963{
2964 KsGateTurnInputOff(OrGate);
2965}
2966
2968static
2969__inline
2970void
2971KsGateRemoveOffInputFromOr(
2972 _In_ PKSGATE OrGate)
2973{
2974 UNREFERENCED_PARAMETER (OrGate);
2975}
2976
2978static
2979__inline
2980void
2981KsGateTerminateAnd(
2982 _In_ PKSGATE AndGate)
2983{
2984 ASSERT(AndGate);
2985 if (KsGateGetStateUnsafe(AndGate))
2986 {
2987 KsGateRemoveOnInputFromOr(AndGate->NextGate);
2988 }
2989 else
2990 {
2991 KsGateRemoveOffInputFromOr(AndGate->NextGate);
2992 }
2993}
2994
2996static
2997__inline
2998void
2999KsGateTerminateOr(
3000 _In_ PKSGATE OrGate)
3001{
3002 ASSERT(OrGate);
3003 if (KsGateGetStateUnsafe(OrGate))
3004 {
3005 KsGateRemoveOnInputFromAnd(OrGate->NextGate);
3006 }
3007 else
3008 {
3009 KsGateRemoveOffInputFromAnd(OrGate->NextGate);
3010 }
3011}
3012
3013#endif /* !_NTOS_ */
3014
3015struct _KSMAPPING {
3019};
3020
3021#endif /* _NTDDK_ */
3022
3023typedef enum {
3027
3028typedef struct _KSPROCESSPIN_INDEXENTRY KSPROCESSPIN_INDEXENTRY, *PKSPROCESSPIN_INDEXENTRY;
3029
3031#if defined(_NTDDK_)
3032 union {
3033 PUCHAR Data;
3034 PKSMAPPING Mappings;
3035 };
3036#else
3038#endif
3039#if !defined(_WIN64)
3041#endif
3044};
3045
3046#if defined(_NTDDK_)
3047
3048struct _KSSTREAM_POINTER {
3049 PVOID Context;
3050 PKSPIN Pin;
3051 PKSSTREAM_HEADER StreamHeader;
3052 PKSSTREAM_POINTER_OFFSET Offset;
3053 KSSTREAM_POINTER_OFFSET OffsetIn;
3054 KSSTREAM_POINTER_OFFSET OffsetOut;
3055};
3056
3057struct _KSPROCESSPIN {
3058 PKSPIN Pin;
3059 PKSSTREAM_POINTER StreamPointer;
3060 PKSPROCESSPIN InPlaceCounterpart;
3061 PKSPROCESSPIN DelegateBranch;
3062 PKSPROCESSPIN CopySource;
3063 _Field_size_bytes_(BytesAvailable) PVOID Data;
3064 ULONG BytesAvailable;
3065 ULONG BytesUsed;
3066 ULONG Flags;
3067 BOOLEAN Terminate;
3068};
3069
3070struct _KSPROCESSPIN_INDEXENTRY {
3071 _Field_size_(Count) PKSPROCESSPIN *Pins;
3072 ULONG Count;
3073};
3074
3075#endif /* _NTDDK_ */
3076
3077/* ===============================================================
3078 Device Dispatch
3079*/
3080
3081#if defined(_NTDDK_)
3082
3083typedef struct _KSFILTER_DISPATCH KSFILTER_DISPATCH, *PKSFILTER_DISPATCH;
3084typedef struct _KSDEVICE KSDEVICE, *PKSDEVICE;
3085typedef struct _KSFILTER KSFILTER, *PKSFILTER;
3086typedef struct _KSNODE_DESCRIPTOR KSNODE_DESCRIPTOR, *PKSNODE_DESCRIPTOR;
3087typedef struct _KSFILTER_DESCRIPTOR KSFILTER_DESCRIPTOR, *PKSFILTER_DESCRIPTOR;
3088typedef struct _KSDEVICE_DESCRIPTOR KSDEVICE_DESCRIPTOR, *PKSDEVICE_DESCRIPTOR;
3089
3091typedef NTSTATUS
3092(NTAPI *PFNKSDEVICECREATE)(
3093 _In_ PKSDEVICE Device);
3094
3096typedef NTSTATUS
3097(NTAPI *PFNKSDEVICEPNPSTART)(
3098 _In_ PKSDEVICE Device,
3099 _In_ PIRP Irp,
3100 _In_opt_ PCM_RESOURCE_LIST TranslatedResourceList,
3101 _In_opt_ PCM_RESOURCE_LIST UntranslatedResourceList);
3102
3104typedef NTSTATUS
3105(NTAPI *PFNKSDEVICE)(
3106 _In_ PKSDEVICE Device);
3107
3109typedef NTSTATUS
3110(NTAPI *PFNKSDEVICEIRP)(
3111 _In_ PKSDEVICE Device,
3112 _In_ PIRP Irp);
3113
3115typedef VOID
3116(NTAPI *PFNKSDEVICEIRPVOID)(
3117 _In_ PKSDEVICE Device,
3118 _In_ PIRP Irp);
3119
3121typedef NTSTATUS
3122(NTAPI *PFNKSDEVICEQUERYCAPABILITIES)(
3123 _In_ PKSDEVICE Device,
3124 _In_ PIRP Irp,
3126
3128typedef NTSTATUS
3129(NTAPI *PFNKSDEVICEQUERYPOWER)(
3130 _In_ PKSDEVICE Device,
3131 _In_ PIRP Irp,
3132 _In_ DEVICE_POWER_STATE DeviceTo,
3133 _In_ DEVICE_POWER_STATE DeviceFrom,
3134 _In_ SYSTEM_POWER_STATE SystemTo,
3135 _In_ SYSTEM_POWER_STATE SystemFrom,
3137
3139typedef VOID
3140(NTAPI *PFNKSDEVICESETPOWER)(
3141 _In_ PKSDEVICE Device,
3142 _In_ PIRP Irp,
3145
3146typedef struct _KSDEVICE_DISPATCH {
3147 PFNKSDEVICECREATE Add;
3148 PFNKSDEVICEPNPSTART Start;
3149 PFNKSDEVICE PostStart;
3150 PFNKSDEVICEIRP QueryStop;
3151 PFNKSDEVICEIRPVOID CancelStop;
3152 PFNKSDEVICEIRPVOID Stop;
3153 PFNKSDEVICEIRP QueryRemove;
3154 PFNKSDEVICEIRPVOID CancelRemove;
3155 PFNKSDEVICEIRPVOID Remove;
3156 PFNKSDEVICEQUERYCAPABILITIES QueryCapabilities;
3157 PFNKSDEVICEIRPVOID SurpriseRemoval;
3158 PFNKSDEVICEQUERYPOWER QueryPower;
3159 PFNKSDEVICESETPOWER SetPower;
3160 PFNKSDEVICEIRP QueryInterface;
3161} KSDEVICE_DISPATCH, *PKSDEVICE_DISPATCH;
3162
3163#if (NTDDI_VERSION >= NTDDI_LONGHORN)
3164#define KSDEVICE_DESCRIPTOR_VERSION_2 (0x110)
3165#define MIN_DEV_VER_FOR_FLAGS (0x110)
3166#endif
3167
3168struct _KSDEVICE {
3169 const KSDEVICE_DESCRIPTOR* Descriptor;
3170 KSOBJECT_BAG Bag;
3171 PVOID Context;
3178};
3179
3180#endif /* _NTDDK_ */
3181
3182/* ===============================================================
3183 Filter Dispatch
3184*/
3185
3186#if defined(_NTDDK_)
3187
3188struct _KSFILTER {
3189 const KSFILTER_DESCRIPTOR* Descriptor;
3190 KSOBJECT_BAG Bag;
3191 PVOID Context;
3192};
3193
3195typedef void
3196(NTAPI *PFNKSFILTERPOWER)(
3197 _In_ PKSFILTER Filter,
3199
3201typedef NTSTATUS
3202(NTAPI *PFNKSFILTERIRP)(
3203 _In_ PKSFILTER Filter,
3204 _In_ PIRP Irp);
3205
3206typedef NTSTATUS
3207(NTAPI *PFNKSFILTERPROCESS)(
3208 _In_ PKSFILTER Filter,
3209 _In_ PKSPROCESSPIN_INDEXENTRY ProcessPinsIndex);
3210
3212typedef NTSTATUS
3213(NTAPI *PFNKSFILTERVOID)(
3214 _In_ PKSFILTER Filter);
3215
3216struct _KSFILTER_DISPATCH {
3217 PFNKSFILTERIRP Create;
3218 PFNKSFILTERIRP Close;
3219 PFNKSFILTERPROCESS Process;
3220 PFNKSFILTERVOID Reset;
3221};
3222
3223struct _KSNODE_DESCRIPTOR {
3224 const KSAUTOMATION_TABLE *AutomationTable;
3225 const GUID *Type;
3226 const GUID *Name;
3227#if !defined(_WIN64)
3229#endif
3230};
3231
3232struct _KSFILTER_DESCRIPTOR {
3233 const KSFILTER_DISPATCH *Dispatch;
3234 const KSAUTOMATION_TABLE *AutomationTable;
3235 ULONG Version;
3236 ULONG Flags;
3237 const GUID *ReferenceGuid;
3238 ULONG PinDescriptorsCount;
3239 ULONG PinDescriptorSize;
3240 _Field_size_bytes_(PinDescriptorsCount * PinDescriptorSize) const KSPIN_DESCRIPTOR_EX *PinDescriptors;
3241 ULONG CategoriesCount;
3242 _Field_size_(CategoriesCount) const GUID *Categories;
3243 ULONG NodeDescriptorsCount;
3244 ULONG NodeDescriptorSize;
3245 _Field_size_bytes_(NodeDescriptorsCount * NodeDescriptorSize) const KSNODE_DESCRIPTOR *NodeDescriptors;
3246 ULONG ConnectionsCount;
3247 _Field_size_(ConnectionsCount) const KSTOPOLOGY_CONNECTION *Connections;
3249};
3250
3251#define KSFILTER_DESCRIPTOR_VERSION ((ULONG)-1)
3252
3253struct _KSDEVICE_DESCRIPTOR {
3254 const KSDEVICE_DISPATCH *Dispatch;
3255 ULONG FilterDescriptorsCount;
3256 _Field_size_(FilterDescriptorsCount) const KSFILTER_DESCRIPTOR * const *FilterDescriptors;
3257 ULONG Version;
3258 ULONG Flags;
3259};
3260
3261struct _KSFILTERFACTORY {
3262 const KSFILTER_DESCRIPTOR* FilterDescriptor;
3263 KSOBJECT_BAG Bag;
3264 PVOID Context;
3265};
3266
3267#define DEFINE_KSFILTER_DESCRIPTOR(descriptor)\
3268 const KSFILTER_DESCRIPTOR descriptor =
3269
3270#define DEFINE_KSFILTER_PIN_DESCRIPTORS(table)\
3271 SIZEOF_ARRAY(table),\
3272 sizeof(table[0]),\
3273 table
3274
3275#define DEFINE_KSFILTER_CATEGORIES(table)\
3276 SIZEOF_ARRAY(table),\
3277 table
3278
3279#define DEFINE_KSFILTER_CATEGORY(category)\
3280 1,\
3281 &(category)
3282
3283#define DEFINE_KSFILTER_CATEGORIES_NULL\
3284 0,\
3285 NULL
3286
3287#define DEFINE_KSFILTER_NODE_DESCRIPTORS(table)\
3288 SIZEOF_ARRAY(table),\
3289 sizeof(table[0]),\
3290 table
3291
3292#define DEFINE_KSFILTER_NODE_DESCRIPTORS_NULL\
3293 0,\
3294 sizeof(KSNODE_DESCRIPTOR),\
3295 NULL
3296
3297#define DEFINE_KSFILTER_CONNECTIONS(table)\
3298 SIZEOF_ARRAY(table),\
3299 table
3300
3301#define DEFINE_KSFILTER_DEFAULT_CONNECTIONS\
3302 0,\
3303 NULL
3304
3305#endif /* _NTDDK_ */
3306
3307/* ===============================================================
3308 Minidriver Callbacks
3309*/
3310
3311#if defined(_NTDDK_)
3312
3313typedef NTSTATUS
3314(NTAPI *KStrMethodHandler)(
3315 IN PIRP Irp,
3317 IN OUT PVOID Data);
3318
3319typedef NTSTATUS
3320(NTAPI *KStrSupportHandler)(
3321 IN PIRP Irp,
3323 IN OUT PVOID Data);
3324
3325#endif
3326
3327/* ===============================================================
3328 Allocator Functions
3329*/
3330
3331#if defined(_NTDDK_)
3332
3336NTAPI
3341
3345NTAPI
3347 _In_ PIRP Irp);
3348
3352NTAPI
3354 _In_ PIRP Irp,
3356
3360NTAPI
3362 _In_ PIRP Irp,
3364 _In_opt_ PFNKSDEFAULTALLOCATE DefaultAllocate,
3365 _In_opt_ PFNKSDEFAULTFREE DefaultFree,
3366 _In_opt_ PFNKSINITIALIZEALLOCATOR InitializeAllocator,
3367 _In_opt_ PFNKSDELETEALLOCATOR DeleteAllocator);
3368
3372NTAPI
3376 _In_ const KSALLOCATOR_FRAMING_EX *PinFraming);
3377
3378#endif /* _NTDDK_ */
3379
3380/* ===============================================================
3381 Clock Functions
3382*/
3383
3384#if defined(_NTDDK_)
3385
3387typedef BOOLEAN
3388(NTAPI *PFNKSSETTIMER)(
3392 _In_ PKDPC Dpc);
3393
3395typedef BOOLEAN
3396(NTAPI *PFNKSCANCELTIMER)(
3399
3400typedef LONGLONG
3401(FASTCALL *PFNKSCORRELATEDTIME)(
3403 _Out_ PLONGLONG SystemTime);
3404
3408NTAPI
3413
3417NTAPI
3419 _In_ PIRP Irp,
3420 _In_ PKSDEFAULTCLOCK DefaultClock);
3421
3425NTAPI
3427 _Out_ PKSDEFAULTCLOCK *DefaultClock);
3428
3432NTAPI
3434 _Out_ PKSDEFAULTCLOCK *DefaultClock,
3436 _In_opt_ PFNKSSETTIMER SetTimer,
3437 _In_opt_ PFNKSCANCELTIMER CancelTimer,
3438 _In_opt_ PFNKSCORRELATEDTIME CorrelatedTime,
3440 _In_ ULONG Flags);
3441
3444VOID
3445NTAPI
3447 _In_ PKSDEFAULTCLOCK DefaultClock);
3448
3452NTAPI
3454 _In_ PIRP Irp,
3456
3459KSSTATE
3460NTAPI
3462 _In_ PKSDEFAULTCLOCK DefaultClock);
3463
3466VOID
3467NTAPI
3469 _In_ PKSDEFAULTCLOCK DefaultClock,
3471
3475NTAPI
3477 _In_ PKSDEFAULTCLOCK DefaultClock);
3478
3481VOID
3482NTAPI
3484 _In_ PKSDEFAULTCLOCK DefaultClock,
3486
3487#endif /* _NTDDK_ */
3488
3489/* ===============================================================
3490 Method Functions
3491*/
3492
3493/* Method sets - TODO: Make into macros! */
3494#if defined(_NTDDK_)
3495
3496#if 0
3497
3498VOID
3499KSMETHOD_SET_IRP_STORAGE(
3500 IN IRP Irp);
3501
3502VOID
3503KSMETHOD_ITEM_IRP_STORAGE(
3504 IN IRP Irp);
3505
3506VOID
3507KSMETHOD_TYPE_IRP_STORAGE(
3508 IN IRP Irp);
3509
3510#endif
3511
3515NTAPI
3516KsMethodHandler(
3517 _In_ PIRP Irp,
3518 _In_ ULONG MethodSetsCount,
3519 _In_reads_(MethodSetsCount) const KSMETHOD_SET* MethodSet);
3520
3524NTAPI
3525KsMethodHandlerWithAllocator(
3526 _In_ PIRP Irp,
3527 _In_ ULONG MethodSetsCount,
3528 _In_reads_(MethodSetsCount) const KSMETHOD_SET* MethodSet,
3529 _In_opt_ PFNKSALLOCATOR Allocator,
3530 _In_opt_ ULONG MethodItemSize);
3531
3534BOOLEAN
3535NTAPI
3538 _In_reads_bytes_(MethodLength) PKSMETHOD UNALIGNED Method,
3539 _In_ ULONG MethodLength,
3543 _In_ ULONG MethodSetsCount,
3544 _In_reads_(MethodSetsCount) const KSMETHOD_SET *MethodSet);
3545
3546#endif /* _NTDDK_ */
3547
3548/* ===============================================================
3549 Property Functions
3550*/
3551
3552#if defined(_NTDDK_)
3553
3557NTAPI
3559 _In_ PIRP Irp,
3560 _In_ ULONG PropertySetsCount,
3561 _In_reads_(PropertySetsCount) const KSPROPERTY_SET *PropertySet);
3562
3566NTAPI
3567KsPropertyHandlerWithAllocator(
3568 _In_ PIRP Irp,
3569 _In_ ULONG PropertySetsCount,
3570 _In_reads_(PropertySetsCount) const KSPROPERTY_SET* PropertySet,
3571 _In_opt_ PFNKSALLOCATOR Allocator,
3572 _In_opt_ ULONG PropertyItemSize);
3573
3577NTAPI
3582
3585BOOLEAN
3586NTAPI
3590 _In_ ULONG PropertyLength,
3594 _In_ ULONG PropertySetsCount,
3595 _In_reads_(PropertySetsCount) const KSPROPERTY_SET *PropertySet);
3596
3597#endif /* _NTDDK_ */
3598
3599/* ===============================================================
3600 Event Functions
3601*/
3602
3603#if defined(_NTDDK_)
3604
3605#define KSPROBE_STREAMREAD 0x00000000
3606#define KSPROBE_STREAMWRITE 0x00000001
3607#define KSPROBE_ALLOCATEMDL 0x00000010
3608#define KSPROBE_PROBEANDLOCK 0x00000020
3609#define KSPROBE_SYSTEMADDRESS 0x00000040
3610#define KSPROBE_MODIFY 0x00000200
3611#define KSPROBE_STREAMWRITEMODIFY (KSPROBE_MODIFY | KSPROBE_STREAMWRITE)
3612#define KSPROBE_ALLOWFORMATCHANGE 0x00000080
3613
3614#define KSSTREAM_READ KSPROBE_STREAMREAD
3615#define KSSTREAM_WRITE KSPROBE_STREAMWRITE
3616#define KSSTREAM_PAGED_DATA 0x00000000
3617#define KSSTREAM_NONPAGED_DATA 0x00000100
3618#define KSSTREAM_SYNCHRONOUS 0x00001000
3619#define KSSTREAM_FAILUREEXCEPTION 0x00002000
3620
3622typedef BOOLEAN
3623(NTAPI *PFNKSGENERATEEVENTCALLBACK)(
3625 _In_ PKSEVENT_ENTRY EventEntry);
3626
3629NTAPI
3631 _In_ PKSEVENT_ENTRY EntryEvent);
3632
3635void
3636NTAPI
3639 _In_opt_ const GUID *EventSet,
3640 _In_ ULONG EventId,
3643 _In_opt_ PFNKSGENERATEEVENTCALLBACK CallBack,
3645
3649NTAPI
3650KsEnableEventWithAllocator(
3651 _In_ PIRP Irp,
3652 _In_ ULONG EventSetsCount,
3653 _In_reads_(EventSetsCount) const KSEVENT_SET* EventSet,
3654 _Inout_opt_ PLIST_ENTRY EventsList,
3655 _In_opt_ KSEVENTS_LOCKTYPE EventsFlags,
3656 _In_opt_ PVOID EventsLock,
3657 _In_opt_ PFNKSALLOCATOR Allocator,
3658 _In_opt_ ULONG EventItemSize);
3659
3662NTAPI
3664 _In_ PKSEVENT_ENTRY EventEntry,
3667
3671NTAPI
3673 _In_ PIRP Irp,
3674 _In_ ULONG EventSetsCount,
3675 _In_reads_(EventSetsCount) KSEVENT_SET *EventSet,
3676 _Inout_opt_ PLIST_ENTRY EventsList,
3677 _In_opt_ KSEVENTS_LOCKTYPE EventsFlags,
3678 _In_opt_ PVOID EventsLock);
3679
3682VOID
3683NTAPI
3685 _In_ PKSEVENT_ENTRY EventEntry);
3686
3690NTAPI
3692 _In_ PIRP Irp,
3693 _Inout_ PLIST_ENTRY EventsList,
3694 _In_ KSEVENTS_LOCKTYPE EventsFlags,
3695 _In_ PVOID EventsLock);
3696
3699VOID
3700NTAPI
3703 _Inout_ PLIST_ENTRY EventsList,
3704 _In_ KSEVENTS_LOCKTYPE EventsFlags,
3705 _In_ PVOID EventsLock);
3706
3707/* ===============================================================
3708 Topology Functions
3709*/
3710
3714NTAPI
3716 _In_ PIRP Irp,
3717 _In_ PKSTOPOLOGY Topology,
3719
3723NTAPI
3725 _In_ HANDLE ParentHandle,
3729
3733NTAPI
3735 _In_ PIRP Irp,
3738 _In_ const KSTOPOLOGY *Topology);
3739
3740/* ===============================================================
3741 Connectivity Functions
3742*/
3743
3747NTAPI
3749 _In_ HANDLE FilterHandle,
3753
3757NTAPI
3759 _In_ PIRP Irp,
3760 _In_ ULONG DescriptorsCount,
3761 _In_reads_(DescriptorsCount) KSPIN_DESCRIPTOR *Descriptor,
3763
3767NTAPI
3769 _In_ PIRP Irp,
3772 _In_ ULONG DescriptorsCount,
3773 _In_reads_(DescriptorsCount) const KSPIN_DESCRIPTOR *Descriptor);
3774
3779NTAPI
3781 _In_ PIRP Irp,
3784 _In_ ULONG DescriptorsCount,
3785 _In_reads_(DescriptorsCount) const KSPIN_DESCRIPTOR *Descriptor,
3786 _In_ PFNKSINTERSECTHANDLER IntersectHandler);
3787
3792NTAPI
3794 _In_ PIRP Irp,
3797 _In_ ULONG DescriptorsCount,
3798 _In_reads_bytes_(DescriptorsCount * DescriptorSize) const KSPIN_DESCRIPTOR *Descriptor,
3800 _In_opt_ PFNKSINTERSECTHANDLEREX IntersectHandler,
3801 _In_opt_ PVOID HandlerContext);
3802
3805PKSFILTER
3806NTAPI
3808 _In_ PKSPIN Pin);
3809
3812PKSPIN
3813NTAPI
3815 _In_ PKSPIN Pin);
3816
3819PKSSTREAM_POINTER
3820NTAPI
3822 _In_ PKSPIN Pin,
3824
3828NTAPI
3830 _In_ PKSSTREAM_POINTER StreamPointer,
3832);
3833
3836void
3837NTAPI
3839 _In_ PKSSTREAM_POINTER StreamPointer
3840);
3841
3845NTAPI
3847 _In_ PKSSTREAM_POINTER StreamPointer,
3848 _In_opt_ PFNKSSTREAMPOINTER CancelCallback,
3850 _Out_ PKSSTREAM_POINTER* CloneStreamPointer
3851);
3852
3853
3854/* Does this belong here? */
3855
3859NTAPI
3861 _In_ PIRP Irp,
3862 _In_ ULONG DataItemsCount,
3863 _In_ ULONG DataItemSize,
3864 _In_reads_bytes_(DataItemsCount * DataItemSize) const VOID *DataItems);
3865
3866/* ===============================================================
3867 IRP Helper Functions
3868*/
3869
3871typedef NTSTATUS
3872(NTAPI *PFNKSIRPLISTCALLBACK)(
3873 _In_ PIRP Irp,
3875
3879NTAPI
3881 _In_ PIRP Irp,
3882 _Out_ KSRESET *ResetValue);
3883
3886VOID
3887NTAPI
3889 _Inout_ PLIST_ENTRY QueueHead,
3891 _In_ PIRP Irp,
3892 _In_ KSLIST_ENTRY_LOCATION ListLocation,
3893 _In_opt_ PDRIVER_CANCEL DriverCancel);
3894
3898NTAPI
3903 _In_ PWSTR ObjectClass,
3905
3909NTAPI
3914 _In_ PWSTR ObjectClass,
3916
3920NTAPI
3923 _In_ ULONG ItemsCount,
3924 _In_reads_opt_(ItemsCount) PKSOBJECT_CREATE_ITEM ItemsList);
3925
3929NTAPI
3932 _In_ ULONG ExtraSize,
3933 _Out_ PVOID *ExtraBuffer);
3934
3938NTAPI
3941 _In_ PKSOBJECT_CREATE_ITEM CreateItem,
3942 _In_ BOOLEAN AllocateEntry,
3943 _In_opt_ PFNKSITEMFREECALLBACK ItemFreeCallback);
3944
3948NTAPI
3951 _In_ ULONG ItemsCount,
3952 _In_reads_opt_(ItemsCount) PKSOBJECT_CREATE_ITEM ItemsList,
3953 _In_ PIRP Irp,
3954 _In_ KSDISPATCH_TABLE *Table);
3955
3958VOID
3959NTAPI
3961 _Inout_ PLIST_ENTRY QueueHead,
3963
3966VOID
3967NTAPI
3970 _In_ PIRP Irp);
3971
3975NTAPI
3978 _In_ PIRP Irp);
3979
3982BOOLEAN
3983NTAPI
3993 _In_ PDEVICE_OBJECT DeviceObject); /* always return false */
3994
3997BOOLEAN
3998NTAPI
4007 _In_ PDEVICE_OBJECT DeviceObject); /* always return false */
4008
4009/* This function does the same as the above */
4010#define KsDispatchFastWriteFailure KsDispatchFastReadFailure
4011
4015NTAPI
4018 _In_ PIRP Irp);
4019
4023NTAPI
4026 _In_ PIRP Irp);
4027
4031NTAPI
4033 _In_ PIRP Irp,
4034 _In_ PFNKSHANDLER Handler);
4035
4039NTAPI
4041 _In_ PIRP Irp,
4042 _In_ PFNKSHANDLER Handler);
4043
4047NTAPI
4050 _In_ PIRP Irp,
4052 _In_ KSSTACK_USE StackUse);
4053
4057NTAPI
4059 _In_ PIRP Irp,
4061 _In_ BOOLEAN ReuseStackLocation);
4062
4065VOID
4066NTAPI
4069
4072VOID
4073NTAPI
4075 _In_ PVOID Header);
4076
4079NTAPI
4080KsGetChildCreateParameter(
4081 _In_ PIRP Irp,
4082 _Out_ PVOID *CreateParameter);
4083
4087NTAPI
4090 _In_ PKSPIN_LOCK SourceLock,
4091 _Inout_ PLIST_ENTRY DestinationList,
4092 _In_opt_ PKSPIN_LOCK DestinationLock,
4093 _In_ KSLIST_ENTRY_LOCATION ListLocation,
4094 _In_ PFNKSIRPLISTCALLBACK ListCallback,
4096
4100NTAPI
4103 _In_ ULONG ProbeFlags,
4104 _In_ ULONG HeaderSize);
4105
4109NTAPI
4115
4119NTAPI
4122
4125PKSOBJECT_CREATE_ITEM
4126NTAPI
4129
4133NTAPI
4137 _In_opt_ PVOID PortContext,
4142 _In_ KPROCESSOR_MODE RequestorMode);
4143
4146VOID
4147NTAPI
4149 _In_ PKSDEVICE);
4150
4153VOID
4154NTAPI
4156 _In_ PIRP Irp,
4157 _In_opt_ PDRIVER_CANCEL DriverCancel);
4158
4161PIRP
4162NTAPI
4164 _Inout_ PLIST_ENTRY QueueHead,
4166 _In_ KSLIST_ENTRY_LOCATION ListLocation,
4167 _In_ KSIRP_REMOVAL_OPERATION RemovalOperation);
4168
4171VOID
4172NTAPI
4174 _In_ PIRP Irp);
4175
4179NTAPI
4185
4189NTAPI
4193
4198NTAPI
4202 _In_opt_ PVOID PortContext,
4205 _In_opt_ KSCOMPLETION_INVOCATION CompletionInvocationFlags,
4207 _Inout_updates_bytes_(Length) PVOID StreamHeaders,
4210 _In_ KPROCESSOR_MODE RequestorMode);
4211
4214VOID
4215NTAPI
4217 _In_ PKSSTREAM_POINTER StreamPointer,
4218 _In_ BOOLEAN Eject);
4219
4223NTAPI
4225 _In_ PKSSTREAM_POINTER StreamPointer,
4226 _In_ ULONG InUsed,
4227 _In_ ULONG OutUsed,
4228 _In_ BOOLEAN Eject);
4229
4234NTAPI
4236 _In_ PKSSTREAM_POINTER StreamPointer);
4237
4240VOID
4241NTAPI
4243 _In_ PKSSTREAM_POINTER StreamPointer,
4244 _In_ ULONG InUsed,
4245 _In_ ULONG OutUsed,
4246 _In_ BOOLEAN Eject
4247 );
4248
4249
4253NTAPI
4257 _In_opt_ PVOID PortContext,
4262 _In_ KPROCESSOR_MODE RequestorMode);
4263
4266NTAPI
4269 _In_ PIRP Irp);
4270
4271/* ===============================================================
4272 Worker Management Functions
4273*/
4274
4278NTAPI
4280 _In_ WORK_QUEUE_TYPE WorkQueueType,
4281 _Out_ PKSWORKER* Worker);
4282
4285VOID
4286NTAPI
4288 _In_ PKSWORKER Worker);
4289
4293NTAPI
4295 _In_ WORK_QUEUE_TYPE WorkQueueType,
4296 _In_ PWORK_QUEUE_ITEM CountedWorkItem,
4297 _Out_ PKSWORKER *Worker);
4298
4301ULONG
4302NTAPI
4304 _In_ PKSWORKER Worker);
4305
4308ULONG
4309NTAPI
4311 _In_ PKSWORKER Worker);
4312
4316NTAPI
4318 _In_ PKSWORKER Worker,
4320
4321/* ===============================================================
4322 Resources / Images
4323*/
4324
4328NTAPI
4330 _In_ PVOID ImageBase,
4332 _In_ ULONG_PTR ResourceName,
4333 _In_ ULONG ResourceType,
4335 _Out_opt_ PULONG ResourceSize);
4336
4340NTAPI
4342 _In_ HANDLE RegKey,
4346
4350NTAPI
4357
4358/* ===============================================================
4359 Misc. Helper Functions
4360*/
4361
4364PVOID
4365NTAPI
4367 _In_ PVOID Object);
4368
4372NTAPI
4375 _In_ PKSPIN_MEDIUM Medium,
4376 _In_ ULONG PinDirection);
4377
4380NTAPI
4383 _In_ PIRP Irp);
4384
4387VOID
4388NTAPI
4391 _In_ PDEVICE_OBJECT PnpDeviceObject,
4392 _In_ PDEVICE_OBJECT BaseDevice);
4393
4396NTAPI
4399 _In_ PIRP Irp);
4400
4403VOID
4404NTAPI
4407 _In_opt_ PFNKSCONTEXT_DISPATCH PowerDispatch,
4408 _In_opt_ PVOID PowerContext);
4409
4413NTAPI
4416
4419VOID
4420NTAPI
4423
4427NTAPI
4430 _In_ PUNICODE_STRING CreateItem);
4431
4435NTAPI
4439
4442VOID
4443NTAPI
4446
4450NTAPI
4453
4456VOID
4457NTAPI
4460 _In_ BOOLEAN ReuseStackLocation);
4461
4464VOID
4465NTAPI
4469
4472VOID
4473NTAPI
4477
4482NTAPI
4485 _In_ KPROCESSOR_MODE RequestorMode,
4486 _In_ ULONG IoControl,
4487 _In_reads_bytes_(InSize) PVOID InBuffer,
4488 _In_ ULONG InSize,
4490 _In_ ULONG OutSize,
4492
4495PKSPIN
4496NTAPI
4498 _In_ PKSFILTER Filter,
4499 _In_ ULONG PinId);
4500
4504NTAPI
4506 _In_ PKSPIN Pin);
4507
4508#else /* _NTDDK_ */
4509
4510#if !defined( KS_NO_CREATE_FUNCTIONS )
4511
4514DWORD
4515WINAPI
4520
4523DWORD
4524NTAPI
4529
4532DWORD
4533WINAPI
4535 _In_ HANDLE FilterHandle,
4539
4542DWORD
4543WINAPI
4545 _In_ HANDLE ParentHandle,
4549
4550#endif
4551
4552#endif /* _NTDDK_ */
4553
4554/* ===============================================================
4555 AVStream Functions (XP / DirectX 8)
4556 NOT IMPLEMENTED YET
4557 http://www.osronline.com/ddkx/stream/avstream_5q9f.htm
4558*/
4559
4560#if defined(_NTDDK_)
4561
4565NTAPI
4567 _Out_ PKSAUTOMATION_TABLE *AutomationTableAB,
4568 _In_opt_ PKSAUTOMATION_TABLE AutomationTableA,
4569 _In_opt_ PKSAUTOMATION_TABLE AutomationTableB,
4571
4576NTAPI
4580 _In_opt_ const KSDEVICE_DESCRIPTOR *Descriptor);
4581
4582typedef struct _KSFILTERFACTORY KSFILTERFACTORY, *PKSFILTERFACTORY; //FIXME
4583
4587NTAPI
4592 _In_opt_ const KSDEVICE_DESCRIPTOR *Descriptor);
4593
4595typedef void
4596(NTAPI *PFNKSFILTERFACTORYPOWER)(
4597 _In_ PKSFILTERFACTORY FilterFactory,
4599
4604NTAPI
4605_KsEdit(
4606 _In_ KSOBJECT_BAG ObjectBag,
4607 _Inout_ PVOID *PointerToPointerToItem,
4609 _In_ ULONG OldSize,
4610 _In_ ULONG Tag);
4611
4614VOID
4615NTAPI
4617 _In_ PVOID Object);
4618
4621VOID
4622NTAPI
4624 _In_ PKSDEVICE Device);
4625
4629NTAPI
4633
4636VOID
4637NTAPI
4640 _In_ PKSEVENT_ENTRY EventEntry);
4641
4646NTAPI
4648 _In_ KSOBJECT_BAG ObjectBag,
4650 _In_opt_ PFNKSFREE Free);
4651
4654ULONG
4655NTAPI
4657 _In_ KSOBJECT_BAG ObjectBag,
4658 _In_ PVOID Item,
4659 _In_ BOOLEAN Free);
4660
4664NTAPI
4666 _In_ PKSDEVICE Device,
4667 _Out_ KSOBJECT_BAG *ObjectBag);
4668
4671VOID
4672NTAPI
4674 _In_ KSOBJECT_BAG ObjectBag);
4675
4678VOID
4679NTAPI
4681 _In_ PIRP Irp);
4682
4686NTAPI
4688 _In_ KSOBJECT_BAG ObjectBagDestination,
4689 _In_ KSOBJECT_BAG ObjectBagSource);
4690
4694NTAPI
4698 _In_opt_ const KSDEVICE_DESCRIPTOR *Descriptor,
4699 _In_ ULONG ExtensionSize,
4700 _Out_opt_ PKSDEVICE *Device);
4701
4706NTAPI
4709 _In_ const KSFILTER_DESCRIPTOR *Descriptor,
4712 _In_ ULONG CreateItemFlags,