source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/ddk/portcls.h

Last change on this file was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

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