- Make ks and portcls compile under msvc
[reactos.git] / reactos / include / ddk / portcls.h
1 /*
2 ReactOS Kernel Streaming
3 Port Class
4
5 Andrew Greenwood
6
7 NOTES:
8 Does not support PC_OLD_NAMES (which is required for backwards-compatibility
9 with older code)
10
11 Obsolete macros are not implemented. For more info:
12 http://www.osronline.com/ddkx/stream/audpc-struct_167n.htm
13
14
15 == EXPORTS ==
16 DRM (new in XP):
17 * PcAddContentHandlers
18 * PcCreateContentMixed
19 * PcDestroyContent
20 * PcForwardContentToDeviceObject
21 * PcForwardContentToFileObject
22 * PcForwardContentToInterface
23 * PcGetContentRights
24
25 IRP HANDLING:
26 * PcCompleteIrp
27 * PcDispatchIrp
28 * PcForwardIrpSynchronous
29
30 ADAPTER:
31 * PcAddAdapterDevice
32 * PcInitializeAdapterDriver
33
34 FACTORIES:
35 * PcNewDmaChannel
36 * PcNewInterruptSync
37 * PcNewMiniport
38 * PcNewPort
39 * PcNewRegistryKey
40 * PcNewResourceList
41 * PcNewResourceSublist
42 * PcNewServiceGroup
43
44 POWER MANAGEMENT:
45 * PcRegisterAdapterPowerManagement
46 * PcRequestNewPowerState
47
48 PROPERTIES:
49 * PcCompletePendingPropertyRequest
50 * PcGetDeviceProperty
51
52 IO TIMEOUTS:
53 * PcRegisterIoTimeout
54 * PcUnregisterIoTimeout
55
56 PHYSICAL CONNECTIONS:
57 * PcRegisterPhysicalConnection
58 * PcRegisterPhysicalConnectionFromExternal
59 * PcRegisterPhysicalConnectionToExternal
60
61 MISC:
62 * PcGetTimeInterval
63 * PcRegisterSubdevice
64
65
66 == AUDIO HELPER OBJECT INTERFACES ==
67 IDmaChannel
68 IDmaChannelSlave
69 IDmaOperations
70 IDrmPort (XP)
71 IDrmPort2 (XP)
72 IInterruptSync
73 IMasterClock
74 IPortClsVersion (XP)
75 IPortEvents
76 IPreFetchOffset (XP)
77 IRegistryKey
78 IResourceList
79 IServiceGroup
80 IServiceSink
81 IUnregisterPhysicalConnection (Vista)
82 IUnregisterSubdevice (Vista)
83
84 == AUDIO PORT OBJECT INTERFACES ==
85 IPort
86 IPortDMus
87 IPortMidi
88 IPortTopology
89 IPortWaveCyclic
90 IPortWavePci
91
92 == AUDIO MINIPORT OBJECT INTERFACES ==
93 IMiniport
94 IMiniportDMus
95 IMiniportMidi
96 IMiniportTopology
97 IMiniportWaveCyclic
98 IMiniportWavePci
99
100 == AUDIO MINIPORT AUXILIARY INTERFACES ==
101 IMusicTechnology (XP)
102 IPinCount (XP)
103
104 == AUDIO STREAM OBJECT INTERFACES ==
105 IAllocatorMXF
106 IDrmAudioStream (XP)
107 IMiniportMidiStream
108 IMiniportWaveCyclicStream
109 IMiniportWavePciStream
110 IMXF
111 IPortWavePciStream
112 ISynthSinkDMus
113
114 == DIRECTMUSIC USERMODE SYNTH AND SYNTH SINK INTERFACES ==
115 IDirectMusicSynth
116 IDirectMusicSynthSink
117
118 == AUDIO POWER MANAGEMENT INTERFACES ==
119 IAdapterPowerManagement
120 IPowerNotify
121 */
122
123 #ifndef PORTCLS_H
124 #define PORTCLS_H
125
126 #ifdef __cplusplus
127 extern "C"
128 {
129 #include <wdm.h>
130 }
131 #else
132 #include <wdm.h>
133 #endif
134
135 #include <windef.h>
136
137 #define NOBITMAP
138 #include <mmreg.h>
139 #undef NOBITMAP
140
141 #include <punknown.h>
142 #include <ks.h>
143 #include <ksmedia.h>
144 #include <drmk.h>
145
146 #ifdef __cplusplus
147 extern "C"
148 {
149 #include <wdm.h>
150 }
151 #else
152 #include <wdm.h>
153 #endif
154
155 #ifndef PC_NO_IMPORTS
156 #define PORTCLASSAPI EXTERN_C __declspec(dllimport)
157 #else
158 #define PORTCLASSAPI EXTERN_C
159 #endif
160
161 /* TODO */
162 #define PCFILTER_NODE ((ULONG) -1)
163
164 /* HACK */
165 /* typedef PVOID CM_RESOURCE_TYPE; */
166
167 #define _100NS_UNITS_PER_SECOND 10000000L
168 #define PORT_CLASS_DEVICE_EXTENSION_SIZE ( 64 * sizeof(ULONG_PTR) )
169
170
171 DEFINE_GUID(CLSID_MiniportDriverFmSynth, 0xb4c90ae0L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
172 DEFINE_GUID(CLSID_MiniportDriverFmSynthWithVol, 0xe5a3c139L, 0xf0f2, 0x11d1, 0x81, 0xaf, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1);
173
174 /* ===============================================================
175 Event Item Flags - TODO
176 */
177 #define PCEVENT_ITEM_FLAG_ENABLE KSEVENT_TYPE_ENABLE
178 #define PCEVENT_ITEM_FLAG_ONESHOT KSEVENT_TYPE_ONESHOT
179 #define PCEVENT_ITEM_FLAG_BASICSUPPORT KSEVENT_TYPE_BASICSUPPORT
180
181
182 /* ===============================================================
183 Event Verbs - TODO
184 */
185 #define PCEVENT_VERB_NONE 0
186 #define PCEVENT_VERB_ADD 1
187 #define PCEVENT_VERB_REMOVE 2
188 #define PCEVENT_VERB_SUPPORT 4
189
190
191 /* ===============================================================
192 Method Item Flags - TODO
193 */
194 #define PCMETHOD_ITEM_FLAG_NONE KSMETHOD_TYPE_NONE
195 #define PCMETHOD_ITEM_FLAG_READ KSMETHOD_TYPE_READ
196 #define PCMETHOD_ITEM_FLAG_WRITE KSMETHOD_TYPE_WRITE
197 #define PCMETHOD_ITEM_FLAG_MODIFY KSMETHOD_TYPE_MODIFY
198 #define PCMETHOD_ITEM_FLAG_SOURCE KSMETHOD_TYPE_SOURCE
199
200
201 /* ===============================================================
202 Method Verbs - TODO
203 */
204 #define PCMETHOD_ITEM_FLAG_BASICSUPPORT KSMETHOD_TYPE_BASICSUPPORT
205 #define PCMETHOD_ITEM_FLAG_SEND
206 #define PCMETHOD_ITEM_FLAG_SETSUPPORT
207
208
209 /* ===============================================================
210 Versions
211 IoIsWdmVersionAvailable may also be used by older drivers.
212 */
213
214 enum
215 {
216 kVersionInvalid = -1,
217
218 kVersionWin98,
219 kVersionWin98SE,
220 kVersionWin2K,
221 kVersionWin98SE_QFE2,
222 kVersionWin2K_SP2,
223 kVersionWinME,
224 kVersionWin98SE_QFE3,
225 kVersionWinME_QFE1,
226 kVersionWinXP,
227 kVersionWinXPSP1,
228 kVersionWinServer2003,
229 kVersionWin2K_UAAQFE, /* These support IUnregister* interface */
230 kVersionWinXP_UAAQFE,
231 kVersionWinServer2003_UAAQFE
232 };
233
234 /* ===============================================================
235 Properties
236 */
237
238 struct _PCPROPERTY_REQUEST;
239
240 typedef struct _PCPROPERTY_REQUEST PCPROPERTY_REQUEST, *PPCPROPERTY_REQUEST;
241
242 typedef NTSTATUS (NTAPI *PCPFNPROPERTY_HANDLER)(
243 IN PPCPROPERTY_REQUEST PropertyRequest);
244
245 typedef struct
246 {
247 const GUID * Set;
248 ULONG Id;
249 ULONG Flags;
250 #define PCPROPERTY_ITEM_FLAG_GET KSPROPERTY_TYPE_GET
251 #define PCPROPERTY_ITEM_FLAG_SET KSPROPERTY_TYPE_SET
252 #define PCPROPERTY_ITEM_FLAG_BASICSUPPORT KSPROPERTY_TYPE_BASICSUPPORT
253 //not supported #define PCPROPERTY_ITEM_FLAG_RELATIONS KSPROPERTY_TYPE_RELATIONS
254 #define PCPROPERTY_ITEM_FLAG_SERIALIZERAW KSPROPERTY_TYPE_SERIALIZERAW
255 #define PCPROPERTY_ITEM_FLAG_UNSERIALIZERAW KSPROPERTY_TYPE_UNSERIALIZERAW
256 #define PCPROPERTY_ITEM_FLAG_SERIALIZESIZE KSPROPERTY_TYPE_SERIALIZESIZE
257 #define PCPROPERTY_ITEM_FLAG_SERIALIZE\
258 (PCPROPERTY_ITEM_FLAG_SERIALIZERAW\
259 |PCPROPERTY_ITEM_FLAG_UNSERIALIZERAW\
260 |PCPROPERTY_ITEM_FLAG_SERIALIZESIZE\
261 )
262 #define PCPROPERTY_ITEM_FLAG_DEFAULTVALUES KSPROPERTY_TYPE_DEFAULTVALUES
263 PCPFNPROPERTY_HANDLER Handler;
264 }
265 PCPROPERTY_ITEM, *PPCPROPERTY_ITEM;
266
267
268 struct _PCPROPERTY_REQUEST
269 {
270 PUNKNOWN MajorTarget;
271 PUNKNOWN MinorTarget;
272 ULONG Node;
273 const PCPROPERTY_ITEM * PropertyItem;
274 ULONG Verb;
275 ULONG InstanceSize;
276 PVOID Instance;
277 ULONG ValueSize;
278 PVOID Value;
279 PIRP Irp;
280 };
281
282 struct _PCEVENT_REQUEST;
283
284 typedef NTSTATUS (NTAPI *PCPFNEVENT_HANDLER)(
285 IN struct _PCEVENT_REQUEST* EventRequest);
286
287 typedef struct _PCEVENT_ITEM
288 {
289 const GUID* Set;
290 ULONG Id;
291 ULONG Flags;
292 PCPFNEVENT_HANDLER Handler;
293 } PCEVENT_ITEM, *PPCEVENT_ITEM;
294
295 typedef struct _PCEVENT_REQUEST
296 {
297 PUNKNOWN MajorTarget;
298 PUNKNOWN MinorTarget;
299 ULONG Node;
300 const PCEVENT_ITEM* EventItem;
301 PKSEVENT_ENTRY EventEntry;
302 ULONG Verb;
303 PIRP Irp;
304 } PCEVENT_REQUEST, *PPCEVENT_REQUEST;
305
306
307
308 struct _PCMETHOD_REQUEST;
309
310 typedef NTSTATUS (NTAPI *PCPFNMETHOD_HANDLER)(
311 IN struct _PCMETHOD_REQUEST* MethodRequest);
312
313 typedef struct _PCMETHOD_ITEM
314 {
315 const GUID* Set;
316 ULONG Id;
317 ULONG Flags;
318 PCPFNMETHOD_HANDLER Handler;
319 } PCMETHOD_ITEM, *PPCMETHOD_ITEM;
320
321 typedef struct _PCMETHOD_REQUEST
322 {
323 PUNKNOWN MajorTarget;
324 PUNKNOWN MinorTarget;
325 ULONG Node;
326 const PCMETHOD_ITEM* MethodItem;
327 ULONG Verb;
328 } PCMETHOD_REQUEST, *PPCMETHOD_REQUEST;
329
330
331 /* ===============================================================
332 Structures (unsorted)
333 */
334
335 typedef struct
336 {
337 ULONG PropertyItemSize;
338 ULONG PropertyCount;
339 const PCPROPERTY_ITEM* Properties;
340 ULONG MethodItemSize;
341 ULONG MethodCount;
342 const PCMETHOD_ITEM* Methods;
343 ULONG EventItemSize;
344 ULONG EventCount;
345 const PCEVENT_ITEM* Events;
346 ULONG Reserved;
347 } PCAUTOMATION_TABLE, *PPCAUTOMATION_TABLE;
348
349 typedef struct
350 {
351 ULONG FromNode;
352 ULONG FromNodePin;
353 ULONG ToNode;
354 ULONG ToNodePin;
355 } PCCONNECTION_DESCRIPTOR, *PPCCONNECTIONDESCRIPTOR;
356
357 typedef struct
358 {
359 ULONG MaxGlobalInstanceCount;
360 ULONG MaxFilterInstanceCount;
361 ULONG MinFilterInstanceCount;
362 const PCAUTOMATION_TABLE* AutomationTable;
363 KSPIN_DESCRIPTOR KsPinDescriptor;
364 } PCPIN_DESCRIPTOR, *PPCPIN_DESCRIPTOR;
365
366 typedef struct
367 {
368 ULONG Flags;
369 const PCAUTOMATION_TABLE* AutomationTable;
370 const GUID* Type;
371 const GUID* Name;
372 } PCNODE_DESCRIPTOR, *PPCNODE_DESCRIPTOR;
373
374 typedef struct
375 {
376 ULONG Version;
377 const PCAUTOMATION_TABLE* AutomationTable;
378 ULONG PinSize;
379 ULONG PinCount;
380 const PCPIN_DESCRIPTOR* Pins;
381 ULONG NodeSize;
382 ULONG NodeCount;
383 const PCNODE_DESCRIPTOR* Nodes;
384 ULONG ConnectionCount;
385 const PCCONNECTION_DESCRIPTOR* Connections;
386 ULONG CategoryCount;
387 const GUID* Categories;
388 } PCFILTER_DESCRIPTOR, *PPCFILTER_DESCRIPTOR;
389
390 #define DEFINE_PCAUTOMATION_TABLE_PROP(AutomationTable,PropertyTable)\
391 const PCAUTOMATION_TABLE AutomationTable =\
392 {\
393 sizeof(PropertyTable[0]),\
394 SIZEOF_ARRAY(PropertyTable),\
395 (const PCPROPERTY_ITEM *) PropertyTable,\
396 0,0,NULL,\
397 0,0,NULL,\
398 0\
399 }
400
401 /* ===============================================================
402 IResourceList Interface
403 */
404
405 #undef INTERFACE
406 #define INTERFACE IResourceList
407
408 DEFINE_GUID(IID_IResourceList, 0x22C6AC60L, 0x851B, 0x11D0, 0x9A, 0x7F, 0x00, 0xAA, 0x00, 0x38, 0xAC, 0xFE);
409
410 DECLARE_INTERFACE_(IResourceList, IUnknown)
411 {
412 DEFINE_ABSTRACT_UNKNOWN()
413
414 STDMETHOD_(ULONG, NumberOfEntries)( THIS ) PURE;
415
416 STDMETHOD_(ULONG, NumberOfEntriesOfType)( THIS_
417 IN CM_RESOURCE_TYPE Type) PURE;
418
419 STDMETHOD_(PCM_PARTIAL_RESOURCE_DESCRIPTOR, FindTranslatedEntry)( THIS_
420 IN CM_RESOURCE_TYPE Type,
421 IN ULONG Index) PURE;
422
423 STDMETHOD_(PCM_PARTIAL_RESOURCE_DESCRIPTOR, FindUntranslatedEntry)( THIS_
424 IN CM_RESOURCE_TYPE Type,
425 IN ULONG Index) PURE;
426
427 STDMETHOD_(NTSTATUS, AddEntry)( THIS_
428 IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Translated,
429 IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Untranslated) PURE;
430
431 STDMETHOD_(NTSTATUS, AddEntryFromParent)( THIS_
432 IN IResourceList* Parent,
433 IN CM_RESOURCE_TYPE Type,
434 IN ULONG Index) PURE;
435
436 STDMETHOD_(PCM_RESOURCE_LIST, TranslatedList)( THIS ) PURE;
437 STDMETHOD_(PCM_RESOURCE_LIST, UntranslatedList)( THIS ) PURE;
438 };
439
440 #define IMP_IResourceList \
441 STDMETHODIMP_(ULONG) NumberOfEntries(void); \
442 \
443 STDMETHODIMP_(ULONG) NumberOfEntriesOfType( \
444 IN CM_RESOURCE_TYPE Type); \
445 \
446 STDMETHODIMP_(PCM_PARTIAL_RESOURCE_DESCRIPTOR) FindTranslatedEntry( \
447 IN CM_RESOURCE_TYPE Type, \
448 IN ULONG Index); \
449 \
450 STDMETHODIMP_(PCM_PARTIAL_RESOURCE_DESCRIPTOR) FindUntranslatedEntry( \
451 IN CM_RESOURCE_TYPE Type, \
452 IN ULONG Index); \
453 \
454 STDMETHODIMP_(NTSTATUS) AddEntry( \
455 IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Translated, \
456 IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Untranslated); \
457 \
458 STDMETHODIMP_(NTSTATUS) AddEntryFromParent( \
459 IN IResourceList* Parent, \
460 IN CM_RESOURCE_TYPE Type, \
461 IN ULONG Index); \
462 \
463 STDMETHODIMP_(PCM_RESOURCE_LIST) TranslatedList(void); \
464 STDMETHODIMP_(PCM_RESOURCE_LIST) UntranslatedList(void);
465
466 typedef IResourceList *PRESOURCELIST;
467
468 #define NumberOfPorts() \
469 NumberOfEntriesOfType(CmResourceTypePort)
470
471 #define FindTranslatedPort(n) \
472 FindTranslatedEntry(CmResourceTypePort, (n))
473
474 #define FindUntranslatedPort(n) \
475 FindUntranslatedEntry(CmResourceTypePort, (n))
476
477 #define AddPortFromParent(p, n) \
478 AddEntryFromParent((p), CmResourceTypePort, (n))
479
480 #define NumberOfInterrupts() \
481 NumberOfEntriesOfType(CmResourceTypeInterrupt)
482
483 #define FindTranslatedInterrupt(n) \
484 FindTranslatedEntry(CmResourceTypeInterrupt, (n))
485
486 #define FindUntranslatedInterrupt(n) \
487 FindUntranslatedEntry(CmResourceTypeInterrupt, (n))
488
489 #define AddInterruptFromParent(p, n) \
490 AddEntryFromParent((p), CmResourceTypeInterrupt, (n))
491
492 #define NumberOfMemories() \
493 NumberOfEntriesOfType(CmResourceTypeMemory)
494
495 #define FindTranslatedMemory(n) \
496 FindTranslatedEntry(CmResourceTypeMemory, (n))
497
498 #define FindUntranslatedMemory(n) \
499 FindUntranslatedEntry(CmResourceTypeMemory, (n))
500
501 #define AddMemoryFromParent(p, n) \
502 AddEntryFromParent((p), CmResourceTypeMemory, (n))
503
504 #define NumberOfDmas() \
505 NumberOfEntriesOfType(CmResourceTypeDma)
506
507 #define FindTranslatedDma(n) \
508 FindTranslatedEntry(CmResourceTypeDma, (n))
509
510 #define FindUntranslatedDma(n) \
511 FindUntranslatedEntry(CmResourceTypeDma, (n))
512
513 #define AddDmaFromParent(p, n) \
514 AddEntryFromParent((p), CmResourceTypeInterrupt, (n))
515
516 #define NumberOfDeviceSpecifics() \
517 NumberOfEntriesOfType(CmResourceTypeDeviceSpecific)
518
519 #define FindTranslatedDeviceSpecific(n) \
520 FindTranslatedEntry(CmResourceTypeDeviceSpecific, (n))
521
522 #define FindUntranslatedDeviceSpecific(n) \
523 FindUntranslatedEntry(CmResourceTypeDeviceSpecific, (n))
524
525 #define AddDeviceSpecificFromParent(p, n) \
526 AddEntryFromParent((p), CmResourceTypeDeviceSpecific, (n))
527
528 #define NumberOfBusNumbers() \
529 NumberOfEntriesOfType(CmResourceTypeBusNumber)
530
531 #define FindTranslatedBusNumber(n) \
532 FindTranslatedEntry(CmResourceTypeBusNumber, (n))
533
534 #define FindUntranslatedBusNumber(n) \
535 FindUntranslatedEntry(CmResourceTypeBusNumber, (n))
536
537 #define AddBusNumberFromParent(p, n) \
538 AddEntryFromParent((p), CmResourceTypeBusNumber, (n))
539
540 #define NumberOfDevicePrivates() \
541 NumberOfEntriesOfType(CmResourceTypeDevicePrivate)
542
543 #define FindTranslatedDevicePrivate(n) \
544 FindTranslatedEntry(CmResourceTypeDevicePrivate, (n))
545
546 #define FindUntranslatedDevicePrivate(n) \
547 FindUntranslatedEntry(CmResourceTypeDevicePrivate, (n))
548
549 #define AddDevicePrivateFromParent(p, n) \
550 AddEntryFromParent((p), CmResourceTypeDevicePrivate, (n))
551
552 #define NumberOfAssignedResources() \
553 NumberOfEntriesOfType(CmResourceTypeAssignedResource)
554
555 #define FindTranslatedAssignedResource(n) \
556 FindTranslatedEntry(CmResourceTypeAssignedResource, (n))
557
558 #define FindUntranslatedAssignedResource(n) \
559 FindUntranslatedEntry(CmResourceTypeAssignedResource, (n))
560
561 #define AddAssignedResourceFromParent(p, n) \
562 AddEntryFromParent((p), CmResourceTypeAssignedResource, (n))
563
564 #define NumberOfSubAllocateFroms() \
565 NumberOfEntriesOfType(CmResourceTypeSubAllocateFrom)
566
567 #define FindTranslatedSubAllocateFrom(n) \
568 FindTranslatedEntry(CmResourceTypeSubAllocateFrom, (n))
569
570 #define FindUntranslatedSubAllocateFrom(n) \
571 FindUntranslatedEntry(CmResourceTypeSubAllocateFrom, (n))
572
573 #define AddSubAllocateFromFromParent(p, n) \
574 AddEntryFromParent((p), CmResourceTypeSubAllocateFrom, (n))
575
576 #undef INTERFACE
577
578
579 /* ===============================================================
580 IServiceSink Interface
581 */
582 #define INTERFACE IServiceSink
583
584 DEFINE_GUID(IID_IServiceSink, 0x22C6AC64L, 0x851B, 0x11D0, 0x9A, 0x7F, 0x00, 0xAA, 0x00, 0x38, 0xAC, 0xFE);
585
586 DECLARE_INTERFACE_(IServiceSink, IUnknown)
587 {
588 DEFINE_ABSTRACT_UNKNOWN()
589 STDMETHOD_(void, RequestService)( THIS ) PURE;
590 };
591
592 #define IMP_IServiceSink \
593 STDMETHODIMP_(void) RequestService(void);
594
595 typedef IServiceSink *PSERVICESINK;
596
597
598 /* ===============================================================
599 IServiceGroup Interface
600 */
601 #undef INTERFACE
602 #define INTERFACE IServiceGroup
603
604 DEFINE_GUID(IID_IServiceGroup, 0x22C6AC65L, 0x851B, 0x11D0, 0x9A, 0x7F, 0x00, 0xAA, 0x00, 0x38, 0xAC, 0xFE);
605
606 DECLARE_INTERFACE_(IServiceGroup, IServiceSink)
607 {
608 DEFINE_ABSTRACT_UNKNOWN()
609
610 STDMETHOD_(void, RequestService)( THIS ) PURE; /* IServiceSink */
611
612 STDMETHOD_(NTSTATUS, AddMember)( THIS_
613 IN PSERVICESINK pServiceSink) PURE;
614
615 STDMETHOD_(void, RemoveMember)( THIS_
616 IN PSERVICESINK pServiceSink) PURE;
617
618 STDMETHOD_(void, SupportDelayedService)( THIS ) PURE;
619
620 STDMETHOD_(void, RequestDelayedService)( THIS_
621 IN ULONGLONG ullDelay) PURE;
622
623 STDMETHOD_(void, CancelDelayedService)( THIS ) PURE;
624 };
625
626 #define IMP_IServiceGroup \
627 IMP_IServiceSink; \
628 \
629 STDMETHODIMP_(NTSTATUS) AddMember( \
630 IN PSERVICESINK pServiceSink); \
631 \
632 STDMETHODIMP_(void) RemoveMember( \
633 IN PSERVICESINK pServiceSink); \
634 \
635 STDMETHODIMP_(void) SupportDelayedService(void); \
636 \
637 STDMETHODIMP_(void) RequestDelayedService( \
638 IN ULONGLONG ullDelay); \
639 \
640 STDMETHODIMP_(void) CancelDelayedService(void);
641
642 typedef IServiceGroup *PSERVICEGROUP;
643
644
645 #if (NTDDI_VERSION >= NTDDI_WIN2003)
646 /* ===============================================================
647 IUnregisterSubdevice Interface
648 */
649
650 DEFINE_GUID(IID_IUnregisterSubdevice, 0x16738177L, 0xe199, 0x41f9, 0x9a, 0x87, 0xab, 0xb2, 0xa5, 0x43, 0x2f, 0x21);
651
652 #undef INTERFACE
653 #define INTERFACE IUnregisterSubdevice
654
655 DECLARE_INTERFACE_(IUnregisterSubdevice,IUnknown)
656 {
657 DEFINE_ABSTRACT_UNKNOWN()
658
659 STDMETHOD_(NTSTATUS,UnregisterSubdevice)(THIS_
660 IN PDEVICE_OBJECT DeviceObject,
661 IN PUNKNOWN Unknown)PURE;
662 };
663
664 typedef IUnregisterSubdevice *PUNREGISTERSUBDEVICE;
665
666 /* ===============================================================
667 IUnregisterPhysicalConnection Interface
668 */
669
670 #undef INTERFACE
671 #define INTERFACE IUnregisterPhysicalConnection
672
673 DEFINE_GUID(IID_IUnregisterPhysicalConnection, 0x6c38e231L, 0x2a0d, 0x428d, 0x81, 0xf8, 0x07, 0xcc, 0x42, 0x8b, 0xb9, 0xa4);
674
675 DECLARE_INTERFACE_(IUnregisterPhysicalConnection,IUnknown)
676 {
677 DEFINE_ABSTRACT_UNKNOWN()
678
679 STDMETHOD_(NTSTATUS,UnregisterPhysicalConnection)(THIS_
680 IN PDEVICE_OBJECT DeviceObject,
681 IN PUNKNOWN FromUnknown,
682 IN ULONG FromPin,
683 IN PUNKNOWN ToUnknown,
684 IN ULONG ToPin)PURE;
685
686 STDMETHOD_(NTSTATUS,UnregisterPhysicalConnectionToExternal)(THIS_
687 IN PDEVICE_OBJECT DeviceObject,
688 IN PUNKNOWN FromUnknown,
689 IN ULONG FromPin,
690 IN PUNICODE_STRING ToString,
691 IN ULONG ToPin)PURE;
692
693 STDMETHOD_(NTSTATUS,UnregisterPhysicalConnectionFromExternal)(THIS_
694 IN PDEVICE_OBJECT DeviceObject,
695 IN PUNICODE_STRING FromString,
696 IN ULONG FromPin,
697 IN PUNKNOWN ToUnknown,
698 IN ULONG ToPin)PURE;
699 };
700
701 typedef IUnregisterPhysicalConnection *PUNREGISTERPHYSICALCONNECTION;
702 #endif
703
704 /* ===============================================================
705 IDmaChannel Interface
706 */
707
708 #define DEFINE_ABSTRACT_DMACHANNEL() \
709 STDMETHOD_(NTSTATUS, AllocateBuffer)( THIS_ \
710 IN ULONG BufferSize, \
711 IN PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL) PURE; \
712 \
713 STDMETHOD_(void, FreeBuffer)( THIS ) PURE; \
714 STDMETHOD_(ULONG, TransferCount)( THIS ) PURE; \
715 STDMETHOD_(ULONG, MaximumBufferSize)( THIS ) PURE; \
716 STDMETHOD_(ULONG, AllocatedBufferSize)( THIS ) PURE; \
717 STDMETHOD_(ULONG, BufferSize)( THIS ) PURE; \
718 \
719 STDMETHOD_(void, SetBufferSize)( THIS_ \
720 IN ULONG BufferSize) PURE; \
721 \
722 STDMETHOD_(PVOID, SystemAddress)( THIS ) PURE; \
723 STDMETHOD_(PHYSICAL_ADDRESS, PhysicalAddress)( THIS ) PURE; \
724 STDMETHOD_(PADAPTER_OBJECT, GetAdapterObject)( THIS ) PURE; \
725 \
726 STDMETHOD_(void, CopyTo)( THIS_ \
727 IN PVOID Destination, \
728 IN PVOID Source, \
729 IN ULONG ByteCount) PURE; \
730 \
731 STDMETHOD_(void, CopyFrom)( THIS_ \
732 IN PVOID Destination, \
733 IN PVOID Source, \
734 IN ULONG ByteCount) PURE;
735
736 #define IMP_IDmaChannel() \
737 STDMETHODIMP_(NTSTATUS) AllocateBuffer( \
738 IN ULONG BufferSize, \
739 IN PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL); \
740 \
741 STDMETHODIMP_(void) FreeBuffer(void); \
742 STDMETHODIMP_(ULONG) TransferCount(void); \
743 STDMETHODIMP_(ULONG) MaximumBufferSize(void); \
744 STDMETHODIMP_(ULONG) AllocatedBufferSize(void); \
745 STDMETHODIMP_(ULONG) BufferSize(void); \
746 \
747 STDMETHODIMP_(void) SetBufferSize)( \
748 IN ULONG BufferSize); \
749 \
750 STDMETHODIMP_(PVOID) SystemAddress(void); \
751 STDMETHODIMP_(PHYSICAL_ADDRESS) PhysicalAddress(void); \
752 STDMETHODIMP_(PADAPTER_OBJECT) GetAdapterObject(void); \
753 \
754 STDMETHODIMP_(void) CopyTo( \
755 IN PVOID Destination, \
756 IN PVOID Source, \
757 IN ULONG ByteCount); \
758 \
759 STDMETHODIMP_(void) CopyFrom( \
760 IN PVOID Destination, \
761 IN PVOID Source, \
762 IN ULONG ByteCount);
763
764 #undef INTERFACE
765 #define INTERFACE IDmaChannel
766
767 DEFINE_GUID(IID_IDmaChannel, 0x22C6AC61L, 0x851B, 0x11D0, 0x9A, 0x7F, 0x00, 0xAA, 0x00, 0x38, 0xAC, 0xFE);
768
769 DECLARE_INTERFACE_(IDmaChannel, IUnknown)
770 {
771 DEFINE_ABSTRACT_UNKNOWN()
772 DEFINE_ABSTRACT_DMACHANNEL()
773 };
774
775 typedef IDmaChannel *PDMACHANNEL;
776
777
778 /* ===============================================================
779 IDmaChannelSlave Interface
780 */
781
782 #define DEFINE_ABSTRACT_DMACHANNELSLAVE() \
783 STDMETHOD_(NTSTATUS, Start)( THIS_ \
784 IN ULONG MapSize, \
785 IN BOOLEAN WriteToDevice) PURE; \
786 \
787 STDMETHOD_(NTSTATUS, Stop)( THIS ) PURE; \
788 STDMETHOD_(ULONG, ReadCounter)( THIS ) PURE; \
789 \
790 STDMETHOD_(NTSTATUS, WaitForTC)( THIS_ \
791 ULONG Timeout) PURE;
792
793 #define IMP_IDmaChannelSlave \
794 STDMETHODIMP_(NTSTATUS) Start( \
795 IN ULONG MapSize, \
796 IN BOOLEAN WriteToDevice); \
797 \
798 STDMETHODIMP_(NTSTATUS) Stop(void); \
799 STDMETHODIMP_(ULONG) ReadCounter)(void); \
800 \
801 STDMETHODIMP_(NTSTATUS, WaitForTC)( \
802 ULONG Timeout);
803
804 #undef INTERFACE
805 #define INTERFACE IDmaChannelSlave
806
807 #if (NTDDI_VERSION < NTDDI_LONGHORN)
808 DEFINE_GUID(IID_IDmaChannelSlave, 0x22C6AC62L, 0x851B, 0x11D0, 0x9A, 0x7F, 0x00, 0xAA, 0x00, 0x38, 0xAC, 0xFE);
809 #endif
810
811 #undef INTERFACE
812 #define INTERFACE IDmaChannelSlave
813
814 DECLARE_INTERFACE_(IDmaChannelSlave, IDmaChannel)
815 {
816 DEFINE_ABSTRACT_UNKNOWN()
817 DEFINE_ABSTRACT_DMACHANNEL()
818 DEFINE_ABSTRACT_DMACHANNELSLAVE()
819 };
820
821 typedef IDmaChannelSlave *PDMACHANNELSLAVE;
822
823
824 /* ===============================================================
825 IInterruptSync Interface
826 */
827
828 typedef enum
829 {
830 InterruptSyncModeNormal = 1,
831 InterruptSyncModeAll,
832 InterruptSyncModeRepeat
833 } INTERRUPTSYNCMODE;
834
835 struct IInterruptSync;
836
837 typedef NTSTATUS (NTAPI *PINTERRUPTSYNCROUTINE)(
838 IN struct IInterruptSync* InterruptSync,
839 IN PVOID DynamicContext);
840
841 #undef INTERFACE
842 #define INTERFACE IInterruptSync
843
844 DECLARE_INTERFACE_(IInterruptSync, IUnknown)
845 {
846 DEFINE_ABSTRACT_UNKNOWN()
847
848 STDMETHOD_(NTSTATUS, CallSynchronizedRoutine)( THIS_
849 IN PINTERRUPTSYNCROUTINE Routine,
850 IN PVOID DynamicContext) PURE;
851
852 STDMETHOD_(PKINTERRUPT, GetKInterrupt)( THIS ) PURE;
853 STDMETHOD_(NTSTATUS, Connect)( THIS ) PURE;
854 STDMETHOD_(void, Disconnect)( THIS ) PURE;
855
856 STDMETHOD_(NTSTATUS, RegisterServiceRoutine)( THIS_
857 IN PINTERRUPTSYNCROUTINE Routine,
858 IN PVOID DynamicContext,
859 IN BOOLEAN First) PURE;
860 };
861
862 DEFINE_GUID(IID_IInterruptSync, 0x22C6AC63L, 0x851B, 0x11D0, 0x9A, 0x7F, 0x00, 0xAA, 0x00, 0x38, 0xAC, 0xFE);
863
864 #define IMP_IInterruptSync \
865 STDMETHODIMP_(NTSTATUS, CallSynchronizedRoutine)( \
866 IN PINTERRUPTSYNCROUTINE Routine, \
867 IN PVOID DynamicContext); \
868 \
869 STDMETHODIMP_(PKINTERRUPT, GetKInterrupt)(void); \
870 STDMETHODIMP_(NTSTATUS, Connect)(void); \
871 STDMETHODIMP_(void, Disconnect)(void); \
872 \
873 STDMETHODIMP_(NTSTATUS, RegisterServiceRoutine)( \
874 IN PINTERRUPTSYNCROUTINE Routine, \
875 IN PVOID DynamicContext, \
876 IN BOOLEAN First);
877
878 typedef IInterruptSync *PINTERRUPTSYNC;
879
880
881 /* ===============================================================
882 IRegistryKey Interface
883 */
884
885 #undef INTERFACE
886 #define INTERFACE IRegistryKey
887
888 enum
889 {
890 GeneralRegistryKey,
891 DeviceRegistryKey,
892 DriverRegistryKey,
893 HwProfileRegistryKey,
894 DeviceInterfaceRegistryKey
895 };
896
897 DEFINE_GUID(IID_IRegistryKey, 0xE8DA4302l, 0xF304, 0x11D0, 0x95, 0x8B, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3);
898
899 DECLARE_INTERFACE_(IRegistryKey, IUnknown)
900 {
901 DEFINE_ABSTRACT_UNKNOWN()
902
903 STDMETHOD_(NTSTATUS, QueryKey)( THIS_
904 IN KEY_INFORMATION_CLASS KeyInformationClass,
905 OUT PVOID KeyInformation,
906 IN ULONG Length,
907 OUT PULONG ResultLength) PURE;
908
909 STDMETHOD_(NTSTATUS, EnumerateKey)( THIS_
910 IN ULONG Index,
911 IN KEY_INFORMATION_CLASS KeyInformationClass,
912 OUT PVOID KeyInformation,
913 IN ULONG Length,
914 OUT PULONG ResultLength) PURE;
915
916 STDMETHOD_(NTSTATUS, QueryValueKey)( THIS_
917 IN PUNICODE_STRING ValueName,
918 IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
919 OUT PVOID KeyValueInformation,
920 IN ULONG Length,
921 OUT PULONG ResultLength) PURE;
922
923 STDMETHOD_(NTSTATUS, EnumerateValueKey)( THIS_
924 IN ULONG Index,
925 IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
926 OUT PVOID KeyValueInformation,
927 IN ULONG Length,
928 OUT PULONG ResultLength) PURE;
929
930 STDMETHOD_(NTSTATUS, SetValueKey)( THIS_
931 IN PUNICODE_STRING ValueName OPTIONAL,
932 IN ULONG Type,
933 IN PVOID Data,
934 IN ULONG DataSize) PURE;
935
936 STDMETHOD_(NTSTATUS, QueryRegistryValues)( THIS_
937 IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
938 IN PVOID Context OPTIONAL) PURE;
939
940 STDMETHOD_(NTSTATUS, NewSubKey)( THIS_
941 OUT IRegistryKey** RegistrySubKey,
942 IN PUNKNOWN OuterUnknown,
943 IN ACCESS_MASK DesiredAccess,
944 IN PUNICODE_STRING SubKeyName,
945 IN ULONG CreateOptions,
946 OUT PULONG Disposition OPTIONAL) PURE;
947
948 STDMETHOD_(NTSTATUS, DeleteKey)( THIS ) PURE;
949 };
950
951 #define IMP_IRegistryKey \
952 STDMETHODIMP_(NTSTATUS) QueryKey( \
953 IN KEY_INFORMATION_CLASS KeyInformationClass, \
954 OUT PVOID KeyInformation, \
955 IN ULONG Length, \
956 OUT PULONG ResultLength); \
957 \
958 STDMETHODIMP_(NTSTATUS) EnumerateKey( \
959 IN ULONG Index, \
960 IN KEY_INFORMATION_CLASS KeyInformationClass, \
961 OUT PVOID KeyInformation, \
962 IN ULONG Length, \
963 OUT PULONG ResultLength); \
964 \
965 STDMETHODIMP_(NTSTATUS) QueryValueKey( \
966 IN PUNICODE_STRING ValueName, \
967 IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, \
968 OUT PVOID KeyValueInformation, \
969 IN ULONG Length, \
970 OUT PULONG ResultLength); \
971 \
972 STDMETHODIMP_(NTSTATUS) EnumerateValueKey( \
973 IN ULONG Index, \
974 IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, \
975 OUT PVOID KeyValueInformation, \
976 IN ULONG Length, \
977 OUT PULONG ResultLength); \
978 \
979 STDMETHODIMP_(NTSTATUS) SetValueKey( \
980 IN PUNICODE_STRING ValueName OPTIONAL, \
981 IN ULONG Type, \
982 IN PVOID Data, \
983 IN ULONG DataSize); \
984 \
985 STDMETHODIMP_(NTSTATUS) QueryRegistryValues( \
986 IN PRTL_QUERY_REGISTRY_TABLE QueryTable, \
987 IN PVOID Context OPTIONAL); \
988 \
989 STDMETHODIMP_(NTSTATUS) NewSubKey( \
990 OUT IRegistryKey** RegistrySubKey, \
991 IN PUNKNOWN OuterUnknown, \
992 IN ACCESS_MASK DesiredAccess, \
993 IN PUNICODE_STRING SubKeyName, \
994 IN ULONG CreateOptions, \
995 OUT PULONG Disposition OPTIONAL); \
996 \
997 STDMETHODIMP_(NTSTATUS) DeleteKey(void);
998
999 typedef IRegistryKey *PREGISTRYKEY;
1000
1001
1002 /* ===============================================================
1003 IMusicTechnology Interface
1004 */
1005
1006 DECLARE_INTERFACE_(IMusicTechnology, IUnknown)
1007 {
1008 DEFINE_ABSTRACT_UNKNOWN()
1009
1010 STDMETHOD_(NTSTATUS, SetTechnology)( THIS_
1011 IN const GUID* Technology) PURE;
1012 };
1013
1014 #define IMP_IMusicTechnology \
1015 STDMETHODIMP_(NTSTATUS) SetTechnology( \
1016 IN const GUID* Technology);
1017
1018 typedef IMusicTechnology *PMUSICTECHNOLOGY;
1019
1020
1021 /* ===============================================================
1022 IPort Interface
1023 */
1024
1025 #if 0
1026 #define STATIC_IPort 0xb4c90a25L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44
1027 DEFINE_GUIDSTRUCT("0xB4C90A25-5791-11d0-86f9-00a0c911b544", IID_IPort);
1028 #define IID_IPort DEFINE_GUIDNAMED(IID_IPort)
1029 #endif
1030
1031 DEFINE_GUID(IID_IMiniport,
1032 0xb4c90a24L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1033
1034 DEFINE_GUID(IID_IPort,
1035 0xb4c90a25L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1036
1037 #define DEFINE_ABSTRACT_PORT() \
1038 STDMETHOD_(NTSTATUS, Init)( THIS_ \
1039 IN PDEVICE_OBJECT DeviceObject, \
1040 IN PIRP Irp, \
1041 IN PUNKNOWN UnknownMiniport, \
1042 IN PUNKNOWN UnknownAdapter OPTIONAL, \
1043 IN PRESOURCELIST ResourceList) PURE; \
1044 \
1045 STDMETHOD_(NTSTATUS, GetDeviceProperty)( THIS_ \
1046 IN DEVICE_REGISTRY_PROPERTY DeviceProperty, \
1047 IN ULONG BufferLength, \
1048 OUT PVOID PropertyBuffer, \
1049 OUT PULONG ResultLength) PURE; \
1050 \
1051 STDMETHOD_(NTSTATUS, NewRegistryKey)( THIS_ \
1052 OUT PREGISTRYKEY* OutRegistryKey, \
1053 IN PUNKNOWN OuterUnknown OPTIONAL, \
1054 IN ULONG RegistryKeyType, \
1055 IN ACCESS_MASK DesiredAccess, \
1056 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, \
1057 IN ULONG CreateOptiona OPTIONAL, \
1058 OUT PULONG Disposition OPTIONAL) PURE;
1059
1060 #define IMP_IPort() \
1061 STDMETHODIMP_(NTSTATUS) Init( \
1062 IN PDEVICE_OBJECT DeviceObject, \
1063 IN PIRP Irp, \
1064 IN PUNKNOWN UnknownMiniport, \
1065 IN PUNKNOWN UnknownAdapter OPTIONAL, \
1066 IN PRESOURCELIST ResourceList); \
1067 \
1068 STDMETHODIMP_(NTSTATUS) GetDeviceProperty( \
1069 IN DEVICE_REGISTRY_PROPERTY DeviceProperty, \
1070 IN ULONG BufferLength, \
1071 OUT PVOID PropertyBuffer, \
1072 OUT PULONG ResultLength); \
1073 \
1074 STDMETHODIMP_(NTSTATUS) NewRegistryKey( \
1075 OUT PREGISTRYKEY* OutRegistryKey, \
1076 IN PUNKNOWN OuterUnknown OPTIONAL, \
1077 IN ULONG RegistryKeyType, \
1078 IN ACCESS_MASK DesiredAccess, \
1079 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, \
1080 IN ULONG CreateOptiona OPTIONAL, \
1081 OUT PULONG Disposition OPTIONAL);
1082
1083 #undef INTERFACE
1084 #define INTERFACE IPort
1085
1086 DECLARE_INTERFACE_(IPort, IUnknown)
1087 {
1088 DEFINE_ABSTRACT_UNKNOWN()
1089 DEFINE_ABSTRACT_PORT()
1090 };
1091
1092 typedef IPort *PPORT;
1093
1094
1095 /* ===============================================================
1096 IPortMidi Interface
1097 */
1098
1099 DEFINE_GUID(IID_IPortMidi,
1100 0xb4c90a40L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1101 DEFINE_GUID(CLSID_PortMidi,
1102 0xb4c90a43L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1103
1104 #undef INTERFACE
1105 #define INTERFACE IPortMidi
1106
1107 DECLARE_INTERFACE_(IPortMidi, IPort)
1108 {
1109 DEFINE_ABSTRACT_UNKNOWN()
1110 DEFINE_ABSTRACT_PORT()
1111
1112 STDMETHOD_(VOID, Notify)(THIS_
1113 IN PSERVICEGROUP ServiceGroup OPTIONAL) PURE;
1114
1115 STDMETHOD_(NTSTATUS, RegisterServiceGroup)(THIS_
1116 IN PSERVICEGROUP ServiceGroup) PURE;
1117 };
1118
1119 typedef IPortMidi *PPORTMIDI;
1120
1121 #define IMP_IPortMidi() \
1122 STDMETHODIMP_(VOID) Notify( \
1123 IN PSERVICEGROUP ServiceGroup OPTIONAL); \
1124 \
1125 STDMETHODIMP_(NTSTATUS) RegisterServiceGroup( \
1126 IN PSERVICEGROUP ServiceGroup);
1127
1128 #undef INTERFACE
1129
1130 /* ===============================================================
1131 IPortWaveCyclic Interface
1132 */
1133
1134 DEFINE_GUID(IID_IPortWaveCyclic,
1135 0xb4c90a26L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1136 DEFINE_GUID(CLSID_PortWaveCyclic,
1137 0xb4c90a2aL, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1138
1139 #define INTERFACE IPortWaveCyclic
1140
1141 DECLARE_INTERFACE_(IPortWaveCyclic, IPort)
1142 {
1143 DEFINE_ABSTRACT_UNKNOWN()
1144
1145 DEFINE_ABSTRACT_PORT()
1146
1147 STDMETHOD_(VOID, Notify)(THIS_
1148 IN PSERVICEGROUP ServiceGroup) PURE;
1149
1150 STDMETHOD_(NTSTATUS, NewSlaveDmaChannel)(THIS_
1151 OUT PDMACHANNELSLAVE* DmaChannel,
1152 IN PUNKNOWN OuterUnknown,
1153 IN PRESOURCELIST ResourceList OPTIONAL,
1154 IN ULONG DmaIndex,
1155 IN ULONG MaximumLength,
1156 IN BOOL DemandMode,
1157 IN DMA_SPEED DmaSpeed) PURE;
1158
1159 STDMETHOD_(NTSTATUS, NewMasterDmaChannel)(THIS_
1160 OUT PDMACHANNEL* DmaChannel,
1161 IN PUNKNOWN OuterUnknown,
1162 IN PRESOURCELIST ResourceList OPTIONAL,
1163 IN ULONG MaximumLength,
1164 IN BOOL Dma32BitAddresses,
1165 IN BOOL Dma64BitAddresses,
1166 IN DMA_WIDTH DmaWidth,
1167 IN DMA_SPEED DmaSpeed) PURE;
1168
1169 };
1170
1171 typedef IPortWaveCyclic *PPORTWAVECYCLIC;
1172
1173 #undef INTERFACE
1174 /* ===============================================================
1175 IPortWavePci Interface
1176 */
1177 #undef INTERFACE
1178 #define INTERFACE IPortWavePci
1179
1180 DEFINE_GUID(IID_IPortWavePci,
1181 0xb4c90a50L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1182 DEFINE_GUID(CLSID_PortWavePci,
1183 0xb4c90a54L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1184
1185 DECLARE_INTERFACE_(IPortWavePci, IPort)
1186 {
1187 DEFINE_ABSTRACT_UNKNOWN()
1188 DEFINE_ABSTRACT_PORT()
1189
1190 STDMETHOD_(VOID, Notify)(THIS_
1191 IN PSERVICEGROUP ServiceGroup) PURE;
1192
1193 STDMETHOD_(NTSTATUS, NewMasterDmaChannel)(THIS_
1194 OUT PDMACHANNEL* DmaChannel,
1195 IN PUNKNOWN OuterUnknown,
1196 IN POOL_TYPE PoolType,
1197 IN PRESOURCELIST ResourceList OPTIONAL,
1198 IN BOOLEAN ScatterGather,
1199 IN BOOLEAN Dma32BitAddresses,
1200 IN BOOLEAN Dma64BitAddresses,
1201 IN BOOLEAN IgnoreCount,
1202 IN DMA_WIDTH DmaWidth,
1203 IN DMA_SPEED DmaSpeed,
1204 IN ULONG MaximumLength,
1205 IN ULONG DmaPort) PURE;
1206 };
1207
1208 typedef IPortWavePci *PPORTWAVEPCI;
1209 #undef INTERFACE
1210
1211
1212 /* ===============================================================
1213 IMiniPort Interface
1214 */
1215
1216 DEFINE_GUID(IID_IMiniPort,
1217 0xb4c90a24L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1218
1219 #define DEFINE_ABSTRACT_MINIPORT() \
1220 STDMETHOD_(NTSTATUS, GetDescription)( THIS_ \
1221 OUT PPCFILTER_DESCRIPTOR* Description) PURE; \
1222 \
1223 STDMETHOD_(NTSTATUS, DataRangeIntersection)( THIS_ \
1224 IN ULONG PinId, \
1225 IN PKSDATARANGE DataRange, \
1226 IN PKSDATARANGE MatchingDataRange, \
1227 IN ULONG OutputBufferLength, \
1228 OUT PVOID ResultantFormat OPTIONAL, \
1229 OUT PULONG ResultantFormatLength) PURE;
1230
1231 #define IMP_IMiniport \
1232 STDMETHODIMP_(NTSTATUS) GetDescription( \
1233 OUT PPCFILTER_DESCRIPTOR* Description); \
1234 \
1235 STDMETHODIMP_(NTSTATUS) DataRangeIntersection( \
1236 IN ULONG PinId, \
1237 IN PKSDATARANGE DataRange, \
1238 IN PKSDATARANGE MatchingDataRange, \
1239 IN ULONG OutputBufferLength, \
1240 OUT PVOID ResultantFormat OPTIONAL, \
1241 OUT PULONG ResultantFormatLength);
1242
1243 DECLARE_INTERFACE_(IMiniport, IUnknown)
1244 {
1245 DEFINE_ABSTRACT_UNKNOWN()
1246 DEFINE_ABSTRACT_MINIPORT()
1247 };
1248
1249 typedef IMiniport *PMINIPORT;
1250
1251
1252 /* ===============================================================
1253 IMiniportMidiStream Interface
1254 */
1255 #undef INTERFACE
1256 #define INTERFACE IMiniportMidiStream
1257
1258 DEFINE_GUID(IID_IMiniportMidiStream,
1259 0xb4c90a42L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1260
1261 DECLARE_INTERFACE_(IMiniportMidiStream, IUnknown)
1262 {
1263 DEFINE_ABSTRACT_UNKNOWN()
1264
1265 STDMETHOD_(NTSTATUS,SetFormat)(THIS_
1266 IN PKSDATAFORMAT DataFormat)PURE;
1267
1268 STDMETHOD_(NTSTATUS,SetState)(THIS_
1269 IN KSSTATE State)PURE;
1270
1271 STDMETHOD_(NTSTATUS,Read)(THIS_
1272 IN PVOID BufferAddress,
1273 IN ULONG BufferLength,
1274 OUT PULONG BytesRead)PURE;
1275
1276 STDMETHOD_(NTSTATUS,Write)(THIS_
1277 IN PVOID BufferAddress,
1278 IN ULONG BytesToWrite,
1279 OUT PULONG BytesWritten)PURE;
1280 };
1281
1282 typedef IMiniportMidiStream* PMINIPORTMIDISTREAM;
1283 #undef INTERFACE
1284
1285 /* ===============================================================
1286 IMiniportMidi Interface
1287 */
1288 #undef INTERFACE
1289 #define INTERFACE IMiniportMidi
1290
1291 DEFINE_GUID(IID_IMiniportMidi,
1292 0xb4c90a41L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1293
1294 DECLARE_INTERFACE_(IMiniportMidi, IMiniport)
1295 {
1296 DEFINE_ABSTRACT_UNKNOWN()
1297 DEFINE_ABSTRACT_MINIPORT()
1298
1299 STDMETHOD_(NTSTATUS, Init)(THIS_
1300 IN PUNKNOWN UnknownAdapter,
1301 IN PRESOURCELIST ResourceList,
1302 IN PPORTMIDI Port,
1303 OUT PSERVICEGROUP* ServiceGroup) PURE;
1304
1305 STDMETHOD_(void, Service)(THIS) PURE;
1306
1307 STDMETHOD_(NTSTATUS, NewStream)(THIS_
1308 OUT PMINIPORTMIDISTREAM *Stream,
1309 IN PUNKNOWN OuterUnknown OPTIONAL,
1310 IN POOL_TYPE PoolType,
1311 IN ULONG Pin,
1312 IN BOOLEAN Capture,
1313 IN PKSDATAFORMAT DataFormat,
1314 OUT PSERVICEGROUP* ServiceGroup) PURE;
1315
1316 };
1317
1318 typedef IMiniportMidi *PMINIPORTMIDI;
1319 #undef INTERFACE
1320
1321 /* ===============================================================
1322 IMiniportDriverUart Interface
1323 */
1324
1325 DEFINE_GUID(IID_MiniportDriverUart,
1326 0xb4c90ae1L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1327 DEFINE_GUID(CLSID_MiniportDriverUart,
1328 0xb4c90ae1L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1329
1330 /* ===============================================================
1331 IPortTopology Interface
1332 */
1333 #if 0
1334 #define STATIC_IPortTopology \
1335 0xb4c90a30L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44
1336 DEFINE_GUIDSTRUCT("0xB4C90A30-5791-11d0-86f9-00a0c911b544", IID_IPortTopology);
1337 #define IID_IPortTopology DEFINE_GUIDNAMED(IID_IPortTopology)
1338 #endif
1339
1340 #undef INTERFACE
1341 #define INTERFACE IPortTopology
1342
1343 DEFINE_GUID(IID_IPortTopology, 0xb4c90a30L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1344 DEFINE_GUID(CLSID_PortTopology, 0xb4c90a32L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1345
1346 #undef INTERFACE
1347 #define INTERFACE IPortTopology
1348
1349 DECLARE_INTERFACE_(IPortTopology, IPort)
1350 {
1351 DEFINE_ABSTRACT_UNKNOWN()
1352 DEFINE_ABSTRACT_PORT()
1353 };
1354
1355 typedef IPortTopology *PPORTTOPOLOGY;
1356
1357 #define IMP_IPortTopology IMP_IPort
1358
1359
1360 /* ===============================================================
1361 IMiniportTopology Interface
1362 */
1363
1364 #undef INTERFACE
1365 #define INTERFACE IMiniportTopology
1366
1367 DEFINE_GUID(IID_IMiniportTopology, 0xb4c90a31L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1368
1369 #undef INTERFACE
1370 #define INTERFACE IMiniportTopology
1371
1372 DECLARE_INTERFACE_(IMiniportTopology,IMiniport)
1373 {
1374 DEFINE_ABSTRACT_UNKNOWN()
1375 DEFINE_ABSTRACT_MINIPORT()
1376
1377 STDMETHOD_(NTSTATUS,Init)(THIS_
1378 IN PUNKNOWN UnknownAdapter,
1379 IN PRESOURCELIST ResourceList,
1380 IN PPORTTOPOLOGY Port)PURE;
1381 };
1382
1383 typedef IMiniportTopology *PMINIPORTTOPOLOGY;
1384
1385 /* ===============================================================
1386 IMiniportWaveCyclicStream Interface
1387 */
1388
1389 #undef INTERFACE
1390 #define INTERFACE IMiniportWaveCyclicStream
1391
1392 DEFINE_GUID(IID_IMiniportWaveCyclicStream,
1393 0xb4c90a28L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1394
1395 DECLARE_INTERFACE_(IMiniportWaveCyclicStream,IUnknown)
1396 {
1397 DEFINE_ABSTRACT_UNKNOWN()
1398
1399 STDMETHOD_(NTSTATUS,SetFormat)(THIS_
1400 IN PKSDATAFORMAT DataFormat)PURE;
1401
1402 STDMETHOD_(ULONG,SetNotificationFreq)(THIS_
1403 IN ULONG Interval,
1404 OUT PULONG FrameSize) PURE;
1405
1406 STDMETHOD_(NTSTATUS,SetState)(THIS_
1407 IN KSSTATE State) PURE;
1408
1409 STDMETHOD_(NTSTATUS,GetPosition)( THIS_
1410 OUT PULONG Position) PURE;
1411
1412 STDMETHOD_(NTSTATUS,NormalizePhysicalPosition)(THIS_
1413 IN OUT PLONGLONG PhysicalPosition) PURE;
1414
1415 STDMETHOD_(void, Silence)( THIS_
1416 IN PVOID Buffer,
1417 IN ULONG ByteCount) PURE;
1418 };
1419
1420 typedef IMiniportWaveCyclicStream *PMINIPORTWAVECYCLICSTREAM;
1421
1422 #define IMP_IMiniportWaveCyclicStream\
1423 STDMETHODIMP_(NTSTATUS) SetFormat\
1424 ( IN PKSDATAFORMAT DataFormat\
1425 );\
1426 STDMETHODIMP_(ULONG) SetNotificationFreq\
1427 ( IN ULONG Interval,\
1428 OUT PULONG FrameSize\
1429 );\
1430 STDMETHODIMP_(NTSTATUS) SetState\
1431 ( IN KSSTATE State\
1432 );\
1433 STDMETHODIMP_(NTSTATUS) GetPosition\
1434 ( OUT PULONG Position\
1435 );\
1436 STDMETHODIMP_(NTSTATUS) NormalizePhysicalPosition\
1437 ( IN OUT PLONGLONG PhysicalPosition\
1438 );\
1439 STDMETHODIMP_(void) Silence\
1440 ( IN PVOID Buffer,\
1441 IN ULONG ByteCount\
1442 )
1443
1444
1445 /* ===============================================================
1446 IMiniportWaveCyclic Interface
1447 */
1448 #undef INTERFACE
1449
1450 DEFINE_GUID(IID_IMiniportWaveCyclic,
1451 0xb4c90a27L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1452
1453 #define INTERFACE IMiniportWaveCyclic
1454
1455 DECLARE_INTERFACE_(IMiniportWaveCyclic, IMiniport)
1456 {
1457 DEFINE_ABSTRACT_UNKNOWN()
1458 DEFINE_ABSTRACT_MINIPORT()
1459
1460 STDMETHOD_(NTSTATUS, Init)(THIS_
1461 IN PUNKNOWN UnknownAdapter,
1462 IN PRESOURCELIST ResourceList,
1463 IN PPORTWAVECYCLIC Port) PURE;
1464
1465 STDMETHOD_(NTSTATUS, NewStream)(THIS_
1466 OUT PMINIPORTWAVECYCLICSTREAM *Stream,
1467 IN PUNKNOWN OuterUnknown OPTIONAL,
1468 IN POOL_TYPE PoolType,
1469 IN ULONG Pin,
1470 IN BOOLEAN Capture,
1471 IN PKSDATAFORMAT DataFormat,
1472 OUT PDMACHANNEL *DmaChannel,
1473 OUT PSERVICEGROUP *ServiceGroup) PURE;
1474 };
1475
1476 typedef IMiniportWaveCyclic *PMINIPORTWAVECYCLIC;
1477 #undef INTERFACE
1478
1479 #define IMP_IMiniportWaveCyclic\
1480 IMP_IMiniport;\
1481 STDMETHODIMP_(NTSTATUS) Init\
1482 ( IN PUNKNOWN UnknownAdapter,\
1483 IN PRESOURCELIST ResourceList,\
1484 IN PPORTWAVECYCLIC Port\
1485 );\
1486 STDMETHODIMP_(NTSTATUS) NewStream\
1487 ( OUT PMINIPORTWAVECYCLICSTREAM * Stream,\
1488 IN PUNKNOWN OuterUnknown OPTIONAL,\
1489 IN POOL_TYPE PoolType,\
1490 IN ULONG Pin,\
1491 IN BOOLEAN Capture,\
1492 IN PKSDATAFORMAT DataFormat,\
1493 OUT PDMACHANNEL * DmaChannel,\
1494 OUT PSERVICEGROUP * ServiceGroup\
1495 )
1496
1497
1498 /* ===============================================================
1499 IPortWavePciStream Interface
1500 */
1501 #undef INTERFACE
1502 #define INTERFACE IPortWavePciStream
1503
1504 DEFINE_GUID(IID_IPortWavePciStream, 0xb4c90a51L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1505
1506 DECLARE_INTERFACE_(IPortWavePciStream,IUnknown)
1507 {
1508 DEFINE_ABSTRACT_UNKNOWN() // For IUnknown
1509
1510 STDMETHOD_(NTSTATUS,GetMapping)(THIS_
1511 IN PVOID Tag,
1512 OUT PPHYSICAL_ADDRESS PhysicalAddress,
1513 OUT PVOID * VirtualAddress,
1514 OUT PULONG ByteCount,
1515 OUT PULONG Flags)PURE;
1516
1517 STDMETHOD_(NTSTATUS,ReleaseMapping)(THIS_
1518 IN PVOID Tag)PURE;
1519
1520 STDMETHOD_(NTSTATUS,TerminatePacket)(THIS)PURE;
1521 };
1522
1523 typedef IPortWavePciStream *PPORTWAVEPCISTREAM;
1524
1525 /* ===============================================================
1526 IMiniportWavePciStream Interface
1527 */
1528 #undef INTERFACE
1529 #define INTERFACE IMiniportWavePciStream
1530
1531 DEFINE_GUID(IID_IMiniportWavePciStream, 0xb4c90a53L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1532
1533 DECLARE_INTERFACE_(IMiniportWavePciStream,IUnknown)
1534 {
1535 DEFINE_ABSTRACT_UNKNOWN()
1536
1537 STDMETHOD_(NTSTATUS,SetFormat)(THIS_
1538 IN PKSDATAFORMAT DataFormat)PURE;
1539
1540 STDMETHOD_(NTSTATUS,SetState)(THIS_
1541 IN KSSTATE State)PURE;
1542
1543 STDMETHOD_(NTSTATUS,GetPosition)(THIS_
1544 OUT PULONGLONG Position)PURE;
1545
1546 STDMETHOD_(NTSTATUS,NormalizePhysicalPosition)(THIS_
1547 IN OUT PLONGLONG PhysicalPosition)PURE;
1548
1549 STDMETHOD_(NTSTATUS,GetAllocatorFraming)(THIS_
1550 OUT PKSALLOCATOR_FRAMING AllocatorFraming) PURE;
1551
1552 STDMETHOD_(NTSTATUS,RevokeMappings)(THIS_
1553 IN PVOID FirstTag,
1554 IN PVOID LastTag,
1555 OUT PULONG MappingsRevoked)PURE;
1556
1557 STDMETHOD_(void,MappingAvailable)(THIS)PURE;
1558
1559 STDMETHOD_(void,Service)(THIS)PURE;
1560 };
1561
1562 typedef IMiniportWavePciStream *PMINIPORTWAVEPCISTREAM;
1563
1564 /* ===============================================================
1565 IMiniportWavePci Interface
1566 */
1567 #undef INTERFACE
1568 #define INTERFACE IMiniportWavePci
1569
1570 DEFINE_GUID(IID_IMiniportWavePci, 0xb4c90a52L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
1571
1572 DECLARE_INTERFACE_(IMiniportWavePci,IMiniport)
1573 {
1574 DEFINE_ABSTRACT_UNKNOWN()
1575
1576 DEFINE_ABSTRACT_MINIPORT()
1577
1578 STDMETHOD_(NTSTATUS,Init)(THIS_
1579 IN PUNKNOWN UnknownAdapter,
1580 IN PRESOURCELIST ResourceList,
1581 IN PPORTWAVEPCI Port,
1582 OUT PSERVICEGROUP * ServiceGroup)PURE;
1583
1584 STDMETHOD_(NTSTATUS,NewStream)(THIS_
1585 OUT PMINIPORTWAVEPCISTREAM * Stream,
1586 IN PUNKNOWN OuterUnknown OPTIONAL,
1587 IN POOL_TYPE PoolType,
1588 IN PPORTWAVEPCISTREAM PortStream,
1589 IN ULONG Pin,
1590 IN BOOLEAN Capture,
1591 IN PKSDATAFORMAT DataFormat,
1592 OUT PDMACHANNEL * DmaChannel,
1593 OUT PSERVICEGROUP * ServiceGroup)PURE;
1594
1595 STDMETHOD_(void,Service)(THIS)PURE;
1596 };
1597
1598 typedef IMiniportWavePci *PMINIPORTWAVEPCI;
1599
1600
1601 #if !defined(DEFINE_ABSTRACT_MINIPORTWAVERTSTREAM)
1602
1603 #define DEFINE_ABSTRACT_MINIPORTWAVERTSTREAM() \
1604 STDMETHOD_(NTSTATUS,SetFormat) \
1605 ( THIS_ \
1606 IN PKSDATAFORMAT DataFormat \
1607 ) PURE; \
1608 STDMETHOD_(NTSTATUS,SetState) \
1609 ( THIS_ \
1610 IN KSSTATE State \
1611 ) PURE; \
1612 STDMETHOD_(NTSTATUS,GetPosition) \
1613 ( THIS_ \
1614 OUT PKSAUDIO_POSITION Position \
1615 ) PURE; \
1616 STDMETHOD_(NTSTATUS,AllocateAudioBuffer) \
1617 ( THIS_ \
1618 IN ULONG RequestedSize, \
1619 OUT PMDL *AudioBufferMdl, \
1620 OUT ULONG *ActualSize, \
1621 OUT ULONG *OffsetFromFirstPage, \
1622 OUT MEMORY_CACHING_TYPE *CacheType \
1623 ) PURE; \
1624 STDMETHOD_(VOID,FreeAudioBuffer) \
1625 ( THIS_ \
1626 IN PMDL AudioBufferMdl, \
1627 IN ULONG BufferSize \
1628 ) PURE; \
1629 STDMETHOD_(VOID,GetHWLatency) \
1630 ( THIS_ \
1631 OUT KSRTAUDIO_HWLATENCY *hwLatency \
1632 ) PURE; \
1633 STDMETHOD_(NTSTATUS,GetPositionRegister) \
1634 ( THIS_ \
1635 OUT KSRTAUDIO_HWREGISTER *Register \
1636 ) PURE; \
1637 STDMETHOD_(NTSTATUS,GetClockRegister) \
1638 ( THIS_ \
1639 OUT KSRTAUDIO_HWREGISTER *Register \
1640 ) PURE;
1641
1642 #endif
1643
1644
1645 /* ===============================================================
1646 IAdapterPowerManagement Interface
1647 */
1648
1649 #if (NTDDI_VERSION >= NTDDI_VISTA)
1650 /* ===============================================================
1651 IPortWaveRT Interface
1652 */
1653
1654 DEFINE_GUID(CLSID_PortWaveRT, 0xcc9be57a, 0xeb9e, 0x42b4, 0x94, 0xfc, 0xc, 0xad, 0x3d, 0xbc, 0xe7, 0xfa);
1655 DEFINE_GUID(IID_IPortWaveRT, 0x339ff909, 0x68a9, 0x4310, 0xb0, 0x9b, 0x27, 0x4e, 0x96, 0xee, 0x4c, 0xbd);
1656
1657 #undef INTERFACE
1658 #define INTERFACE IPortWaveRT
1659
1660 DECLARE_INTERFACE_(IPortWaveRT,IPort)
1661 {
1662 DEFINE_ABSTRACT_UNKNOWN() // For IUnknown
1663
1664 DEFINE_ABSTRACT_PORT() // For IPort
1665 };
1666
1667 typedef IPortWaveRT *PPORTWAVERT;
1668
1669
1670 /* ===============================================================
1671 IPortWaveRTStream Interface
1672 */
1673
1674 #undef INTERFACE
1675 #define INTERFACE IPortWaveRTStream
1676
1677 DEFINE_GUID(IID_IPortWaveRTStream, 0x1809ce5a, 0x64bc, 0x4e62, 0xbd, 0x7d, 0x95, 0xbc, 0xe4, 0x3d, 0xe3, 0x93);
1678
1679 DECLARE_INTERFACE_(IPortWaveRTStream, IUnknown)
1680 {
1681 DEFINE_ABSTRACT_UNKNOWN()
1682
1683 STDMETHOD_(PMDL, AllocatePagesForMdl)
1684 ( THIS_
1685 IN PHYSICAL_ADDRESS HighAddress,
1686 IN SIZE_T TotalBytes
1687 ) PURE;
1688
1689 STDMETHOD_(PMDL, AllocateContiguousPagesForMdl)
1690 ( THIS_
1691 IN PHYSICAL_ADDRESS LowAddress,
1692 IN PHYSICAL_ADDRESS HighAddress,
1693 IN SIZE_T TotalBytes
1694 ) PURE;
1695
1696 STDMETHOD_(PVOID, MapAllocatedPages)
1697 ( THIS_
1698 IN PMDL MemoryDescriptorList,
1699 IN MEMORY_CACHING_TYPE CacheType
1700 ) PURE;
1701
1702 STDMETHOD_(VOID, UnmapAllocatedPages)
1703 ( THIS_
1704 IN PVOID BaseAddress,
1705 IN PMDL MemoryDescriptorList
1706 ) PURE;
1707
1708 STDMETHOD_(VOID, FreePagesFromMdl)
1709 ( THIS_
1710 IN PMDL MemoryDescriptorList
1711 ) PURE;
1712
1713 STDMETHOD_(ULONG, GetPhysicalPagesCount)
1714 ( THIS_
1715 IN PMDL MemoryDescriptorList
1716 ) PURE;
1717
1718 STDMETHOD_(PHYSICAL_ADDRESS, GetPhysicalPageAddress)
1719 ( THIS_
1720 IN PMDL MemoryDescriptorList,
1721 IN ULONG Index
1722 ) PURE;
1723 };
1724
1725 typedef IPortWaveRTStream *PPORTWAVERTSTREAM;
1726
1727
1728 /* ===============================================================
1729 IMiniportWaveRTStream Interface
1730 */
1731
1732 #undef INTERFACE
1733 #define INTERFACE IMiniportWaveRTStream
1734
1735 DEFINE_GUID(IID_IMiniportWaveRTStream, 0xac9ab, 0xfaab, 0x4f3d, 0x94, 0x55, 0x6f, 0xf8, 0x30, 0x6a, 0x74, 0xa0);
1736
1737 DECLARE_INTERFACE_(IMiniportWaveRTStream, IUnknown)
1738 {
1739 DEFINE_ABSTRACT_UNKNOWN()
1740 DEFINE_ABSTRACT_MINIPORTWAVERTSTREAM()
1741 };
1742
1743 typedef IMiniportWaveRTStream *PMINIPORTWAVERTSTREAM;
1744
1745
1746 /* ===============================================================
1747 IMiniportWaveRTStreamNotification Interface
1748 */
1749
1750 #undef INTERFACE
1751 #define INTERFACE IMiniportWaveRTStreamNotification
1752
1753 DEFINE_GUID(IID_IMiniportWaveRTStreamNotification, 0x23759128, 0x96f1, 0x423b, 0xab, 0x4d, 0x81, 0x63, 0x5b, 0xcf, 0x8c, 0xa1);
1754
1755 DECLARE_INTERFACE_(IMiniportWaveRTStreamNotification, IMiniportWaveRTStream)
1756 {
1757 DEFINE_ABSTRACT_UNKNOWN()
1758
1759 DEFINE_ABSTRACT_MINIPORTWAVERTSTREAM()
1760
1761 STDMETHOD_(NTSTATUS,AllocateBufferWithNotification)
1762 ( THIS_
1763 IN ULONG NotificationCount,
1764 IN ULONG RequestedSize,
1765 OUT PMDL *AudioBufferMdl,
1766 OUT ULONG *ActualSize,
1767 OUT ULONG *OffsetFromFirstPage,
1768 OUT MEMORY_CACHING_TYPE *CacheType
1769 ) PURE;
1770
1771 STDMETHOD_(VOID,FreeBufferWithNotification)
1772 ( THIS_
1773 IN PMDL AudioBufferMdl,
1774 IN ULONG BufferSize
1775 ) PURE;
1776
1777 STDMETHOD_(NTSTATUS,RegisterNotificationEvent)
1778 ( THIS_
1779 IN PKEVENT NotificationEvent
1780 ) PURE;
1781
1782 STDMETHOD_(NTSTATUS,UnregisterNotificationEvent)
1783 ( THIS_
1784 IN PKEVENT NotificationEvent
1785 ) PURE;
1786 };
1787
1788 /* ===============================================================
1789 IMiniportWaveRT Interface
1790 */
1791
1792 #undef INTERFACE
1793 #define INTERFACE IMiniportWaveRT
1794
1795 DEFINE_GUID(IID_IMiniportWaveRT, 0xf9fc4d6, 0x6061, 0x4f3c, 0xb1, 0xfc, 0x7, 0x5e, 0x35, 0xf7, 0x96, 0xa);
1796
1797 DECLARE_INTERFACE_(IMiniportWaveRT, IMiniport)
1798 {
1799 DEFINE_ABSTRACT_UNKNOWN()
1800
1801 DEFINE_ABSTRACT_MINIPORT()
1802
1803 STDMETHOD_(NTSTATUS,Init)
1804 ( THIS_
1805 IN PUNKNOWN UnknownAdapter,
1806 IN PRESOURCELIST ResourceList,
1807 IN PPORTWAVERT Port
1808 ) PURE;
1809
1810 STDMETHOD_(NTSTATUS,NewStream)
1811 ( THIS_
1812 OUT PMINIPORTWAVERTSTREAM * Stream,
1813 IN PPORTWAVERTSTREAM PortStream,
1814 IN ULONG Pin,
1815 IN BOOLEAN Capture,
1816 IN PKSDATAFORMAT DataFormat
1817 ) PURE;
1818
1819 STDMETHOD_(NTSTATUS,GetDeviceDescription)
1820 ( THIS_
1821 OUT PDEVICE_DESCRIPTION DeviceDescription
1822 ) PURE;
1823 };
1824
1825 typedef IMiniportWaveRT *PMINIPORTWAVERT;
1826
1827 #endif
1828
1829 /* ===============================================================
1830 IAdapterPowerManagement Interface
1831 */
1832
1833 #undef INTERFACE
1834 #define INTERFACE IAdapterPowerManagement
1835
1836 DEFINE_GUID(IID_IAdapterPowerManagement, 0x793417D0L, 0x35FE, 0x11D1, 0xAD, 0x08, 0x00, 0xA0, 0xC9, 0x0A, 0xB1, 0xB0);
1837
1838 DECLARE_INTERFACE_(IAdapterPowerManagement, IUnknown)
1839 {
1840 DEFINE_ABSTRACT_UNKNOWN()
1841
1842 STDMETHOD_(void,PowerChangeState)(THIS_
1843 IN POWER_STATE NewState) PURE;
1844
1845 STDMETHOD_(NTSTATUS,QueryPowerChangeState)(THIS_
1846 IN POWER_STATE NewStateQuery) PURE;
1847
1848 STDMETHOD_(NTSTATUS,QueryDeviceCapabilities)(THIS_
1849 IN PDEVICE_CAPABILITIES PowerDeviceCaps) PURE;
1850 };
1851
1852 #define IMP_IAdapterPowerManagement \
1853 STDMETHODIMP_(void) PowerChangeState \
1854 ( IN POWER_STATE NewState \
1855 ); \
1856 STDMETHODIMP_(NTSTATUS) QueryPowerChangeState \
1857 ( IN POWER_STATE NewStateQuery \
1858 ); \
1859 STDMETHODIMP_(NTSTATUS) QueryDeviceCapabilities \
1860 ( IN PDEVICE_CAPABILITIES PowerDeviceCaps \
1861 )
1862
1863 typedef IAdapterPowerManagement *PADAPTERPOWERMANAGEMENT;
1864
1865
1866 /* ===============================================================
1867 IPowerNotify Interface
1868 */
1869
1870 #undef INTERFACE
1871 #define INTERFACE IPowerNotify
1872
1873 DEFINE_GUID(IID_IPowerNotify, 0x3DD648B8L, 0x969F, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3);
1874
1875 DECLARE_INTERFACE_(IPowerNotify, IUnknown)
1876 {
1877 DEFINE_ABSTRACT_UNKNOWN()
1878
1879 STDMETHOD_(void, PowerChangeNotify)(THIS_
1880 IN POWER_STATE PowerState)PURE;
1881 };
1882
1883 typedef IPowerNotify *PPOWERNOTIFY;
1884
1885 #undef INTERFACE
1886
1887 /* ===============================================================
1888 IPinCount Interface
1889 */
1890 #if (NTDDI_VERSION >= NTDDI_WINXP)
1891
1892 #undef INTERFACE
1893 #define INTERFACE IPinCount
1894
1895 DEFINE_GUID(IID_IPinCount, 0x5dadb7dcL, 0xa2cb, 0x4540, 0xa4, 0xa8, 0x42, 0x5e, 0xe4, 0xae, 0x90, 0x51);
1896
1897 DECLARE_INTERFACE_(IPinCount, IUnknown)
1898 {
1899 DEFINE_ABSTRACT_UNKNOWN()
1900
1901 STDMETHOD_(void,PinCount)(THIS_
1902 IN ULONG PinId,
1903 IN OUT PULONG FilterNecessary,
1904 IN OUT PULONG FilterCurrent,
1905 IN OUT PULONG FilterPossible,
1906 IN OUT PULONG GlobalCurrent,
1907 IN OUT PULONG GlobalPossible) PURE;
1908 };
1909 typedef IPinCount *PPINCOUNT;
1910
1911 #undef INTERFACE
1912 #endif
1913
1914
1915 /* ===============================================================
1916 IPortEvents Interface
1917 */
1918
1919 #undef INTERFACE
1920 #define INTERFACE IPortEvents
1921
1922 DEFINE_GUID(IID_IPortEvents, 0xA80F29C4L, 0x5498, 0x11D2, 0x95, 0xD9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3);
1923 DECLARE_INTERFACE_(IPortEvents, IUnknown)
1924 {
1925 DEFINE_ABSTRACT_UNKNOWN()
1926
1927 STDMETHOD_(void,AddEventToEventList)(THIS_
1928 IN PKSEVENT_ENTRY EventEntry)PURE;
1929
1930 STDMETHOD_(void,GenerateEventList)(THIS_
1931 IN GUID* Set OPTIONAL,
1932 IN ULONG EventId,
1933 IN BOOL PinEvent,
1934 IN ULONG PinId,
1935 IN BOOL NodeEvent,
1936 IN ULONG NodeId)PURE;
1937 };
1938
1939 typedef IPortEvents *PPORTEVENTS;
1940
1941
1942 /* ===============================================================
1943 IDrmPort / IDrmPort2 Interfaces
1944 These are almost identical, except for the addition of two extra methods.
1945 */
1946
1947 #undef INTERFACE
1948 #define INTERFACE IDrmPort
1949
1950 #if (NTDDI_VERSION >= NTDDI_WINXP)
1951 DEFINE_GUID(IID_IDrmPort, 0x286D3DF8L, 0xCA22, 0x4E2E, 0xB9, 0xBC, 0x20, 0xB4, 0xF0, 0xE2, 0x01, 0xCE);
1952 #endif
1953
1954 #define DEFINE_ABSTRACT_DRMPORT() \
1955 STDMETHOD_(NTSTATUS,CreateContentMixed)(THIS_ \
1956 IN PULONG paContentId, \
1957 IN ULONG cContentId, \
1958 OUT PULONG pMixedContentId)PURE; \
1959 \
1960 STDMETHOD_(NTSTATUS,DestroyContent)(THIS_ \
1961 IN ULONG ContentId)PURE; \
1962 \
1963 STDMETHOD_(NTSTATUS,ForwardContentToFileObject)(THIS_ \
1964 IN ULONG ContentId, \
1965 IN PFILE_OBJECT FileObject)PURE; \
1966 \
1967 STDMETHOD_(NTSTATUS,ForwardContentToInterface)(THIS_ \
1968 IN ULONG ContentId, \
1969 IN PUNKNOWN pUnknown, \
1970 IN ULONG NumMethods)PURE; \
1971 \
1972 STDMETHOD_(NTSTATUS,GetContentRights)(THIS_ \
1973 IN ULONG ContentId, \
1974 OUT PDRMRIGHTS DrmRights)PURE;
1975
1976 DECLARE_INTERFACE_(IDrmPort, IUnknown)
1977 {
1978 DEFINE_ABSTRACT_UNKNOWN()
1979 DEFINE_ABSTRACT_DRMPORT()
1980 };
1981
1982 typedef IDrmPort *PDRMPORT;
1983
1984 /* ===============================================================
1985 IDrmPort2 Interface
1986 */
1987
1988 #undef INTERFACE
1989 #define INTERFACE IDrmPort2
1990
1991 #if (NTDDI_VERSION >= NTDDI_WINXP)
1992 DEFINE_GUID(IID_IDrmPort2, 0x1ACCE59CL, 0x7311, 0x4B6B, 0x9F, 0xBA, 0xCC, 0x3B, 0xA5, 0x9A, 0xCD, 0xCE);
1993 #endif
1994
1995 DECLARE_INTERFACE_(IDrmPort2, IDrmPort)
1996 {
1997 DEFINE_ABSTRACT_UNKNOWN()
1998 DEFINE_ABSTRACT_DRMPORT()
1999
2000 STDMETHOD_(NTSTATUS,AddContentHandlers)(THIS_
2001 IN ULONG ContentId,
2002 IN PVOID * paHandlers,
2003 IN ULONG NumHandlers)PURE;
2004
2005 STDMETHOD_(NTSTATUS,ForwardContentToDeviceObject)(THIS_
2006 IN ULONG ContentId,
2007 IN PVOID Reserved,
2008 IN PCDRMFORWARD DrmForward)PURE;
2009 };
2010
2011 typedef IDrmPort2 *PDRMPORT2;
2012
2013 /* ===============================================================
2014 IPortClsVersion Interface
2015 */
2016 #undef INTERFACE
2017 #define INTERFACE IPortClsVersion
2018
2019 #if (NTDDI_VERSION >= NTDDI_WINXP)
2020 DEFINE_GUID(IID_IPortClsVersion, 0x7D89A7BBL, 0x869B, 0x4567, 0x8D, 0xBE, 0x1E, 0x16, 0x8C, 0xC8, 0x53, 0xDE);
2021 #endif
2022
2023 DECLARE_INTERFACE_(IPortClsVersion, IUnknown)
2024 {
2025 DEFINE_ABSTRACT_UNKNOWN()
2026
2027 STDMETHOD_(DWORD, GetVersion)(THIS) PURE;
2028 };
2029
2030 #define IMP_IPortClsVersion \
2031 STDMETHODIMP_(DWORD) GetVersion(void);
2032
2033 typedef IPortClsVersion *PPORTCLSVERSION;
2034
2035 #undef INTERFACE
2036
2037 /* ===============================================================
2038 IDmaOperations Interface
2039 */
2040
2041 /* ===============================================================
2042 IPreFetchOffset Interface
2043 */
2044
2045
2046
2047 /* ===============================================================
2048 PortCls API Functions
2049 */
2050
2051 typedef NTSTATUS (NTAPI *PCPFNSTARTDEVICE)(
2052 IN PDEVICE_OBJECT DeviceObject,
2053 IN PIRP Irp,
2054 IN PRESOURCELIST ResourceList);
2055
2056 /* This is in NTDDK.H */
2057 /*
2058 typedef NTSTATUS (*PDRIVER_ADD_DEVICE)(
2059 IN struct _DRIVER_OBJECT* DriverObject,
2060 IN struct _DEVICE_OBJECT* PhysicalDeviceObject);
2061 */
2062
2063 PORTCLASSAPI NTSTATUS NTAPI
2064 PcAddAdapterDevice(
2065 IN PDRIVER_OBJECT DriverObject,
2066 IN PDEVICE_OBJECT PhysicalDeviceObject,
2067 IN PCPFNSTARTDEVICE StartDevice,
2068 IN ULONG MaxObjects,
2069 IN ULONG DeviceExtensionSize);
2070
2071 PORTCLASSAPI NTSTATUS NTAPI
2072 PcInitializeAdapterDriver(
2073 IN PDRIVER_OBJECT DriverObject,
2074 IN PUNICODE_STRING RegistryPathName,
2075 IN PDRIVER_ADD_DEVICE AddDevice);
2076
2077
2078 /* ===============================================================
2079 Factories (TODO: Move elsewhere)
2080 */
2081
2082 PORTCLASSAPI NTSTATUS NTAPI
2083 PcNewDmaChannel(
2084 OUT PDMACHANNEL* OutDmaChannel,
2085 IN PUNKNOWN OuterUnknown OPTIONAL,
2086 IN POOL_TYPE PoolType,
2087 IN PDEVICE_DESCRIPTION DeviceDescription,
2088 IN PDEVICE_OBJECT DeviceObject);
2089
2090 PORTCLASSAPI NTSTATUS NTAPI
2091 PcNewInterruptSync(
2092 OUT PINTERRUPTSYNC* OUtInterruptSync,
2093 IN PUNKNOWN OuterUnknown OPTIONAL,
2094 IN PRESOURCELIST ResourceList,
2095 IN ULONG ResourceIndex,
2096 IN INTERRUPTSYNCMODE Mode);
2097
2098 PORTCLASSAPI NTSTATUS NTAPI
2099 PcNewMiniport(
2100 OUT PMINIPORT* OutMiniport,
2101 IN REFCLSID ClassId);
2102
2103 PORTCLASSAPI NTSTATUS NTAPI
2104 PcNewPort(
2105 OUT PPORT* OutPort,
2106 IN REFCLSID ClassId);
2107
2108 PORTCLASSAPI NTSTATUS NTAPI
2109 PcNewRegistryKey(
2110 OUT PREGISTRYKEY* OutRegistryKey,
2111 IN PUNKNOWN OuterUnknown OPTIONAL,
2112 IN ULONG RegistryKeyType,
2113 IN ACCESS_MASK DesiredAccess,
2114 IN PVOID DeviceObject OPTIONAL,
2115 IN PVOID SubDevice OPTIONAL,
2116 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
2117 IN ULONG CreateOptions OPTIONAL,
2118 OUT PULONG Disposition OPTIONAL);
2119
2120 PORTCLASSAPI NTSTATUS NTAPI
2121 PcNewResourceList(
2122 OUT PRESOURCELIST* OutResourceList,
2123 IN PUNKNOWN OuterUnknown OPTIONAL,
2124 IN POOL_TYPE PoolType,
2125 IN PCM_RESOURCE_LIST TranslatedResources,
2126 IN PCM_RESOURCE_LIST UntranslatedResources);
2127
2128 PORTCLASSAPI NTSTATUS NTAPI
2129 PcNewResourceSublist(
2130 OUT PRESOURCELIST* OutResourceList,
2131 IN PUNKNOWN OuterUnknown OPTIONAL,
2132 IN POOL_TYPE PoolType,
2133 IN PRESOURCELIST ParentList,
2134 IN ULONG MaximumEntries);
2135
2136 PORTCLASSAPI NTSTATUS NTAPI
2137 PcNewServiceGroup(
2138 OUT PSERVICEGROUP* OutServiceGroup,
2139 IN PUNKNOWN OuterUnknown OPTIONAL);
2140
2141
2142 /* ===============================================================
2143 IRP Handling
2144 */
2145
2146 PORTCLASSAPI NTSTATUS NTAPI
2147 PcDispatchIrp(
2148 IN PDEVICE_OBJECT DeviceObject,
2149 IN PIRP Irp);
2150
2151 PORTCLASSAPI NTSTATUS NTAPI
2152 PcCompleteIrp(
2153 IN PDEVICE_OBJECT DeviceObject,
2154 IN PIRP Irp,
2155 IN NTSTATUS Status);
2156
2157 PORTCLASSAPI NTSTATUS NTAPI
2158 PcForwardIrpSynchronous(
2159 IN PDEVICE_OBJECT DeviceObject,
2160 IN PIRP Irp);
2161
2162
2163 /* ===============================================================
2164 Power Management
2165 */
2166
2167 PORTCLASSAPI NTSTATUS NTAPI
2168 PcRegisterAdapterPowerManagement(
2169 IN PUNKNOWN pUnknown,
2170 IN PVOID pvContext1);
2171
2172 PORTCLASSAPI NTSTATUS NTAPI
2173 PcRequestNewPowerState(
2174 IN PDEVICE_OBJECT pDeviceObject,
2175 IN DEVICE_POWER_STATE RequestedNewState);
2176
2177
2178 /* ===============================================================
2179 Properties
2180 */
2181
2182 PORTCLASSAPI NTSTATUS NTAPI
2183 PcGetDeviceProperty(
2184 IN PVOID DeviceObject,
2185 IN DEVICE_REGISTRY_PROPERTY DeviceProperty,
2186 IN ULONG BufferLength,
2187 OUT PVOID PropertyBuffer,
2188 OUT PULONG ResultLength);
2189
2190 PORTCLASSAPI NTSTATUS NTAPI
2191 PcCompletePendingPropertyRequest(
2192 IN PPCPROPERTY_REQUEST PropertyRequest,
2193 IN NTSTATUS NtStatus);
2194
2195
2196 /* ===============================================================
2197 I/O Timeouts
2198 */
2199
2200 PORTCLASSAPI NTSTATUS NTAPI
2201 PcRegisterIoTimeout(
2202 IN PDEVICE_OBJECT pDeviceObject,
2203 IN PIO_TIMER_ROUTINE pTimerRoutine,
2204 IN PVOID pContext);
2205
2206 PORTCLASSAPI NTSTATUS NTAPI
2207 PcUnregisterIoTimeout(
2208 IN PDEVICE_OBJECT pDeviceObject,
2209 IN PIO_TIMER_ROUTINE pTimerRoutine,
2210 IN PVOID pContext);
2211
2212
2213 /* ===============================================================
2214 Physical Connections
2215 */
2216
2217 PORTCLASSAPI NTSTATUS NTAPI
2218 PcRegisterPhysicalConnection(
2219 IN PDEVICE_OBJECT DeviceObject,
2220 IN PUNKNOWN FromUnknown,
2221 IN ULONG FromPin,
2222 IN PUNKNOWN ToUnknown,
2223 IN ULONG ToPin);
2224
2225 PORTCLASSAPI NTSTATUS NTAPI
2226 PcRegisterPhysicalConnectionFromExternal(
2227 IN PDEVICE_OBJECT DeviceObject,
2228 IN PUNICODE_STRING FromString,
2229 IN ULONG FromPin,
2230 IN PUNKNOWN ToUnknown,
2231 IN ULONG ToPin);
2232
2233 PORTCLASSAPI NTSTATUS NTAPI
2234 PcRegisterPhysicalConnectionToExternal(
2235 IN PDEVICE_OBJECT DeviceObject,
2236 IN PUNKNOWN FromUnknown,
2237 IN ULONG FromPin,
2238 IN PUNICODE_STRING ToString,
2239 IN ULONG ToPin);
2240
2241
2242 /* ===============================================================
2243 Misc
2244 */
2245
2246 PORTCLASSAPI ULONGLONG NTAPI
2247 PcGetTimeInterval(
2248 IN ULONGLONG Since);
2249
2250 PORTCLASSAPI NTSTATUS NTAPI
2251 PcRegisterSubdevice(
2252 IN PDEVICE_OBJECT DeviceObject,
2253 IN PWCHAR Name,
2254 IN PUNKNOWN Unknown);
2255
2256
2257 /* ===============================================================
2258 Digital Rights Management Functions
2259 Implemented in XP and above
2260 */
2261
2262 PORTCLASSAPI NTSTATUS NTAPI
2263 PcAddContentHandlers(
2264 IN ULONG ContentId,
2265 IN PVOID *paHandlers,
2266 IN ULONG NumHandlers);
2267
2268 PORTCLASSAPI NTSTATUS NTAPI
2269 PcCreateContentMixed(
2270 IN PULONG paContentId,
2271 IN ULONG cContentId,
2272 OUT PULONG pMixedContentId);
2273
2274 PORTCLASSAPI NTSTATUS NTAPI
2275 PcDestroyContent(
2276 IN ULONG ContentId);
2277
2278 PORTCLASSAPI NTSTATUS NTAPI
2279 PcForwardContentToDeviceObject(
2280 IN ULONG ContentId,
2281 IN PVOID Reserved,
2282 IN PCDRMFORWARD DrmForward);
2283
2284 PORTCLASSAPI NTSTATUS NTAPI
2285 PcForwardContentToFileObject(
2286 IN ULONG ContentId,
2287 IN PFILE_OBJECT FileObject);
2288
2289 PORTCLASSAPI NTSTATUS NTAPI
2290 PcForwardContentToInterface(
2291 IN ULONG ContentId,
2292 IN PUNKNOWN pUnknown,
2293 IN ULONG NumMethods);
2294
2295 PORTCLASSAPI NTSTATUS NTAPI
2296 PcGetContentRights(
2297 IN ULONG ContentId,
2298 OUT PDRMRIGHTS DrmRights);
2299
2300
2301 #endif