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