bec3ccd68b127090fda03807adffc0e36e6140da
[reactos.git] / reactos / drivers / wdm / audio / backpln / portcls / interfaces.hpp
1 #ifndef INTERFACES_H__
2 #define INTERFACES_H__
3
4 DEFINE_GUID(IID_IIrpTarget, 0xB4C90A60, 0x5791, 0x11D0, 0xF9, 0x86, 0x00, 0xA0, 0xC9, 0x11, 0xB5, 0x44);
5 DEFINE_GUID(IID_ISubdevice, 0xB4C90A61, 0x5791, 0x11D0, 0xF9, 0x86, 0x00, 0xA0, 0xC9, 0x11, 0xB5, 0x44);
6 DEFINE_GUID(IID_IIrpTargetFactory, 0xB4C90A62, 0x5791, 0x11D0, 0xF9, 0x86, 0x00, 0xA0, 0xC9, 0x11, 0xB5, 0x44);
7
8
9 /*****************************************************************************
10 * IIrpTarget
11 *****************************************************************************
12 */
13
14 #define IMP_IIrpTarget \
15 STDMETHODIMP_(NTSTATUS) NewIrpTarget(THIS_ \
16 OUT struct IIrpTarget **OutTarget, \
17 IN PCWSTR Name, \
18 IN PUNKNOWN Unknown, \
19 IN POOL_TYPE PoolType, \
20 IN PDEVICE_OBJECT DeviceObject, \
21 IN PIRP Irp, \
22 IN KSOBJECT_CREATE *CreateObject); \
23 \
24 STDMETHODIMP_(NTSTATUS) DeviceIoControl(THIS_ \
25 IN PDEVICE_OBJECT DeviceObject, \
26 IN PIRP Irp); \
27 \
28 STDMETHODIMP_(NTSTATUS) Read(THIS_ \
29 IN PDEVICE_OBJECT DeviceObject, \
30 IN PIRP Irp); \
31 \
32 STDMETHODIMP_(NTSTATUS) Write(THIS_ \
33 IN PDEVICE_OBJECT DeviceObject, \
34 IN PIRP Irp); \
35 \
36 STDMETHODIMP_(NTSTATUS) Flush(THIS_ \
37 IN PDEVICE_OBJECT DeviceObject, \
38 IN PIRP Irp); \
39 \
40 STDMETHODIMP_(NTSTATUS) Close(THIS_ \
41 IN PDEVICE_OBJECT DeviceObject, \
42 IN PIRP Irp); \
43 \
44 STDMETHODIMP_(NTSTATUS) QuerySecurity(THIS_ \
45 IN PDEVICE_OBJECT DeviceObject, \
46 IN PIRP Irp); \
47 \
48 STDMETHODIMP_(NTSTATUS) SetSecurity(THIS_ \
49 IN PDEVICE_OBJECT DeviceObject, \
50 IN PIRP Irp); \
51 \
52 STDMETHODIMP_(BOOLEAN) FastDeviceIoControl(THIS_ \
53 IN PFILE_OBJECT FileObject, \
54 IN BOOLEAN Wait, \
55 IN PVOID InputBuffer, \
56 IN ULONG InputBufferLength, \
57 OUT PVOID OutputBuffer, \
58 IN ULONG OutputBufferLength, \
59 IN ULONG IoControlCode, \
60 OUT PIO_STATUS_BLOCK StatusBlock, \
61 IN PDEVICE_OBJECT DeviceObject); \
62 \
63 STDMETHODIMP_(BOOLEAN) FastRead(THIS_ \
64 IN PFILE_OBJECT FileObject, \
65 IN PLARGE_INTEGER FileOffset, \
66 IN ULONG Length, \
67 IN BOOLEAN Wait, \
68 IN ULONG LockKey, \
69 IN PVOID Buffer, \
70 OUT PIO_STATUS_BLOCK StatusBlock, \
71 IN PDEVICE_OBJECT DeviceObject); \
72 \
73 STDMETHODIMP_(BOOLEAN) FastWrite(THIS_ \
74 IN PFILE_OBJECT FileObject, \
75 IN PLARGE_INTEGER FileOffset, \
76 IN ULONG Length, \
77 IN BOOLEAN Wait, \
78 IN ULONG LockKey, \
79 IN PVOID Buffer, \
80 OUT PIO_STATUS_BLOCK StatusBlock, \
81 IN PDEVICE_OBJECT DeviceObject)
82
83 #define DEFINE_ABSTRACT_IRPTARGET() \
84 STDMETHOD_(NTSTATUS, NewIrpTarget)(THIS_ \
85 OUT struct IIrpTarget **OutTarget, \
86 IN PCWSTR Name, \
87 IN PUNKNOWN Unknown, \
88 IN POOL_TYPE PoolType, \
89 IN PDEVICE_OBJECT DeviceObject, \
90 IN PIRP Irp, \
91 IN KSOBJECT_CREATE *CreateObject) PURE; \
92 \
93 STDMETHOD_(NTSTATUS, DeviceIoControl)(THIS_ \
94 IN PDEVICE_OBJECT DeviceObject, \
95 IN PIRP Irp)PURE; \
96 \
97 STDMETHOD_(NTSTATUS, Read)(THIS_ \
98 IN PDEVICE_OBJECT DeviceObject, \
99 IN PIRP Irp)PURE; \
100 \
101 STDMETHOD_(NTSTATUS, Write)(THIS_ \
102 IN PDEVICE_OBJECT DeviceObject, \
103 IN PIRP Irp)PURE; \
104 \
105 STDMETHOD_(NTSTATUS, Flush)(THIS_ \
106 IN PDEVICE_OBJECT DeviceObject, \
107 IN PIRP Irp)PURE; \
108 \
109 STDMETHOD_(NTSTATUS, Close)(THIS_ \
110 IN PDEVICE_OBJECT DeviceObject, \
111 IN PIRP Irp)PURE; \
112 \
113 STDMETHOD_(NTSTATUS, QuerySecurity)(THIS_ \
114 IN PDEVICE_OBJECT DeviceObject, \
115 IN PIRP Irp)PURE; \
116 \
117 STDMETHOD_(NTSTATUS, SetSecurity)(THIS_ \
118 IN PDEVICE_OBJECT DeviceObject, \
119 IN PIRP Irp)PURE; \
120 \
121 STDMETHOD_(BOOLEAN, FastDeviceIoControl)(THIS_ \
122 IN PFILE_OBJECT FileObject, \
123 IN BOOLEAN Wait, \
124 IN PVOID InputBuffer, \
125 IN ULONG InputBufferLength, \
126 OUT PVOID OutputBuffer, \
127 IN ULONG OutputBufferLength, \
128 IN ULONG IoControlCode, \
129 OUT PIO_STATUS_BLOCK StatusBlock, \
130 IN PDEVICE_OBJECT DeviceObject)PURE; \
131 \
132 STDMETHOD_(BOOLEAN, FastRead)(THIS_ \
133 IN PFILE_OBJECT FileObject, \
134 IN PLARGE_INTEGER FileOffset, \
135 IN ULONG Length, \
136 IN BOOLEAN Wait, \
137 IN ULONG LockKey, \
138 IN PVOID Buffer, \
139 OUT PIO_STATUS_BLOCK StatusBlock, \
140 IN PDEVICE_OBJECT DeviceObject)PURE; \
141 \
142 STDMETHOD_(BOOLEAN, FastWrite)(THIS_ \
143 IN PFILE_OBJECT FileObject, \
144 IN PLARGE_INTEGER FileOffset, \
145 IN ULONG Length, \
146 IN BOOLEAN Wait, \
147 IN ULONG LockKey, \
148 IN PVOID Buffer, \
149 OUT PIO_STATUS_BLOCK StatusBlock, \
150 IN PDEVICE_OBJECT DeviceObject)PURE;
151
152
153
154 #undef INTERFACE
155 #define INTERFACE IIrpTarget
156
157 DECLARE_INTERFACE_(IIrpTarget, IUnknown)
158 {
159 DEFINE_ABSTRACT_UNKNOWN()
160
161 DEFINE_ABSTRACT_IRPTARGET()
162 };
163
164 typedef IIrpTarget *PIRPTARGET;
165
166 /*****************************************************************************
167 * ISubdevice
168 *****************************************************************************
169 */
170
171 struct IIrpTargetFactory;
172
173 typedef struct
174 {
175 LIST_ENTRY Entry;
176 UNICODE_STRING SymbolicLink;
177 }SYMBOLICLINK_ENTRY, *PSYMBOLICLINK_ENTRY;
178
179 typedef struct
180 {
181 LIST_ENTRY Entry;
182 ULONG FromPin;
183 KSPIN_PHYSICALCONNECTION Connection;
184 }PHYSICAL_CONNECTION_ENTRY, *PPHYSICAL_CONNECTION_ENTRY;
185
186 typedef struct
187 {
188 ULONG MaxGlobalInstanceCount;
189 ULONG MaxFilterInstanceCount;
190 ULONG MinFilterInstanceCount;
191 ULONG CurrentPinInstanceCount;
192
193 }PIN_INSTANCE_INFO, *PPIN_INSTANCE_INFO;
194
195
196 typedef struct
197 {
198 ULONG PinDescriptorCount;
199 ULONG PinDescriptorSize;
200 KSPIN_DESCRIPTOR * KsPinDescriptor;
201 PIN_INSTANCE_INFO * Instances;
202 }KSPIN_FACTORY;
203
204 typedef struct
205 {
206 ULONG InterfaceCount;
207 GUID *Interfaces;
208 KSPIN_FACTORY Factory;
209 ULONG FilterPropertySetCount;
210 PKSPROPERTY_SET FilterPropertySet;
211
212 ULONG EventSetCount;
213 PKSEVENT_SET EventSet;
214 PLIST_ENTRY EventList;
215 PKSPIN_LOCK EventListLock;
216
217 PPCFILTER_DESCRIPTOR DeviceDescriptor;
218 KSTOPOLOGY* Topology;
219 LIST_ENTRY SymbolicLinkList;
220 LIST_ENTRY PhysicalConnectionList;
221 UNICODE_STRING RefString;
222 PUNKNOWN UnknownMiniport;
223 PUNKNOWN UnknownStream;
224 PVOID PortPin;
225 }SUBDEVICE_DESCRIPTOR, *PSUBDEVICE_DESCRIPTOR;
226
227 #undef INTERFACE
228 #define INTERFACE ISubdevice
229
230 #define DEFINE_ABSTRACT_ISUBDEVICE() \
231 STDMETHOD_(NTSTATUS, NewIrpTarget)(THIS_ \
232 OUT IIrpTarget **OutTarget, \
233 IN PCWSTR Name, \
234 IN PUNKNOWN Unknown, \
235 IN POOL_TYPE PoolType, \
236 IN PDEVICE_OBJECT DeviceObject, \
237 IN PIRP Irp, \
238 IN KSOBJECT_CREATE *CreateObject) PURE; \
239 \
240 STDMETHOD_(NTSTATUS, ReleaseChildren)(THIS) PURE; \
241 \
242 STDMETHOD_(NTSTATUS, GetDescriptor)(THIS_ \
243 IN SUBDEVICE_DESCRIPTOR **) PURE; \
244 \
245 STDMETHOD_(NTSTATUS, DataRangeIntersection)(THIS_ \
246 IN ULONG PinId, \
247 IN PKSDATARANGE DataRange, \
248 IN PKSDATARANGE MatchingDataRange, \
249 IN ULONG OutputBufferLength, \
250 OUT PVOID ResultantFormat OPTIONAL, \
251 OUT PULONG ResultantFormatLength) PURE; \
252 \
253 STDMETHOD_(NTSTATUS, PowerChangeNotify)(THIS_ \
254 IN POWER_STATE PowerState) PURE; \
255 \
256 STDMETHOD_(NTSTATUS, PinCount)(THIS_ \
257 IN ULONG PinId, \
258 IN OUT PULONG FilterNecessary, \
259 IN OUT PULONG FilterCurrent, \
260 IN OUT PULONG FilterPossible, \
261 IN OUT PULONG GlobalCurrent, \
262 IN OUT PULONG GlobalPossible)PURE;
263
264
265
266 #define IMP_ISubdevice \
267 STDMETHODIMP_(NTSTATUS) NewIrpTarget( \
268 OUT IIrpTarget **OutTarget, \
269 IN PCWSTR Name, \
270 IN PUNKNOWN Unknown, \
271 IN POOL_TYPE PoolType, \
272 IN PDEVICE_OBJECT DeviceObject, \
273 IN PIRP Irp, \
274 IN KSOBJECT_CREATE *CreateObject); \
275 \
276 STDMETHODIMP_(NTSTATUS) ReleaseChildren(THIS); \
277 \
278 STDMETHODIMP_(NTSTATUS) GetDescriptor(THIS_ \
279 IN SUBDEVICE_DESCRIPTOR **); \
280 \
281 STDMETHODIMP_(NTSTATUS) DataRangeIntersection( \
282 IN ULONG PinId, \
283 IN PKSDATARANGE DataRange, \
284 IN PKSDATARANGE MatchingDataRange, \
285 IN ULONG OutputBufferLength, \
286 OUT PVOID ResultantFormat OPTIONAL, \
287 OUT PULONG ResultantFormatLength); \
288 \
289 STDMETHODIMP_(NTSTATUS) PowerChangeNotify( \
290 IN POWER_STATE PowerState); \
291 \
292 STDMETHODIMP_(NTSTATUS) PinCount( \
293 IN ULONG PinId, \
294 IN OUT PULONG FilterNecessary, \
295 IN OUT PULONG FilterCurrent, \
296 IN OUT PULONG FilterPossible, \
297 IN OUT PULONG GlobalCurrent, \
298 IN OUT PULONG GlobalPossible)
299
300
301 DECLARE_INTERFACE_(ISubdevice, IUnknown)
302 {
303 DEFINE_ABSTRACT_UNKNOWN()
304 DEFINE_ABSTRACT_ISUBDEVICE()
305 };
306
307 typedef ISubdevice *PSUBDEVICE;
308
309 /*****************************************************************************
310 * IIrpQueue
311 *****************************************************************************
312 */
313
314 #undef INTERFACE
315 #define INTERFACE IIrpQueue
316
317 DECLARE_INTERFACE_(IIrpQueue, IUnknown)
318 {
319 DEFINE_ABSTRACT_UNKNOWN()
320
321 STDMETHOD_(NTSTATUS, Init)(THIS_
322 IN PKSPIN_CONNECT ConnectDetails,
323 IN PKSPIN_DESCRIPTOR Descriptor,
324 IN ULONG FrameSize,
325 IN ULONG Alignment,
326 IN ULONG TagSupportEnabled) PURE;
327
328 STDMETHOD_(NTSTATUS, AddMapping)(THIS_
329 IN PIRP Irp,
330 OUT PULONG Data) PURE;
331
332 STDMETHOD_(NTSTATUS, GetMapping)(THIS_
333 OUT PUCHAR * Buffer,
334 OUT PULONG BufferSize) PURE;
335
336 STDMETHOD_(VOID, UpdateMapping)(THIS_
337 IN ULONG BytesWritten) PURE;
338
339 STDMETHOD_(ULONG, NumData)(THIS) PURE;
340
341 STDMETHOD_(BOOL, CancelBuffers)(THIS) PURE;
342
343 STDMETHOD_(NTSTATUS, GetMappingWithTag)(THIS_
344 IN PVOID Tag,
345 OUT PPHYSICAL_ADDRESS PhysicalAddress,
346 OUT PVOID *VirtualAddress,
347 OUT PULONG ByteCount,
348 OUT PULONG Flags) PURE;
349
350 STDMETHOD_(NTSTATUS, ReleaseMappingWithTag)(THIS_
351 IN PVOID Tag) PURE;
352
353 STDMETHOD_(BOOLEAN, HasLastMappingFailed)(THIS) PURE;
354 STDMETHOD_(ULONG, GetCurrentIrpOffset)(THIS) PURE;
355
356 STDMETHOD_(BOOLEAN, GetAcquiredTagRange)(THIS_
357 IN PVOID * FirstTag,
358 IN PVOID * LastTag) PURE;
359
360 };
361
362
363 #define IMP_IIrpQueue \
364 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
365 IN PKSPIN_CONNECT ConnectDetails, \
366 IN PKSPIN_DESCRIPTOR Descriptor, \
367 IN ULONG FrameSize, \
368 IN ULONG Alignment, \
369 IN ULONG TagSupportEnabled); \
370 \
371 STDMETHODIMP_(NTSTATUS) AddMapping(THIS_ \
372 IN PIRP Irp, \
373 OUT PULONG Data); \
374 \
375 STDMETHODIMP_(NTSTATUS) GetMapping(THIS_ \
376 OUT PUCHAR * Buffer, \
377 OUT PULONG BufferSize); \
378 \
379 STDMETHODIMP_(VOID) UpdateMapping(THIS_ \
380 IN ULONG BytesWritten); \
381 \
382 STDMETHODIMP_(ULONG) NumData(THIS); \
383 \
384 STDMETHODIMP_(BOOL) CancelBuffers(THIS); \
385 \
386 STDMETHODIMP_(NTSTATUS) GetMappingWithTag(THIS_ \
387 IN PVOID Tag, \
388 OUT PPHYSICAL_ADDRESS PhysicalAddress, \
389 OUT PVOID *VirtualAddress, \
390 OUT PULONG ByteCount, \
391 OUT PULONG Flags); \
392 \
393 STDMETHODIMP_(NTSTATUS) ReleaseMappingWithTag( \
394 IN PVOID Tag); \
395 \
396 STDMETHODIMP_(BOOLEAN) HasLastMappingFailed(THIS); \
397 STDMETHODIMP_(ULONG) GetCurrentIrpOffset(THIS); \
398 STDMETHODIMP_(BOOLEAN) GetAcquiredTagRange(THIS_ \
399 IN PVOID * FirstTag, \
400 IN PVOID * LastTag);
401
402
403
404 /*****************************************************************************
405 * IKsWorkSink
406 *****************************************************************************
407 */
408 #undef INTERFACE
409 #define INTERFACE IKsWorkSink
410
411 DECLARE_INTERFACE_(IKsWorkSink, IUnknown)
412 {
413 DEFINE_ABSTRACT_UNKNOWN()
414
415 STDMETHOD_(NTSTATUS, Work)(THIS);
416 };
417
418 /*****************************************************************************
419 * IIrpStreamNotify
420 *****************************************************************************
421 */
422 #undef INTERFACE
423 #define INTERFACE IIrpStreamNotify
424
425 struct IRPSTREAMPOSITION;
426
427 DECLARE_INTERFACE_(IIrpStreamNotify, IUnknown)
428 {
429 DEFINE_ABSTRACT_UNKNOWN()
430
431 STDMETHOD_(NTSTATUS, IrpSubmitted)(THIS_
432 IN PIRP Irp,
433 IN BOOLEAN WAIT)PURE;
434
435 STDMETHOD_(NTSTATUS, GetPosition)(THIS_
436 OUT struct IRPSTREAMPOSITION * Position)PURE;
437 };
438
439 /*****************************************************************************
440 * IKsShellTransport
441 *****************************************************************************
442 */
443
444 #undef INTERFACE
445 #define INTERFACE IKsShellTransport
446
447 #define DEFINE_ABSTRACT_IKSSHELLTRANSPORT() \
448 STDMETHOD_(NTSTATUS, TransferKsIrp)(THIS_ \
449 IN PIRP Irp, \
450 OUT IKsShellTransport ** Transport) PURE; \
451 \
452 STDMETHOD_(NTSTATUS, Connect)(THIS_ \
453 IN IKsShellTransport * StartTransport, \
454 OUT IKsShellTransport ** EndTransport, \
455 IN KSPIN_DATAFLOW DataFlow)PURE; \
456 \
457 STDMETHOD_(NTSTATUS, SetDeviceState)(THIS_ \
458 IN KSSTATE State1, \
459 IN KSSTATE State2, \
460 OUT IKsShellTransport ** EndTransport)PURE; \
461 \
462 STDMETHOD_(NTSTATUS, SetResetState)(THIS_ \
463 IN KSRESET State1, \
464 OUT IKsShellTransport ** EndTransport)PURE;
465
466
467 DECLARE_INTERFACE_(IKsShellTransport, IUnknown)
468 {
469 DEFINE_ABSTRACT_UNKNOWN()
470
471 DEFINE_ABSTRACT_IKSSHELLTRANSPORT()
472 };
473
474 /*****************************************************************************
475 * IIrpStream
476 *****************************************************************************
477 */
478 struct IRPSTREAM_POSITION;
479 struct IRPSTREAMPACKETINFO;
480
481 #define DEFINE_ABSTRACT_IRPSTREAM() \
482 STDMETHOD_(NTSTATUS, TransferKsIrp)(THIS_ \
483 IN PIRP Irp, \
484 OUT IKsShellTransport ** Transport) PURE; \
485 \
486 STDMETHOD_(NTSTATUS, Connect)(THIS_ \
487 IN IKsShellTransport * StartTransport, \
488 OUT IKsShellTransport ** EndTransport, \
489 IN KSPIN_DATAFLOW DataFlow)PURE; \
490 \
491 STDMETHOD_(NTSTATUS, SetDeviceState)(THIS_ \
492 IN KSSTATE State1, \
493 IN KSSTATE State2, \
494 OUT IKsShellTransport ** EndTransport)PURE; \
495 \
496 STDMETHOD_(NTSTATUS, SetResetState)(THIS_ \
497 IN KSRESET State1, \
498 OUT IKsShellTransport ** EndTransport)PURE; \
499 \
500 STDMETHOD_(NTSTATUS, GetPosition)(THIS_ \
501 IN OUT struct IRPSTREAM_POSITION * Position) PURE; \
502 \
503 STDMETHOD_(NTSTATUS, Init)(THIS_ \
504 IN BOOLEAN Wait, \
505 KSPIN_CONNECT *ConnectDetails, \
506 PDEVICE_OBJECT DeviceObject, \
507 PDMA_ADAPTER DmaAdapter) PURE; \
508 \
509 STDMETHOD_(NTSTATUS, CancelAllIrps)(THIS_ \
510 ULONG Wait)PURE; \
511 \
512 STDMETHOD_(VOID, TerminatePacket)(THIS); \
513 \
514 STDMETHOD_(NTSTATUS, ChangeOptionsFlag)(THIS_ \
515 ULONG Unknown1, \
516 ULONG Unknown2, \
517 ULONG Unknown3, \
518 ULONG Unknown4)PURE; \
519 \
520 STDMETHOD_(NTSTATUS, GetPacketInfo)(THIS_ \
521 struct IRPSTREAMPACKETINFO * Info1, \
522 struct IRPSTREAMPACKETINFO * Info2)PURE; \
523 \
524 STDMETHOD_(NTSTATUS, SetPacketOffsets)(THIS_ \
525 ULONG Unknown1, \
526 ULONG Unknown2)PURE; \
527 \
528 STDMETHOD_(NTSTATUS, RegisterNotifySink)(THIS_ \
529 IN IIrpStreamNotify * NotifyStream)PURE;
530
531
532
533 #undef INTERFACE
534 #define INTERFACE IIrpStream
535
536 DECLARE_INTERFACE_(IIrpStream, IUnknown)
537 {
538 DEFINE_ABSTRACT_UNKNOWN()
539
540 DEFINE_ABSTRACT_IRPSTREAM()
541 };
542
543
544 /*****************************************************************************
545 * IIrpStreamPhysical
546 *****************************************************************************
547 */
548 #undef INTERFACE
549 #define INTERFACE IIrpStreamPhysical
550
551 DECLARE_INTERFACE_(IIrpStreamPhysical, IIrpStream)
552 {
553 DEFINE_ABSTRACT_UNKNOWN()
554
555 DEFINE_ABSTRACT_IRPSTREAM()
556
557 STDMETHOD_(NTSTATUS, GetMapping)(THIS_
558 IN PVOID Tag,
559 OUT PPHYSICAL_ADDRESS PhysicalAddress,
560 OUT PVOID * VirtualAddress,
561 OUT PULONG ByteCount,
562 OUT PULONG Flags)PURE;
563
564 };
565
566 /*****************************************************************************
567 * IIrpStreamVirtual
568 *****************************************************************************
569 */
570 #undef INTERFACE
571 #define INTERFACE IIrpStreamVirtual
572
573 DECLARE_INTERFACE_(IIrpStreamVirtual, IIrpStream)
574 {
575 DEFINE_ABSTRACT_UNKNOWN()
576
577 DEFINE_ABSTRACT_IRPSTREAM()
578
579 STDMETHOD_(NTSTATUS, GetLockedRegion)(THIS_
580 OUT PULONG OutSize,
581 OUT PVOID * OutBuffer)PURE;
582
583 STDMETHOD_(NTSTATUS, Copy)(THIS_
584 IN BOOLEAN Wait,
585 OUT ULONG Size,
586 IN PULONG Buffer,
587 OUT PVOID Result)PURE;
588
589 STDMETHOD_(NTSTATUS, Complete)(THIS_
590 IN ULONG Unknown1,
591 IN PULONG Data)PURE;
592
593 STDMETHOD_(ULONG, GetIrpStreamPositionLock)(THIS);
594 };
595
596 /*****************************************************************************
597 * IPortFilterWavePci
598 *****************************************************************************
599 */
600
601 #undef INTERFACE
602 #define INTERFACE IPortFilterWavePci
603
604 struct IPortPinWavePci;
605
606 DECLARE_INTERFACE_(IPortFilterWavePci, IIrpTarget)
607 {
608 DEFINE_ABSTRACT_UNKNOWN()
609
610 DEFINE_ABSTRACT_IRPTARGET()
611
612 STDMETHOD_(NTSTATUS, Init)(THIS_
613 IN PPORTWAVEPCI Port)PURE;
614
615 STDMETHOD_(NTSTATUS, FreePin)(THIS_
616 IN struct IPortPinWavePci* Pin)PURE;
617 };
618
619 typedef IPortFilterWavePci *PPORTFILTERWAVEPCI;
620
621 #define IMP_IPortFilterPci \
622 IMP_IIrpTarget; \
623 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
624 IN PPORTWAVEPCI Port); \
625 STDMETHODIMP_(NTSTATUS) FreePin(THIS_ \
626 IN struct IPortPinWavePci* Pin)
627
628
629 /*****************************************************************************
630 * IPortPinWavePci
631 *****************************************************************************
632 */
633
634 #undef INTERFACE
635 #define INTERFACE IPortPinWavePci
636
637 DECLARE_INTERFACE_(IPortPinWavePci, IIrpTarget)
638 {
639 DEFINE_ABSTRACT_UNKNOWN()
640
641 DEFINE_ABSTRACT_IRPTARGET()
642
643 STDMETHOD_(NTSTATUS, Init)(THIS_
644 IN PPORTWAVEPCI Port,
645 IN PPORTFILTERWAVEPCI Filter,
646 IN KSPIN_CONNECT * ConnectDetails,
647 IN KSPIN_DESCRIPTOR * PinDescriptor,
648 IN PDEVICE_OBJECT DeviceObject) PURE;
649
650 STDMETHOD_(PVOID, GetIrpStream)(THIS) PURE;
651 STDMETHOD_(PMINIPORT, GetMiniport)(THIS) PURE;
652 };
653
654 #define IMP_IPortPinWavePci \
655 IMP_IIrpTarget; \
656 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
657 IN PPORTWAVEPCI Port, \
658 IN PPORTFILTERWAVEPCI Filter, \
659 IN KSPIN_CONNECT * ConnectDetails, \
660 IN KSPIN_DESCRIPTOR * PinDescriptor, \
661 IN PDEVICE_OBJECT DeviceObject); \
662 \
663 STDMETHODIMP_(PVOID) GetIrpStream(); \
664 STDMETHODIMP_(PMINIPORT) GetMiniport(THIS)
665
666
667
668 typedef IPortPinWavePci *PPORTPINWAVEPCI;
669
670
671 #if (NTDDI_VERSION >= NTDDI_VISTA)
672
673 /*****************************************************************************
674 * IPortFilterWaveRT
675 *****************************************************************************
676 */
677
678 #undef INTERFACE
679 #define INTERFACE IPortFilterWaveRT
680
681 #ifndef PPORTWAVERT
682 typedef IPortWaveRT *PPORTWAVERT;
683 #endif
684
685 DECLARE_INTERFACE_(IPortFilterWaveRT, IIrpTarget)
686 {
687 DEFINE_ABSTRACT_UNKNOWN()
688
689 DEFINE_ABSTRACT_IRPTARGET()
690
691 STDMETHOD_(NTSTATUS, Init)(THIS_
692 IN PPORTWAVERT Port)PURE;
693 };
694
695 typedef IPortFilterWaveRT *PPORTFILTERWAVERT;
696
697 #define IMP_IPortFilterWaveRT \
698 IMP_IIrpTarget; \
699 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
700 IN PPORTWAVERT Port)
701
702
703 /*****************************************************************************
704 * IPortPinWaveRT
705 *****************************************************************************
706 */
707
708 #undef INTERFACE
709 #define INTERFACE IPortPinWaveRT
710
711 DECLARE_INTERFACE_(IPortPinWaveRT, IIrpTarget)
712 {
713 DEFINE_ABSTRACT_UNKNOWN()
714
715 DEFINE_ABSTRACT_IRPTARGET()
716
717 STDMETHOD_(NTSTATUS, Init)(THIS_
718 IN PPORTWAVERT Port,
719 IN PPORTFILTERWAVERT Filter,
720 IN KSPIN_CONNECT * ConnectDetails,
721 IN KSPIN_DESCRIPTOR * PinDescriptor,
722 IN PDEVICE_OBJECT DeviceObject) PURE;
723 };
724
725 typedef IPortPinWaveRT *PPORTPINWAVERT;
726
727 #define IMP_IPortPinWaveRT \
728 IMP_IIrpTarget; \
729 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
730 IN PPORTWAVERT Port, \
731 IN PPORTFILTERWAVERT Filter, \
732 IN KSPIN_CONNECT * ConnectDetails, \
733 IN KSPIN_DESCRIPTOR * PinDescriptor, \
734 IN PDEVICE_OBJECT DeviceObject)
735
736
737 #endif
738
739 /*****************************************************************************
740 * IPortFilterWaveCyclic
741 *****************************************************************************
742 */
743
744 #undef INTERFACE
745 #define INTERFACE IPortFilterWaveCyclic
746
747 struct IPortPinWaveCyclic;
748
749 DECLARE_INTERFACE_(IPortFilterWaveCyclic, IIrpTarget)
750 {
751 DEFINE_ABSTRACT_UNKNOWN()
752
753 DEFINE_ABSTRACT_IRPTARGET()
754
755 STDMETHOD_(NTSTATUS, Init)(THIS_
756 IN PPORTWAVECYCLIC Port)PURE;
757
758 STDMETHOD_(NTSTATUS, FreePin)(THIS_
759 IN struct IPortPinWaveCyclic* Pin)PURE;
760 };
761
762 typedef IPortFilterWaveCyclic *PPORTFILTERWAVECYCLIC;
763
764 #define IMP_IPortFilterWaveCyclic \
765 IMP_IIrpTarget; \
766 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
767 IN PPORTWAVECYCLIC Port); \
768 STDMETHODIMP_(NTSTATUS) FreePin(THIS_ \
769 IN struct IPortPinWaveCyclic* Pin)
770
771
772 /*****************************************************************************
773 * IPortPinWaveCyclic
774 *****************************************************************************
775 */
776
777 #undef INTERFACE
778 #define INTERFACE IPortPinWaveCyclic
779
780 DECLARE_INTERFACE_(IPortPinWaveCyclic, IIrpTarget)
781 {
782 DEFINE_ABSTRACT_UNKNOWN()
783
784 DEFINE_ABSTRACT_IRPTARGET()
785
786 STDMETHOD_(NTSTATUS, Init)(THIS_
787 IN PPORTWAVECYCLIC Port,
788 IN PPORTFILTERWAVECYCLIC Filter,
789 IN KSPIN_CONNECT * ConnectDetails,
790 IN KSPIN_DESCRIPTOR * PinDescriptor) PURE;
791
792 STDMETHOD_(ULONG, GetCompletedPosition)(THIS) PURE;
793 STDMETHOD_(ULONG, GetCycleCount)(THIS) PURE;
794 STDMETHOD_(ULONG, GetDeviceBufferSize)(THIS) PURE;
795 STDMETHOD_(PVOID, GetIrpStream)(THIS) PURE;
796 STDMETHOD_(PMINIPORT, GetMiniport)(THIS) PURE;
797 };
798
799 typedef IPortPinWaveCyclic *PPORTPINWAVECYCLIC;
800
801 #define IMP_IPortPinWaveCyclic \
802 IMP_IIrpTarget; \
803 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
804 IN PPORTWAVECYCLIC Port, \
805 IN PPORTFILTERWAVECYCLIC Filter, \
806 IN KSPIN_CONNECT * ConnectDetails, \
807 IN KSPIN_DESCRIPTOR * PinDescriptor); \
808 STDMETHODIMP_(ULONG) GetCompletedPosition(THIS); \
809 STDMETHODIMP_(ULONG) GetCycleCount(THIS); \
810 STDMETHODIMP_(ULONG) GetDeviceBufferSize(THIS); \
811 STDMETHODIMP_(PVOID) GetIrpStream(THIS); \
812 STDMETHODIMP_(PMINIPORT) GetMiniport(THIS)
813
814
815 /*****************************************************************************
816 * IPortFilterDMus
817 *****************************************************************************
818 */
819
820 #undef INTERFACE
821 #define INTERFACE IPortFilterDMus
822
823 struct IPortPinDMus;
824
825 DECLARE_INTERFACE_(IPortFilterDMus, IUnknown)
826 {
827 DEFINE_ABSTRACT_UNKNOWN()
828
829 DEFINE_ABSTRACT_IRPTARGET()
830
831 STDMETHOD_(NTSTATUS, Init)(THIS_
832 IN PPORTDMUS Port)PURE;
833
834 STDMETHOD_(NTSTATUS, FreePin)(THIS_
835 IN struct IPortPinDMus* Pin)PURE;
836
837 STDMETHOD_(VOID, NotifyPins)(THIS) PURE;
838 };
839
840 typedef IPortFilterDMus *PPORTFILTERDMUS;
841
842 #define IMP_IPortFilterDMus \
843 IMP_IIrpTarget; \
844 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
845 IN PPORTDMUS Port); \
846 STDMETHODIMP_(NTSTATUS) FreePin(THIS_ \
847 IN struct IPortPinDMus* Pin); \
848 STDMETHODIMP_(VOID) NotifyPins(THIS)
849
850 /*****************************************************************************
851 * IPortPinDMus
852 *****************************************************************************
853 */
854
855 #undef INTERFACE
856 #define INTERFACE IPortPinDMus
857
858 DECLARE_INTERFACE_(IPortPinDMus, IIrpTarget)
859 {
860 DEFINE_ABSTRACT_UNKNOWN()
861
862 DEFINE_ABSTRACT_IRPTARGET()
863
864 STDMETHOD_(NTSTATUS, Init)(THIS_
865 IN PPORTDMUS Port,
866 IN PPORTFILTERDMUS Filter,
867 IN KSPIN_CONNECT * ConnectDetails,
868 IN KSPIN_DESCRIPTOR * PinDescriptor,
869 IN PDEVICE_OBJECT DeviceObject) PURE;
870
871 STDMETHOD_(VOID, Notify)(THIS) PURE;
872 };
873
874 #define IMP_IPortPinDMus \
875 IMP_IIrpTarget; \
876 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
877 IN PPORTDMUS Port, \
878 IN PPORTFILTERDMUS Filter, \
879 IN KSPIN_CONNECT * ConnectDetails, \
880 IN KSPIN_DESCRIPTOR * PinDescriptor, \
881 IN PDEVICE_OBJECT DeviceObject); \
882 STDMETHODIMP_(VOID) Notify(THIS)
883
884 typedef IPortPinDMus *PPORTPINDMUS;
885
886 /*****************************************************************************
887 * IDmaChannelInit
888 *****************************************************************************
889 */
890
891 #define IMP_IDmaChannelEx \
892 STDMETHODIMP_(NTSTATUS) AllocateBuffer( \
893 IN ULONG BufferSize, \
894 IN PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL); \
895 \
896 STDMETHODIMP_(void) FreeBuffer(void); \
897 STDMETHODIMP_(ULONG) TransferCount(void); \
898 STDMETHODIMP_(ULONG) MaximumBufferSize(void); \
899 STDMETHODIMP_(ULONG) AllocatedBufferSize(void); \
900 STDMETHODIMP_(ULONG) BufferSize(void); \
901 \
902 STDMETHODIMP_(void) SetBufferSize( \
903 IN ULONG BufferSize); \
904 \
905 STDMETHODIMP_(PVOID) SystemAddress(void); \
906 STDMETHODIMP_(PHYSICAL_ADDRESS) PhysicalAddress(); \
907 STDMETHODIMP_(PADAPTER_OBJECT) GetAdapterObject(void); \
908 \
909 STDMETHODIMP_(void) CopyTo( \
910 IN PVOID Destination, \
911 IN PVOID Source, \
912 IN ULONG ByteCount); \
913 \
914 STDMETHODIMP_(void) CopyFrom( \
915 IN PVOID Destination, \
916 IN PVOID Source, \
917 IN ULONG ByteCount)
918
919 #define IMP_IDmaChannelSlaveEx \
920 IMP_IDmaChannelEx; \
921 STDMETHODIMP_(NTSTATUS) Start( \
922 IN ULONG MapSize, \
923 IN BOOLEAN WriteToDevice); \
924 \
925 STDMETHODIMP_(NTSTATUS) Stop(void); \
926 STDMETHODIMP_(ULONG) ReadCounter(void); \
927 \
928 STDMETHODIMP_(NTSTATUS) WaitForTC( \
929 ULONG Timeout)
930
931 #define IMP_IDmaChannelInit\
932 IMP_IDmaChannelSlaveEx;\
933 STDMETHODIMP_(NTSTATUS) Init( \
934 IN PDEVICE_DESCRIPTION DeviceDescription, \
935 IN PDEVICE_OBJECT DeviceObject)
936
937 #define DEFINE_ABSTRACT_DMACHANNEL_EX() \
938 STDMETHOD_(NTSTATUS, AllocateBuffer)( THIS_ \
939 IN ULONG BufferSize, \
940 IN PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL) PURE; \
941 \
942 STDMETHOD_(void, FreeBuffer)( THIS ) PURE; \
943 STDMETHOD_(ULONG, TransferCount)( THIS ) PURE; \
944 STDMETHOD_(ULONG, MaximumBufferSize)( THIS ) PURE; \
945 STDMETHOD_(ULONG, AllocatedBufferSize)( THIS ) PURE; \
946 STDMETHOD_(ULONG, BufferSize)( THIS ) PURE; \
947 \
948 STDMETHOD_(void, SetBufferSize)( THIS_ \
949 IN ULONG BufferSize) PURE; \
950 \
951 STDMETHOD_(PVOID, SystemAddress)( THIS ) PURE; \
952 STDMETHOD_(PHYSICAL_ADDRESS, PhysicalAddress)( THIS) PURE; \
953 STDMETHOD_(PADAPTER_OBJECT, GetAdapterObject)( THIS ) PURE; \
954 \
955 STDMETHOD_(void, CopyTo)( THIS_ \
956 IN PVOID Destination, \
957 IN PVOID Source, \
958 IN ULONG ByteCount) PURE; \
959 \
960 STDMETHOD_(void, CopyFrom)( THIS_ \
961 IN PVOID Destination, \
962 IN PVOID Source, \
963 IN ULONG ByteCount) PURE;
964
965 #undef INTERFACE
966 #define INTERFACE IDmaChannelInit
967
968 DECLARE_INTERFACE_(IDmaChannelInit, IUnknown)
969 {
970 DEFINE_ABSTRACT_UNKNOWN()
971 DEFINE_ABSTRACT_DMACHANNEL_EX()
972 DEFINE_ABSTRACT_DMACHANNELSLAVE()
973
974 STDMETHOD_(NTSTATUS, Init)( THIS_
975 IN PDEVICE_DESCRIPTION DeviceDescription,
976 IN PDEVICE_OBJECT DeviceObject) PURE;
977 };
978
979 #undef INTERFACE
980
981 /*****************************************************************************
982 * IPortFilterTopology
983 *****************************************************************************
984 */
985
986 #undef INTERFACE
987 #define INTERFACE IPortFilterTopology
988
989 DECLARE_INTERFACE_(IPortFilterTopology, IIrpTarget)
990 {
991 DEFINE_ABSTRACT_UNKNOWN()
992
993 DEFINE_ABSTRACT_IRPTARGET()
994
995 STDMETHOD_(NTSTATUS, Init)(THIS_
996 IN PPORTTOPOLOGY Port)PURE;
997 };
998
999 typedef IPortFilterTopology *PPORTFILTERTOPOLOGY;
1000
1001 #define IMP_IPortFilterTopology \
1002 IMP_IIrpTarget; \
1003 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
1004 IN PPORTTOPOLOGY Port)
1005
1006 #undef INTERFACE
1007
1008 /*****************************************************************************
1009 * IPortWaveRTStreamInit
1010 *****************************************************************************
1011 */
1012
1013 #undef INTERFACE
1014 #define INTERFACE IPortWaveRTStreamInit
1015
1016
1017 DECLARE_INTERFACE_(IPortWaveRTStreamInit, IUnknown)
1018 {
1019 DEFINE_ABSTRACT_UNKNOWN()
1020
1021 STDMETHOD_(PMDL, AllocatePagesForMdl)
1022 ( THIS_
1023 IN PHYSICAL_ADDRESS HighAddress,
1024 IN SIZE_T TotalBytes
1025 ) PURE;
1026
1027 STDMETHOD_(PMDL, AllocateContiguousPagesForMdl)
1028 ( THIS_
1029 IN PHYSICAL_ADDRESS LowAddress,
1030 IN PHYSICAL_ADDRESS HighAddress,
1031 IN SIZE_T TotalBytes
1032 ) PURE;
1033
1034 STDMETHOD_(PVOID, MapAllocatedPages)
1035 ( THIS_
1036 IN PMDL MemoryDescriptorList,
1037 IN MEMORY_CACHING_TYPE CacheType
1038 ) PURE;
1039
1040 STDMETHOD_(VOID, UnmapAllocatedPages)
1041 ( THIS_
1042 IN PVOID BaseAddress,
1043 IN PMDL MemoryDescriptorList
1044 ) PURE;
1045
1046 STDMETHOD_(VOID, FreePagesFromMdl)
1047 ( THIS_
1048 IN PMDL MemoryDescriptorList
1049 ) PURE;
1050
1051 STDMETHOD_(ULONG, GetPhysicalPagesCount)
1052 ( THIS_
1053 IN PMDL MemoryDescriptorList
1054 ) PURE;
1055
1056 STDMETHOD_(PHYSICAL_ADDRESS, GetPhysicalPageAddress)
1057 ( THIS_
1058 IN PPHYSICAL_ADDRESS Address,
1059 IN PMDL MemoryDescriptorList,
1060 IN ULONG Index
1061 ) PURE;
1062 };
1063
1064 #undef INTERFACE
1065
1066 #define IMP_IPortWaveRTStreamInit \
1067 STDMETHODIMP_(PMDL) AllocatePagesForMdl \
1068 ( THIS_ \
1069 IN PHYSICAL_ADDRESS HighAddress, \
1070 IN SIZE_T TotalBytes \
1071 ); \
1072 \
1073 STDMETHODIMP_(PMDL) AllocateContiguousPagesForMdl \
1074 ( THIS_ \
1075 IN PHYSICAL_ADDRESS LowAddress, \
1076 IN PHYSICAL_ADDRESS HighAddress, \
1077 IN SIZE_T TotalBytes \
1078 ); \
1079 \
1080 STDMETHODIMP_(PVOID) MapAllocatedPages \
1081 ( THIS_ \
1082 IN PMDL MemoryDescriptorList, \
1083 IN MEMORY_CACHING_TYPE CacheType \
1084 ); \
1085 \
1086 STDMETHODIMP_(VOID) UnmapAllocatedPages \
1087 ( THIS_ \
1088 IN PVOID BaseAddress, \
1089 IN PMDL MemoryDescriptorList \
1090 ); \
1091 \
1092 STDMETHODIMP_(VOID) FreePagesFromMdl \
1093 ( THIS_ \
1094 IN PMDL MemoryDescriptorList \
1095 ); \
1096 \
1097 STDMETHODIMP_(ULONG) GetPhysicalPagesCount \
1098 ( THIS_ \
1099 IN PMDL MemoryDescriptorList \
1100 ); \
1101 \
1102 STDMETHODIMP_(PHYSICAL_ADDRESS) GetPhysicalPageAddress \
1103 ( THIS_ \
1104 IN PPHYSICAL_ADDRESS Address, \
1105 IN PMDL MemoryDescriptorList, \
1106 IN ULONG Index \
1107 )
1108
1109 #ifndef IMP_IPortClsVersion
1110
1111 #define IMP_IPortClsVersion \
1112 STDMETHODIMP_(DWORD) GetVersion(void);
1113
1114 #endif
1115
1116 #ifdef IMP_IPortWaveRT
1117 #define IMP_IPortWaveRT IMP_IPort
1118 #endif
1119
1120 #endif