031a00fc4656e0a0482e47e62836291ed5906e6a
[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 PPCFILTER_DESCRIPTOR DeviceDescriptor;
213 KSTOPOLOGY* Topology;
214 LIST_ENTRY SymbolicLinkList;
215 LIST_ENTRY PhysicalConnectionList;
216 UNICODE_STRING RefString;
217 PUNKNOWN UnknownMiniport;
218 PUNKNOWN UnknownStream;
219 PVOID PortPin;
220 }SUBDEVICE_DESCRIPTOR, *PSUBDEVICE_DESCRIPTOR;
221
222 #undef INTERFACE
223 #define INTERFACE ISubdevice
224
225 #define DEFINE_ABSTRACT_ISUBDEVICE() \
226 STDMETHOD_(NTSTATUS, NewIrpTarget)(THIS_ \
227 OUT IIrpTarget **OutTarget, \
228 IN PCWSTR Name, \
229 IN PUNKNOWN Unknown, \
230 IN POOL_TYPE PoolType, \
231 IN PDEVICE_OBJECT DeviceObject, \
232 IN PIRP Irp, \
233 IN KSOBJECT_CREATE *CreateObject) PURE; \
234 \
235 STDMETHOD_(NTSTATUS, ReleaseChildren)(THIS) PURE; \
236 \
237 STDMETHOD_(NTSTATUS, GetDescriptor)(THIS_ \
238 IN SUBDEVICE_DESCRIPTOR **) PURE; \
239 \
240 STDMETHOD_(NTSTATUS, DataRangeIntersection)(THIS_ \
241 IN ULONG PinId, \
242 IN PKSDATARANGE DataRange, \
243 IN PKSDATARANGE MatchingDataRange, \
244 IN ULONG OutputBufferLength, \
245 OUT PVOID ResultantFormat OPTIONAL, \
246 OUT PULONG ResultantFormatLength) PURE; \
247 \
248 STDMETHOD_(NTSTATUS, PowerChangeNotify)(THIS_ \
249 IN POWER_STATE PowerState) PURE; \
250 \
251 STDMETHOD_(NTSTATUS, PinCount)(THIS_ \
252 IN ULONG PinId, \
253 IN OUT PULONG FilterNecessary, \
254 IN OUT PULONG FilterCurrent, \
255 IN OUT PULONG FilterPossible, \
256 IN OUT PULONG GlobalCurrent, \
257 IN OUT PULONG GlobalPossible)PURE;
258
259
260
261 #define IMP_ISubdevice \
262 STDMETHODIMP_(NTSTATUS) NewIrpTarget( \
263 OUT IIrpTarget **OutTarget, \
264 IN PCWSTR Name, \
265 IN PUNKNOWN Unknown, \
266 IN POOL_TYPE PoolType, \
267 IN PDEVICE_OBJECT DeviceObject, \
268 IN PIRP Irp, \
269 IN KSOBJECT_CREATE *CreateObject); \
270 \
271 STDMETHODIMP_(NTSTATUS) ReleaseChildren(THIS); \
272 \
273 STDMETHODIMP_(NTSTATUS) GetDescriptor(THIS_ \
274 IN SUBDEVICE_DESCRIPTOR **); \
275 \
276 STDMETHODIMP_(NTSTATUS) DataRangeIntersection( \
277 IN ULONG PinId, \
278 IN PKSDATARANGE DataRange, \
279 IN PKSDATARANGE MatchingDataRange, \
280 IN ULONG OutputBufferLength, \
281 OUT PVOID ResultantFormat OPTIONAL, \
282 OUT PULONG ResultantFormatLength); \
283 \
284 STDMETHODIMP_(NTSTATUS) PowerChangeNotify( \
285 IN POWER_STATE PowerState); \
286 \
287 STDMETHODIMP_(NTSTATUS) PinCount( \
288 IN ULONG PinId, \
289 IN OUT PULONG FilterNecessary, \
290 IN OUT PULONG FilterCurrent, \
291 IN OUT PULONG FilterPossible, \
292 IN OUT PULONG GlobalCurrent, \
293 IN OUT PULONG GlobalPossible)
294
295
296 DECLARE_INTERFACE_(ISubdevice, IUnknown)
297 {
298 DEFINE_ABSTRACT_UNKNOWN()
299 DEFINE_ABSTRACT_ISUBDEVICE()
300 };
301
302 typedef ISubdevice *PSUBDEVICE;
303
304 /*****************************************************************************
305 * IIrpQueue
306 *****************************************************************************
307 */
308
309 #undef INTERFACE
310 #define INTERFACE IIrpQueue
311
312 DECLARE_INTERFACE_(IIrpQueue, IUnknown)
313 {
314 DEFINE_ABSTRACT_UNKNOWN()
315
316 STDMETHOD_(NTSTATUS, Init)(THIS_
317 IN KSPIN_CONNECT *ConnectDetails,
318 IN PKSDATAFORMAT DataFormat,
319 IN PDEVICE_OBJECT DeviceObject,
320 IN ULONG FrameSize,
321 IN ULONG Alignment,
322 IN PVOID SilenceBuffer) PURE;
323
324 STDMETHOD_(NTSTATUS, AddMapping)(THIS_
325 IN PIRP Irp,
326 OUT PULONG Data) PURE;
327
328 STDMETHOD_(NTSTATUS, GetMapping)(THIS_
329 OUT PUCHAR * Buffer,
330 OUT PULONG BufferSize) PURE;
331
332 STDMETHOD_(VOID, UpdateMapping)(THIS_
333 IN ULONG BytesWritten) PURE;
334
335 STDMETHOD_(ULONG, NumMappings)(THIS) PURE;
336
337 STDMETHOD_(ULONG, NumData)(THIS) PURE;
338
339 STDMETHOD_(BOOL, MinimumDataAvailable)(THIS) PURE;
340
341 STDMETHOD_(BOOL, CancelBuffers)(THIS) PURE;
342
343 STDMETHOD_(VOID, UpdateFormat)(THIS_
344 IN PKSDATAFORMAT DataFormat) PURE;
345
346 STDMETHOD_(NTSTATUS, GetMappingWithTag)(THIS_
347 IN PVOID Tag,
348 OUT PPHYSICAL_ADDRESS PhysicalAddress,
349 OUT PVOID *VirtualAddress,
350 OUT PULONG ByteCount,
351 OUT PULONG Flags) PURE;
352
353 STDMETHOD_(NTSTATUS, ReleaseMappingWithTag)(THIS_
354 IN PVOID Tag) PURE;
355
356 STDMETHOD_(BOOL, HasLastMappingFailed)(THIS) PURE;
357 STDMETHOD_(VOID, PrintQueueStatus)(THIS) PURE;
358 STDMETHOD_(VOID, SetMinimumDataThreshold)(THIS_
359 IN ULONG MinimumDataThreshold) PURE;
360 STDMETHOD_(ULONG, GetMinimumDataThreshold)(THIS) PURE;
361 };
362
363
364 #define IMP_IIrpQueue \
365 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
366 IN KSPIN_CONNECT *ConnectDetails, \
367 IN PKSDATAFORMAT DataFormat, \
368 IN PDEVICE_OBJECT DeviceObject, \
369 IN ULONG FrameSize, \
370 IN ULONG Alignment, \
371 IN PVOID SilenceBuffer); \
372 \
373 STDMETHODIMP_(NTSTATUS) AddMapping(THIS_ \
374 IN PIRP Irp, \
375 OUT PULONG Data); \
376 \
377 STDMETHODIMP_(NTSTATUS) GetMapping(THIS_ \
378 OUT PUCHAR * Buffer, \
379 OUT PULONG BufferSize); \
380 \
381 STDMETHODIMP_(VOID) UpdateMapping(THIS_ \
382 IN ULONG BytesWritten); \
383 \
384 STDMETHODIMP_(ULONG) NumMappings(THIS); \
385 \
386 STDMETHODIMP_(ULONG) NumData(THIS); \
387 \
388 STDMETHODIMP_(BOOL) MinimumDataAvailable(THIS); \
389 \
390 STDMETHODIMP_(BOOL) CancelBuffers(THIS); \
391 \
392 STDMETHODIMP_(VOID) UpdateFormat(THIS_ \
393 IN PKSDATAFORMAT DataFormat); \
394 \
395 STDMETHODIMP_(NTSTATUS) GetMappingWithTag(THIS_ \
396 IN PVOID Tag, \
397 OUT PPHYSICAL_ADDRESS PhysicalAddress, \
398 OUT PVOID *VirtualAddress, \
399 OUT PULONG ByteCount, \
400 OUT PULONG Flags); \
401 \
402 STDMETHODIMP_(NTSTATUS) ReleaseMappingWithTag( \
403 IN PVOID Tag); \
404 \
405 STDMETHODIMP_(BOOL) HasLastMappingFailed(THIS); \
406 STDMETHODIMP_(VOID) PrintQueueStatus(THIS); \
407 STDMETHODIMP_(VOID) SetMinimumDataThreshold( \
408 IN ULONG MinimumDataThreshold); \
409 STDMETHODIMP_(ULONG) GetMinimumDataThreshold(VOID)
410
411 /*****************************************************************************
412 * IKsWorkSink
413 *****************************************************************************
414 */
415 #undef INTERFACE
416 #define INTERFACE IKsWorkSink
417
418 DECLARE_INTERFACE_(IKsWorkSink, IUnknown)
419 {
420 DEFINE_ABSTRACT_UNKNOWN()
421
422 STDMETHOD_(NTSTATUS, Work)(THIS);
423 };
424
425 /*****************************************************************************
426 * IIrpStreamNotify
427 *****************************************************************************
428 */
429 #undef INTERFACE
430 #define INTERFACE IIrpStreamNotify
431
432 struct IRPSTREAMPOSITION;
433
434 DECLARE_INTERFACE_(IIrpStreamNotify, IUnknown)
435 {
436 DEFINE_ABSTRACT_UNKNOWN()
437
438 STDMETHOD_(NTSTATUS, IrpSubmitted)(THIS_
439 IN PIRP Irp,
440 IN BOOLEAN WAIT)PURE;
441
442 STDMETHOD_(NTSTATUS, GetPosition)(THIS_
443 OUT struct IRPSTREAMPOSITION * Position)PURE;
444 };
445
446 /*****************************************************************************
447 * IKsShellTransport
448 *****************************************************************************
449 */
450
451 #undef INTERFACE
452 #define INTERFACE IKsShellTransport
453
454 #define DEFINE_ABSTRACT_IKSSHELLTRANSPORT() \
455 STDMETHOD_(NTSTATUS, TransferKsIrp)(THIS_ \
456 IN PIRP Irp, \
457 OUT IKsShellTransport ** Transport) PURE; \
458 \
459 STDMETHOD_(NTSTATUS, Connect)(THIS_ \
460 IN IKsShellTransport * StartTransport, \
461 OUT IKsShellTransport ** EndTransport, \
462 IN KSPIN_DATAFLOW DataFlow)PURE; \
463 \
464 STDMETHOD_(NTSTATUS, SetDeviceState)(THIS_ \
465 IN KSSTATE State1, \
466 IN KSSTATE State2, \
467 OUT IKsShellTransport ** EndTransport)PURE; \
468 \
469 STDMETHOD_(NTSTATUS, SetResetState)(THIS_ \
470 IN KSRESET State1, \
471 OUT IKsShellTransport ** EndTransport)PURE;
472
473
474 DECLARE_INTERFACE_(IKsShellTransport, IUnknown)
475 {
476 DEFINE_ABSTRACT_UNKNOWN()
477
478 DEFINE_ABSTRACT_IKSSHELLTRANSPORT()
479 };
480
481 /*****************************************************************************
482 * IIrpStream
483 *****************************************************************************
484 */
485 struct IRPSTREAM_POSITION;
486 struct IRPSTREAMPACKETINFO;
487
488 #define DEFINE_ABSTRACT_IRPSTREAM() \
489 STDMETHOD_(NTSTATUS, TransferKsIrp)(THIS_ \
490 IN PIRP Irp, \
491 OUT IKsShellTransport ** Transport) PURE; \
492 \
493 STDMETHOD_(NTSTATUS, Connect)(THIS_ \
494 IN IKsShellTransport * StartTransport, \
495 OUT IKsShellTransport ** EndTransport, \
496 IN KSPIN_DATAFLOW DataFlow)PURE; \
497 \
498 STDMETHOD_(NTSTATUS, SetDeviceState)(THIS_ \
499 IN KSSTATE State1, \
500 IN KSSTATE State2, \
501 OUT IKsShellTransport ** EndTransport)PURE; \
502 \
503 STDMETHOD_(NTSTATUS, SetResetState)(THIS_ \
504 IN KSRESET State1, \
505 OUT IKsShellTransport ** EndTransport)PURE; \
506 \
507 STDMETHOD_(NTSTATUS, GetPosition)(THIS_ \
508 IN OUT struct IRPSTREAM_POSITION * Position) PURE; \
509 \
510 STDMETHOD_(NTSTATUS, Init)(THIS_ \
511 IN BOOLEAN Wait, \
512 KSPIN_CONNECT *ConnectDetails, \
513 PDEVICE_OBJECT DeviceObject, \
514 PDMA_ADAPTER DmaAdapter) PURE; \
515 \
516 STDMETHOD_(NTSTATUS, CancelAllIrps)(THIS_ \
517 ULONG Wait)PURE; \
518 \
519 STDMETHOD_(VOID, TerminatePacket)(THIS); \
520 \
521 STDMETHOD_(NTSTATUS, ChangeOptionsFlag)(THIS_ \
522 ULONG Unknown1, \
523 ULONG Unknown2, \
524 ULONG Unknown3, \
525 ULONG Unknown4)PURE; \
526 \
527 STDMETHOD_(NTSTATUS, GetPacketInfo)(THIS_ \
528 struct IRPSTREAMPACKETINFO * Info1, \
529 struct IRPSTREAMPACKETINFO * Info2)PURE; \
530 \
531 STDMETHOD_(NTSTATUS, SetPacketOffsets)(THIS_ \
532 ULONG Unknown1, \
533 ULONG Unknown2)PURE; \
534 \
535 STDMETHOD_(NTSTATUS, RegisterNotifySink)(THIS_ \
536 IN IIrpStreamNotify * NotifyStream)PURE;
537
538
539
540 #undef INTERFACE
541 #define INTERFACE IIrpStream
542
543 DECLARE_INTERFACE_(IIrpStream, IUnknown)
544 {
545 DEFINE_ABSTRACT_UNKNOWN()
546
547 DEFINE_ABSTRACT_IRPSTREAM()
548 };
549
550
551 /*****************************************************************************
552 * IIrpStreamPhysical
553 *****************************************************************************
554 */
555 #undef INTERFACE
556 #define INTERFACE IIrpStreamPhysical
557
558 DECLARE_INTERFACE_(IIrpStreamPhysical, IIrpStream)
559 {
560 DEFINE_ABSTRACT_UNKNOWN()
561
562 DEFINE_ABSTRACT_IRPSTREAM()
563
564 STDMETHOD_(NTSTATUS, GetMapping)(THIS_
565 IN PVOID Tag,
566 OUT PPHYSICAL_ADDRESS PhysicalAddress,
567 OUT PVOID * VirtualAddress,
568 OUT PULONG ByteCount,
569 OUT PULONG Flags)PURE;
570
571 };
572
573 /*****************************************************************************
574 * IIrpStreamVirtual
575 *****************************************************************************
576 */
577 #undef INTERFACE
578 #define INTERFACE IIrpStreamVirtual
579
580 DECLARE_INTERFACE_(IIrpStreamVirtual, IIrpStream)
581 {
582 DEFINE_ABSTRACT_UNKNOWN()
583
584 DEFINE_ABSTRACT_IRPSTREAM()
585
586 STDMETHOD_(NTSTATUS, GetLockedRegion)(THIS_
587 OUT PULONG OutSize,
588 OUT PVOID * OutBuffer)PURE;
589
590 STDMETHOD_(NTSTATUS, Copy)(THIS_
591 IN BOOLEAN Wait,
592 OUT ULONG Size,
593 IN PULONG Buffer,
594 OUT PVOID Result)PURE;
595
596 STDMETHOD_(NTSTATUS, Complete)(THIS_
597 IN ULONG Unknown1,
598 IN PULONG Data)PURE;
599
600 STDMETHOD_(ULONG, GetIrpStreamPositionLock)(THIS);
601 };
602
603 /*****************************************************************************
604 * IPortFilterWavePci
605 *****************************************************************************
606 */
607
608 #undef INTERFACE
609 #define INTERFACE IPortFilterWavePci
610
611 DECLARE_INTERFACE_(IPortFilterWavePci, IIrpTarget)
612 {
613 DEFINE_ABSTRACT_UNKNOWN()
614
615 DEFINE_ABSTRACT_IRPTARGET()
616
617 STDMETHOD_(NTSTATUS, Init)(THIS_
618 IN PPORTWAVEPCI Port)PURE;
619 };
620
621 typedef IPortFilterWavePci *PPORTFILTERWAVEPCI;
622
623 #define IMP_IPortFilterPci \
624 IMP_IIrpTarget; \
625 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
626 IN PPORTWAVEPCI Port)
627
628 /*****************************************************************************
629 * IPortPinWavePci
630 *****************************************************************************
631 */
632
633 #undef INTERFACE
634 #define INTERFACE IPortPinWavePci
635
636 DECLARE_INTERFACE_(IPortPinWavePci, IIrpTarget)
637 {
638 DEFINE_ABSTRACT_UNKNOWN()
639
640 DEFINE_ABSTRACT_IRPTARGET()
641
642 STDMETHOD_(NTSTATUS, Init)(THIS_
643 IN PPORTWAVEPCI Port,
644 IN PPORTFILTERWAVEPCI Filter,
645 IN KSPIN_CONNECT * ConnectDetails,
646 IN KSPIN_DESCRIPTOR * PinDescriptor,
647 IN PDEVICE_OBJECT DeviceObject) PURE;
648
649 STDMETHOD_(PVOID, GetIrpStream)(THIS) PURE;
650 STDMETHOD_(PMINIPORT, GetMiniport)(THIS) PURE;
651 };
652
653 #define IMP_IPortPinWavePci \
654 IMP_IIrpTarget; \
655 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
656 IN PPORTWAVEPCI Port, \
657 IN PPORTFILTERWAVEPCI Filter, \
658 IN KSPIN_CONNECT * ConnectDetails, \
659 IN KSPIN_DESCRIPTOR * PinDescriptor, \
660 IN PDEVICE_OBJECT DeviceObject); \
661 \
662 STDMETHODIMP_(PVOID) GetIrpStream(); \
663 STDMETHODIMP_(PMINIPORT) GetMiniport(THIS)
664
665
666
667 typedef IPortPinWavePci *PPORTPINWAVEPCI;
668
669
670 #if (NTDDI_VERSION >= NTDDI_VISTA)
671
672 /*****************************************************************************
673 * IPortFilterWaveRT
674 *****************************************************************************
675 */
676
677 #undef INTERFACE
678 #define INTERFACE IPortFilterWaveRT
679
680 #ifndef PPORTWAVERT
681 typedef IPortWaveRT *PPORTWAVERT;
682 #endif
683
684 DECLARE_INTERFACE_(IPortFilterWaveRT, IIrpTarget)
685 {
686 DEFINE_ABSTRACT_UNKNOWN()
687
688 DEFINE_ABSTRACT_IRPTARGET()
689
690 STDMETHOD_(NTSTATUS, Init)(THIS_
691 IN PPORTWAVERT Port)PURE;
692 };
693
694 typedef IPortFilterWaveRT *PPORTFILTERWAVERT;
695
696 #define IMP_IPortFilterWaveRT \
697 IMP_IIrpTarget; \
698 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
699 IN PPORTWAVERT Port)
700
701
702 /*****************************************************************************
703 * IPortPinWaveRT
704 *****************************************************************************
705 */
706
707 #undef INTERFACE
708 #define INTERFACE IPortPinWaveRT
709
710 DECLARE_INTERFACE_(IPortPinWaveRT, IIrpTarget)
711 {
712 DEFINE_ABSTRACT_UNKNOWN()
713
714 DEFINE_ABSTRACT_IRPTARGET()
715
716 STDMETHOD_(NTSTATUS, Init)(THIS_
717 IN PPORTWAVERT Port,
718 IN PPORTFILTERWAVERT Filter,
719 IN KSPIN_CONNECT * ConnectDetails,
720 IN KSPIN_DESCRIPTOR * PinDescriptor,
721 IN PDEVICE_OBJECT DeviceObject) PURE;
722 };
723
724 typedef IPortPinWaveRT *PPORTPINWAVERT;
725
726 #define IMP_IPortPinWaveRT \
727 IMP_IIrpTarget; \
728 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
729 IN PPORTWAVERT Port, \
730 IN PPORTFILTERWAVERT Filter, \
731 IN KSPIN_CONNECT * ConnectDetails, \
732 IN KSPIN_DESCRIPTOR * PinDescriptor, \
733 IN PDEVICE_OBJECT DeviceObject)
734
735
736 #endif
737
738 /*****************************************************************************
739 * IPortFilterWaveCyclic
740 *****************************************************************************
741 */
742
743 #undef INTERFACE
744 #define INTERFACE IPortFilterWaveCyclic
745
746 struct IPortPinWaveCyclic;
747
748 DECLARE_INTERFACE_(IPortFilterWaveCyclic, IIrpTarget)
749 {
750 DEFINE_ABSTRACT_UNKNOWN()
751
752 DEFINE_ABSTRACT_IRPTARGET()
753
754 STDMETHOD_(NTSTATUS, Init)(THIS_
755 IN PPORTWAVECYCLIC Port)PURE;
756
757 STDMETHOD_(NTSTATUS, FreePin)(THIS_
758 IN struct IPortPinWaveCyclic* Pin)PURE;
759 };
760
761 typedef IPortFilterWaveCyclic *PPORTFILTERWAVECYCLIC;
762
763 #define IMP_IPortFilterWaveCyclic \
764 IMP_IIrpTarget; \
765 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
766 IN PPORTWAVECYCLIC Port); \
767 STDMETHODIMP_(NTSTATUS) FreePin(THIS_ \
768 IN struct IPortPinWaveCyclic* Pin)
769
770
771 /*****************************************************************************
772 * IPortPinWaveCyclic
773 *****************************************************************************
774 */
775
776 #undef INTERFACE
777 #define INTERFACE IPortPinWaveCyclic
778
779 DECLARE_INTERFACE_(IPortPinWaveCyclic, IIrpTarget)
780 {
781 DEFINE_ABSTRACT_UNKNOWN()
782
783 DEFINE_ABSTRACT_IRPTARGET()
784
785 STDMETHOD_(NTSTATUS, Init)(THIS_
786 IN PPORTWAVECYCLIC Port,
787 IN PPORTFILTERWAVECYCLIC Filter,
788 IN KSPIN_CONNECT * ConnectDetails,
789 IN KSPIN_DESCRIPTOR * PinDescriptor) PURE;
790
791 STDMETHOD_(ULONG, GetCompletedPosition)(THIS) PURE;
792 STDMETHOD_(ULONG, GetCycleCount)(THIS) PURE;
793 STDMETHOD_(ULONG, GetDeviceBufferSize)(THIS) PURE;
794 STDMETHOD_(PVOID, GetIrpStream)(THIS) PURE;
795 STDMETHOD_(PMINIPORT, GetMiniport)(THIS) PURE;
796 };
797
798 typedef IPortPinWaveCyclic *PPORTPINWAVECYCLIC;
799
800 #define IMP_IPortPinWaveCyclic \
801 IMP_IIrpTarget; \
802 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
803 IN PPORTWAVECYCLIC Port, \
804 IN PPORTFILTERWAVECYCLIC Filter, \
805 IN KSPIN_CONNECT * ConnectDetails, \
806 IN KSPIN_DESCRIPTOR * PinDescriptor); \
807 STDMETHODIMP_(ULONG) GetCompletedPosition(THIS); \
808 STDMETHODIMP_(ULONG) GetCycleCount(THIS); \
809 STDMETHODIMP_(ULONG) GetDeviceBufferSize(THIS); \
810 STDMETHODIMP_(PVOID) GetIrpStream(THIS); \
811 STDMETHODIMP_(PMINIPORT) GetMiniport(THIS)
812
813
814 /*****************************************************************************
815 * IPortFilterDMus
816 *****************************************************************************
817 */
818
819 #undef INTERFACE
820 #define INTERFACE IPortFilterDMus
821
822 struct IPortPinDMus;
823
824 DECLARE_INTERFACE_(IPortFilterDMus, IUnknown)
825 {
826 DEFINE_ABSTRACT_UNKNOWN()
827
828 DEFINE_ABSTRACT_IRPTARGET()
829
830 STDMETHOD_(NTSTATUS, Init)(THIS_
831 IN PPORTDMUS Port)PURE;
832
833 STDMETHOD_(NTSTATUS, FreePin)(THIS_
834 IN struct IPortPinDMus* Pin)PURE;
835
836 STDMETHOD_(VOID, NotifyPins)(THIS) PURE;
837 };
838
839 typedef IPortFilterDMus *PPORTFILTERDMUS;
840
841 #define IMP_IPortFilterDMus \
842 IMP_IIrpTarget; \
843 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
844 IN PPORTDMUS Port); \
845 STDMETHODIMP_(NTSTATUS) FreePin(THIS_ \
846 IN struct IPortPinDMus* Pin); \
847 STDMETHODIMP_(VOID) NotifyPins(THIS)
848
849 /*****************************************************************************
850 * IPortPinDMus
851 *****************************************************************************
852 */
853
854 #undef INTERFACE
855 #define INTERFACE IPortPinDMus
856
857 DECLARE_INTERFACE_(IPortPinDMus, IIrpTarget)
858 {
859 DEFINE_ABSTRACT_UNKNOWN()
860
861 DEFINE_ABSTRACT_IRPTARGET()
862
863 STDMETHOD_(NTSTATUS, Init)(THIS_
864 IN PPORTDMUS Port,
865 IN PPORTFILTERDMUS Filter,
866 IN KSPIN_CONNECT * ConnectDetails,
867 IN KSPIN_DESCRIPTOR * PinDescriptor,
868 IN PDEVICE_OBJECT DeviceObject) PURE;
869
870 STDMETHOD_(VOID, Notify)(THIS) PURE;
871 };
872
873 #define IMP_IPortPinDMus \
874 IMP_IIrpTarget; \
875 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
876 IN PPORTDMUS Port, \
877 IN PPORTFILTERDMUS Filter, \
878 IN KSPIN_CONNECT * ConnectDetails, \
879 IN KSPIN_DESCRIPTOR * PinDescriptor, \
880 IN PDEVICE_OBJECT DeviceObject); \
881 STDMETHODIMP_(VOID) Notify(THIS)
882
883 typedef IPortPinDMus *PPORTPINDMUS;
884
885 /*****************************************************************************
886 * IDmaChannelInit
887 *****************************************************************************
888 */
889
890 #define IMP_IDmaChannelEx \
891 STDMETHODIMP_(NTSTATUS) AllocateBuffer( \
892 IN ULONG BufferSize, \
893 IN PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL); \
894 \
895 STDMETHODIMP_(void) FreeBuffer(void); \
896 STDMETHODIMP_(ULONG) TransferCount(void); \
897 STDMETHODIMP_(ULONG) MaximumBufferSize(void); \
898 STDMETHODIMP_(ULONG) AllocatedBufferSize(void); \
899 STDMETHODIMP_(ULONG) BufferSize(void); \
900 \
901 STDMETHODIMP_(void) SetBufferSize( \
902 IN ULONG BufferSize); \
903 \
904 STDMETHODIMP_(PVOID) SystemAddress(void); \
905 STDMETHODIMP_(PHYSICAL_ADDRESS) PhysicalAddress( \
906 IN PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL); \
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_ \
953 IN PPHYSICAL_ADDRESS Address) PURE; \
954 STDMETHOD_(PADAPTER_OBJECT, GetAdapterObject)( THIS ) PURE; \
955 \
956 STDMETHOD_(void, CopyTo)( THIS_ \
957 IN PVOID Destination, \
958 IN PVOID Source, \
959 IN ULONG ByteCount) PURE; \
960 \
961 STDMETHOD_(void, CopyFrom)( THIS_ \
962 IN PVOID Destination, \
963 IN PVOID Source, \
964 IN ULONG ByteCount) PURE;
965
966 #undef INTERFACE
967 #define INTERFACE IDmaChannelInit
968
969 DECLARE_INTERFACE_(IDmaChannelInit, IUnknown)
970 {
971 DEFINE_ABSTRACT_UNKNOWN()
972 DEFINE_ABSTRACT_DMACHANNEL_EX()
973 DEFINE_ABSTRACT_DMACHANNELSLAVE()
974
975 STDMETHOD_(NTSTATUS, Init)( THIS_
976 IN PDEVICE_DESCRIPTION DeviceDescription,
977 IN PDEVICE_OBJECT DeviceObject) PURE;
978 };
979
980 #undef INTERFACE
981
982 /*****************************************************************************
983 * IPortFilterTopology
984 *****************************************************************************
985 */
986
987 #undef INTERFACE
988 #define INTERFACE IPortFilterTopology
989
990 DECLARE_INTERFACE_(IPortFilterTopology, IIrpTarget)
991 {
992 DEFINE_ABSTRACT_UNKNOWN()
993
994 DEFINE_ABSTRACT_IRPTARGET()
995
996 STDMETHOD_(NTSTATUS, Init)(THIS_
997 IN PPORTTOPOLOGY Port)PURE;
998 };
999
1000 typedef IPortFilterTopology *PPORTFILTERTOPOLOGY;
1001
1002 #define IMP_IPortFilterTopology \
1003 IMP_IIrpTarget; \
1004 STDMETHODIMP_(NTSTATUS) Init(THIS_ \
1005 IN PPORTTOPOLOGY Port)
1006
1007 #undef INTERFACE
1008
1009 /*****************************************************************************
1010 * IPortWaveRTStreamInit
1011 *****************************************************************************
1012 */
1013
1014 #undef INTERFACE
1015 #define INTERFACE IPortWaveRTStreamInit
1016
1017
1018 DECLARE_INTERFACE_(IPortWaveRTStreamInit, IUnknown)
1019 {
1020 DEFINE_ABSTRACT_UNKNOWN()
1021
1022 STDMETHOD_(PMDL, AllocatePagesForMdl)
1023 ( THIS_
1024 IN PHYSICAL_ADDRESS HighAddress,
1025 IN SIZE_T TotalBytes
1026 ) PURE;
1027
1028 STDMETHOD_(PMDL, AllocateContiguousPagesForMdl)
1029 ( THIS_
1030 IN PHYSICAL_ADDRESS LowAddress,
1031 IN PHYSICAL_ADDRESS HighAddress,
1032 IN SIZE_T TotalBytes
1033 ) PURE;
1034
1035 STDMETHOD_(PVOID, MapAllocatedPages)
1036 ( THIS_
1037 IN PMDL MemoryDescriptorList,
1038 IN MEMORY_CACHING_TYPE CacheType
1039 ) PURE;
1040
1041 STDMETHOD_(VOID, UnmapAllocatedPages)
1042 ( THIS_
1043 IN PVOID BaseAddress,
1044 IN PMDL MemoryDescriptorList
1045 ) PURE;
1046
1047 STDMETHOD_(VOID, FreePagesFromMdl)
1048 ( THIS_
1049 IN PMDL MemoryDescriptorList
1050 ) PURE;
1051
1052 STDMETHOD_(ULONG, GetPhysicalPagesCount)
1053 ( THIS_
1054 IN PMDL MemoryDescriptorList
1055 ) PURE;
1056
1057 STDMETHOD_(PHYSICAL_ADDRESS, GetPhysicalPageAddress)
1058 ( THIS_
1059 IN PPHYSICAL_ADDRESS Address,
1060 IN PMDL MemoryDescriptorList,
1061 IN ULONG Index
1062 ) PURE;
1063 };
1064
1065 #undef INTERFACE
1066
1067 #define IMP_IPortWaveRTStreamInit \
1068 STDMETHODIMP_(PMDL) AllocatePagesForMdl \
1069 ( THIS_ \
1070 IN PHYSICAL_ADDRESS HighAddress, \
1071 IN SIZE_T TotalBytes \
1072 ); \
1073 \
1074 STDMETHODIMP_(PMDL) AllocateContiguousPagesForMdl \
1075 ( THIS_ \
1076 IN PHYSICAL_ADDRESS LowAddress, \
1077 IN PHYSICAL_ADDRESS HighAddress, \
1078 IN SIZE_T TotalBytes \
1079 ); \
1080 \
1081 STDMETHODIMP_(PVOID) MapAllocatedPages \
1082 ( THIS_ \
1083 IN PMDL MemoryDescriptorList, \
1084 IN MEMORY_CACHING_TYPE CacheType \
1085 ); \
1086 \
1087 STDMETHODIMP_(VOID) UnmapAllocatedPages \
1088 ( THIS_ \
1089 IN PVOID BaseAddress, \
1090 IN PMDL MemoryDescriptorList \
1091 ); \
1092 \
1093 STDMETHODIMP_(VOID) FreePagesFromMdl \
1094 ( THIS_ \
1095 IN PMDL MemoryDescriptorList \
1096 ); \
1097 \
1098 STDMETHODIMP_(ULONG) GetPhysicalPagesCount \
1099 ( THIS_ \
1100 IN PMDL MemoryDescriptorList \
1101 ); \
1102 \
1103 STDMETHODIMP_(PHYSICAL_ADDRESS) GetPhysicalPageAddress \
1104 ( THIS_ \
1105 IN PPHYSICAL_ADDRESS Address, \
1106 IN PMDL MemoryDescriptorList, \
1107 IN ULONG Index \
1108 )
1109
1110 #ifndef IMP_IPortClsVersion
1111
1112 #define IMP_IPortClsVersion \
1113 STDMETHODIMP_(DWORD) GetVersion(void);
1114
1115 #endif
1116
1117 #ifdef IMP_IPortWaveRT
1118 #define IMP_IPortWaveRT IMP_IPort
1119 #endif
1120
1121 #endif