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)(                           \
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_(ULONG, GetCurrentIrpOffset)(THIS) PURE;
354 
355     STDMETHOD_(BOOLEAN, GetAcquiredTagRange)(THIS_
356         IN PVOID * FirstTag,
357         IN PVOID * LastTag) PURE;
358 
359 };
360 
361 
362 #define IMP_IIrpQueue                                  \
363     STDMETHODIMP_(NTSTATUS) Init(THIS_                 \
364         IN PKSPIN_CONNECT ConnectDetails,              \
365         IN PKSPIN_DESCRIPTOR Descriptor,               \
366         IN ULONG FrameSize,                            \
367         IN ULONG Alignment,                            \
368         IN ULONG TagSupportEnabled);                   \
369                                                        \
370     STDMETHODIMP_(NTSTATUS) AddMapping(THIS_           \
371         IN PIRP Irp,                                   \
372         OUT PULONG Data);                              \
373                                                        \
374     STDMETHODIMP_(NTSTATUS) GetMapping(THIS_           \
375         OUT PUCHAR * Buffer,                           \
376         OUT PULONG BufferSize);                        \
377                                                        \
378     STDMETHODIMP_(VOID) UpdateMapping(THIS_            \
379         IN ULONG BytesWritten);                        \
380                                                        \
381     STDMETHODIMP_(ULONG) NumData(THIS);                \
382                                                        \
383     STDMETHODIMP_(BOOL) CancelBuffers(THIS);           \
384                                                        \
385     STDMETHODIMP_(NTSTATUS) GetMappingWithTag(THIS_    \
386         IN PVOID Tag,                                  \
387         OUT PPHYSICAL_ADDRESS  PhysicalAddress,        \
388         OUT PVOID  *VirtualAddress,                    \
389         OUT PULONG  ByteCount,                         \
390         OUT PULONG  Flags);                            \
391                                                        \
392     STDMETHODIMP_(NTSTATUS) ReleaseMappingWithTag(     \
393         IN PVOID Tag);                                 \
394                                                        \
395     STDMETHODIMP_(BOOLEAN) HasLastMappingFailed(THIS); \
396     STDMETHODIMP_(ULONG) GetCurrentIrpOffset(THIS);    \
397     STDMETHODIMP_(BOOLEAN) GetAcquiredTagRange(THIS_      \
398         IN PVOID * FirstTag,                           \
399         IN PVOID * LastTag);
400 
401 
402 
403 /*****************************************************************************
404  * IKsWorkSink
405  *****************************************************************************
406  */
407 #undef INTERFACE
408 #define INTERFACE IKsWorkSink
409 
410 DECLARE_INTERFACE_(IKsWorkSink, IUnknown)
411 {
412     DEFINE_ABSTRACT_UNKNOWN()
413 
414     STDMETHOD_(NTSTATUS, Work)(THIS);
415 };
416 
417 /*****************************************************************************
418  * IIrpStreamNotify
419  *****************************************************************************
420  */
421 #undef INTERFACE
422 #define INTERFACE IIrpStreamNotify
423 
424 struct IRPSTREAMPOSITION;
425 
426 DECLARE_INTERFACE_(IIrpStreamNotify, IUnknown)
427 {
428     DEFINE_ABSTRACT_UNKNOWN()
429 
430     STDMETHOD_(NTSTATUS, IrpSubmitted)(THIS_
431         IN PIRP Irp,
432         IN BOOLEAN WAIT)PURE;
433 
434     STDMETHOD_(NTSTATUS, GetPosition)(THIS_
435         OUT struct IRPSTREAMPOSITION * Position)PURE;
436 };
437 
438 /*****************************************************************************
439  * IKsShellTransport
440  *****************************************************************************
441  */
442 
443 #undef INTERFACE
444 #define INTERFACE IKsShellTransport
445 
446 #define DEFINE_ABSTRACT_IKSSHELLTRANSPORT()                     \
447     STDMETHOD_(NTSTATUS, TransferKsIrp)(THIS_                   \
448         IN PIRP Irp,                                            \
449         OUT IKsShellTransport ** Transport) PURE;               \
450                                                                 \
451     STDMETHOD_(NTSTATUS, Connect)(THIS_                         \
452         IN IKsShellTransport * StartTransport,                  \
453         OUT IKsShellTransport ** EndTransport,                  \
454         IN KSPIN_DATAFLOW DataFlow)PURE;                        \
455                                                                 \
456     STDMETHOD_(NTSTATUS, SetDeviceState)(THIS_                  \
457         IN KSSTATE State1,                                      \
458         IN KSSTATE State2,                                      \
459         OUT IKsShellTransport ** EndTransport)PURE;             \
460                                                                 \
461     STDMETHOD_(NTSTATUS, SetResetState)(THIS_                   \
462         IN KSRESET State1,                                      \
463         OUT IKsShellTransport ** EndTransport)PURE;
464 
465 
466 DECLARE_INTERFACE_(IKsShellTransport, IUnknown)
467 {
468     DEFINE_ABSTRACT_UNKNOWN()
469 
470     DEFINE_ABSTRACT_IKSSHELLTRANSPORT()
471 };
472 
473 /*****************************************************************************
474  * IIrpStream
475  *****************************************************************************
476  */
477 struct IRPSTREAM_POSITION;
478 struct IRPSTREAMPACKETINFO;
479 
480 #define DEFINE_ABSTRACT_IRPSTREAM()                             \
481     STDMETHOD_(NTSTATUS, TransferKsIrp)(THIS_                   \
482         IN PIRP Irp,                                            \
483         OUT IKsShellTransport ** Transport) PURE;               \
484                                                                 \
485     STDMETHOD_(NTSTATUS, Connect)(THIS_                         \
486         IN IKsShellTransport * StartTransport,                  \
487         OUT IKsShellTransport ** EndTransport,                  \
488         IN KSPIN_DATAFLOW DataFlow)PURE;                        \
489                                                                 \
490     STDMETHOD_(NTSTATUS, SetDeviceState)(THIS_                  \
491         IN KSSTATE State1,                                      \
492         IN KSSTATE State2,                                      \
493         OUT IKsShellTransport ** EndTransport)PURE;             \
494                                                                 \
495     STDMETHOD_(NTSTATUS, SetResetState)(THIS_                   \
496         IN KSRESET State1,                                      \
497         OUT IKsShellTransport ** EndTransport)PURE;             \
498                                                                 \
499     STDMETHOD_(NTSTATUS, GetPosition)(THIS_                     \
500         IN OUT struct IRPSTREAM_POSITION * Position) PURE;      \
501                                                                 \
502     STDMETHOD_(NTSTATUS, Init)(THIS_                            \
503         IN BOOLEAN Wait,                                        \
504         KSPIN_CONNECT *ConnectDetails,                          \
505         PDEVICE_OBJECT DeviceObject,                            \
506         PDMA_ADAPTER DmaAdapter) PURE;                          \
507                                                                 \
508     STDMETHOD_(NTSTATUS, CancelAllIrps)(THIS_                   \
509         ULONG Wait)PURE;                                        \
510                                                                 \
511     STDMETHOD_(VOID, TerminatePacket)(THIS);                    \
512                                                                 \
513     STDMETHOD_(NTSTATUS, ChangeOptionsFlag)(THIS_               \
514        ULONG Unknown1,                                          \
515        ULONG Unknown2,                                          \
516        ULONG Unknown3,                                          \
517        ULONG Unknown4)PURE;                                     \
518                                                                 \
519     STDMETHOD_(NTSTATUS, GetPacketInfo)(THIS_                   \
520        struct IRPSTREAMPACKETINFO * Info1,                      \
521        struct IRPSTREAMPACKETINFO * Info2)PURE;                 \
522                                                                 \
523     STDMETHOD_(NTSTATUS, SetPacketOffsets)(THIS_                \
524        ULONG Unknown1,                                          \
525        ULONG Unknown2)PURE;                                     \
526                                                                 \
527     STDMETHOD_(NTSTATUS, RegisterNotifySink)(THIS_              \
528        IN IIrpStreamNotify * NotifyStream)PURE;
529 
530 
531 
532 #undef INTERFACE
533 #define INTERFACE IIrpStream
534 
535 DECLARE_INTERFACE_(IIrpStream, IUnknown)
536 {
537     DEFINE_ABSTRACT_UNKNOWN()
538 
539     DEFINE_ABSTRACT_IRPSTREAM()
540 };
541 
542 
543 /*****************************************************************************
544  * IIrpStreamPhysical
545  *****************************************************************************
546  */
547 #undef INTERFACE
548 #define INTERFACE IIrpStreamPhysical
549 
550 DECLARE_INTERFACE_(IIrpStreamPhysical, IIrpStream)
551 {
552     DEFINE_ABSTRACT_UNKNOWN()
553 
554     DEFINE_ABSTRACT_IRPSTREAM()
555 
556     STDMETHOD_(NTSTATUS, GetMapping)(THIS_
557        IN PVOID Tag,
558        OUT PPHYSICAL_ADDRESS PhysicalAddress,
559        OUT PVOID * VirtualAddress,
560        OUT PULONG ByteCount,
561        OUT PULONG Flags)PURE;
562 
563 };
564 
565 /*****************************************************************************
566  * IIrpStreamVirtual
567  *****************************************************************************
568  */
569 #undef INTERFACE
570 #define INTERFACE IIrpStreamVirtual
571 
572 DECLARE_INTERFACE_(IIrpStreamVirtual, IIrpStream)
573 {
574     DEFINE_ABSTRACT_UNKNOWN()
575 
576     DEFINE_ABSTRACT_IRPSTREAM()
577 
578     STDMETHOD_(NTSTATUS, GetLockedRegion)(THIS_
579        OUT PULONG OutSize,
580        OUT PVOID * OutBuffer)PURE;
581 
582     STDMETHOD_(NTSTATUS, Copy)(THIS_
583        IN BOOLEAN Wait,
584        OUT ULONG Size,
585        IN PULONG Buffer,
586        OUT PVOID Result)PURE;
587 
588     STDMETHOD_(NTSTATUS, Complete)(THIS_
589        IN ULONG Unknown1,
590        IN PULONG Data)PURE;
591 
592     STDMETHOD_(ULONG, GetIrpStreamPositionLock)(THIS);
593 };
594 
595 /*****************************************************************************
596  * IPortFilterWavePci
597  *****************************************************************************
598  */
599 
600 #undef INTERFACE
601 #define INTERFACE IPortFilterWavePci
602 
603 struct IPortPinWavePci;
604 
605 DECLARE_INTERFACE_(IPortFilterWavePci, IIrpTarget)
606 {
607     DEFINE_ABSTRACT_UNKNOWN()
608 
609     DEFINE_ABSTRACT_IRPTARGET()
610 
611     STDMETHOD_(NTSTATUS, Init)(THIS_
612         IN PPORTWAVEPCI Port)PURE;
613 
614     STDMETHOD_(NTSTATUS, FreePin)(THIS_
615         IN struct IPortPinWavePci* Pin)PURE;
616 };
617 
618 typedef IPortFilterWavePci *PPORTFILTERWAVEPCI;
619 
620 #define IMP_IPortFilterPci           \
621     IMP_IIrpTarget;                         \
622     STDMETHODIMP_(NTSTATUS) Init(THIS_      \
623         IN PPORTWAVEPCI Port);              \
624     STDMETHODIMP_(NTSTATUS) FreePin(THIS_   \
625         IN struct IPortPinWavePci* Pin)
626 
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 #ifdef _MSC_VER
891 
892 #define IMP_IDmaChannelEx                                                 \
893     STDMETHODIMP_(NTSTATUS) AllocateBuffer(                               \
894         IN  ULONG BufferSize,                                             \
895         IN  PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL);        \
896                                                                           \
897     STDMETHODIMP_(void) FreeBuffer(void);                                 \
898     STDMETHODIMP_(ULONG) TransferCount(void);                             \
899     STDMETHODIMP_(ULONG) MaximumBufferSize(void);                         \
900     STDMETHODIMP_(ULONG) AllocatedBufferSize(void);                       \
901     STDMETHODIMP_(ULONG) BufferSize(void);                                \
902                                                                           \
903     STDMETHODIMP_(void) SetBufferSize(                                    \
904         IN  ULONG BufferSize);                                            \
905                                                                           \
906     STDMETHODIMP_(PVOID) SystemAddress(void);                             \
907     STDMETHODIMP_(PHYSICAL_ADDRESS) PhysicalAddress();                    \
908     STDMETHODIMP_(PADAPTER_OBJECT) GetAdapterObject(void);                \
909                                                                           \
910     STDMETHODIMP_(void) CopyTo(                                           \
911         IN  PVOID Destination,                                            \
912         IN  PVOID Source,                                                 \
913         IN  ULONG ByteCount);                                             \
914                                                                           \
915     STDMETHODIMP_(void) CopyFrom(                                         \
916         IN  PVOID Destination,                                            \
917         IN  PVOID Source,                                                 \
918         IN  ULONG ByteCount)
919 
920 #else
921 
922 #define IMP_IDmaChannelEx                                                 \
923     STDMETHODIMP_(NTSTATUS) AllocateBuffer(                               \
924         IN  ULONG BufferSize,                                             \
925         IN  PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL);        \
926                                                                           \
927     STDMETHODIMP_(void) FreeBuffer(void);                                 \
928     STDMETHODIMP_(ULONG) TransferCount(void);                             \
929     STDMETHODIMP_(ULONG) MaximumBufferSize(void);                         \
930     STDMETHODIMP_(ULONG) AllocatedBufferSize(void);                       \
931     STDMETHODIMP_(ULONG) BufferSize(void);                                \
932                                                                           \
933     STDMETHODIMP_(void) SetBufferSize(                                    \
934         IN  ULONG BufferSize);                                            \
935                                                                           \
936     STDMETHODIMP_(PVOID) SystemAddress(void);                             \
937     STDMETHODIMP_(PHYSICAL_ADDRESS) PhysicalAddress(                      \
938         IN  PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL);        \
939     STDMETHODIMP_(PADAPTER_OBJECT) GetAdapterObject(void);                \
940                                                                           \
941     STDMETHODIMP_(void) CopyTo(                                           \
942         IN  PVOID Destination,                                            \
943         IN  PVOID Source,                                                 \
944         IN  ULONG ByteCount);                                             \
945                                                                           \
946     STDMETHODIMP_(void) CopyFrom(                                         \
947         IN  PVOID Destination,                                            \
948         IN  PVOID Source,                                                 \
949         IN  ULONG ByteCount)
950 
951 
952 
953 #endif
954 
955 
956 #define IMP_IDmaChannelSlaveEx                 \
957     IMP_IDmaChannelEx;                         \
958     STDMETHODIMP_(NTSTATUS) Start(             \
959         IN  ULONG MapSize,                     \
960         IN  BOOLEAN WriteToDevice);            \
961                                                \
962     STDMETHODIMP_(NTSTATUS) Stop(void);        \
963     STDMETHODIMP_(ULONG) ReadCounter(void);    \
964                                                \
965     STDMETHODIMP_(NTSTATUS) WaitForTC(         \
966         ULONG Timeout)
967 
968 #define IMP_IDmaChannelInit\
969     IMP_IDmaChannelSlaveEx;\
970     STDMETHODIMP_(NTSTATUS) Init( \
971         IN  PDEVICE_DESCRIPTION DeviceDescription, \
972         IN  PDEVICE_OBJECT DeviceObject)
973 
974 #ifdef _MSC_VER
975 
976 #define DEFINE_ABSTRACT_DMACHANNEL_EX() \
977     STDMETHOD_(NTSTATUS, AllocateBuffer)( THIS_ \
978         IN  ULONG BufferSize, \
979         IN  PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL) PURE; \
980 \
981     STDMETHOD_(void, FreeBuffer)( THIS ) PURE; \
982     STDMETHOD_(ULONG, TransferCount)( THIS ) PURE; \
983     STDMETHOD_(ULONG, MaximumBufferSize)( THIS ) PURE; \
984     STDMETHOD_(ULONG, AllocatedBufferSize)( THIS ) PURE; \
985     STDMETHOD_(ULONG, BufferSize)( THIS ) PURE; \
986 \
987     STDMETHOD_(void, SetBufferSize)( THIS_ \
988         IN  ULONG BufferSize) PURE; \
989 \
990     STDMETHOD_(PVOID, SystemAddress)( THIS ) PURE; \
991     STDMETHOD_(PHYSICAL_ADDRESS, PhysicalAddress)( THIS) PURE;  \
992     STDMETHOD_(PADAPTER_OBJECT, GetAdapterObject)( THIS ) PURE; \
993 \
994     STDMETHOD_(void, CopyTo)( THIS_ \
995         IN  PVOID Destination, \
996         IN  PVOID Source, \
997         IN  ULONG ByteCount) PURE; \
998 \
999     STDMETHOD_(void, CopyFrom)( THIS_ \
1000         IN  PVOID Destination, \
1001         IN  PVOID Source, \
1002         IN  ULONG ByteCount) PURE;
1003 #else
1004 
1005 #define DEFINE_ABSTRACT_DMACHANNEL_EX() \
1006     STDMETHOD_(NTSTATUS, AllocateBuffer)( THIS_ \
1007         IN  ULONG BufferSize, \
1008         IN  PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL) PURE; \
1009 \
1010     STDMETHOD_(void, FreeBuffer)( THIS ) PURE; \
1011     STDMETHOD_(ULONG, TransferCount)( THIS ) PURE; \
1012     STDMETHOD_(ULONG, MaximumBufferSize)( THIS ) PURE; \
1013     STDMETHOD_(ULONG, AllocatedBufferSize)( THIS ) PURE; \
1014     STDMETHOD_(ULONG, BufferSize)( THIS ) PURE; \
1015 \
1016     STDMETHOD_(void, SetBufferSize)( THIS_ \
1017         IN  ULONG BufferSize) PURE; \
1018 \
1019     STDMETHOD_(PVOID, SystemAddress)( THIS ) PURE; \
1020     STDMETHOD_(PHYSICAL_ADDRESS, PhysicalAddress)( THIS_       \
1021         IN PPHYSICAL_ADDRESS Address) PURE; \
1022     STDMETHOD_(PADAPTER_OBJECT, GetAdapterObject)( THIS ) PURE; \
1023 \
1024     STDMETHOD_(void, CopyTo)( THIS_ \
1025         IN  PVOID Destination, \
1026         IN  PVOID Source, \
1027         IN  ULONG ByteCount) PURE; \
1028 \
1029     STDMETHOD_(void, CopyFrom)( THIS_ \
1030         IN  PVOID Destination, \
1031         IN  PVOID Source, \
1032         IN  ULONG ByteCount) PURE;
1033 
1034 #endif
1035 #undef INTERFACE
1036 #define INTERFACE IDmaChannelInit
1037 
1038 DECLARE_INTERFACE_(IDmaChannelInit, IUnknown)
1039 {
1040     DEFINE_ABSTRACT_UNKNOWN()
1041     DEFINE_ABSTRACT_DMACHANNEL_EX()
1042     DEFINE_ABSTRACT_DMACHANNELSLAVE()
1043 
1044     STDMETHOD_(NTSTATUS, Init)( THIS_
1045         IN PDEVICE_DESCRIPTION DeviceDescription,
1046         IN PDEVICE_OBJECT DeviceObject) PURE;
1047 };
1048 
1049 #undef INTERFACE
1050 
1051 /*****************************************************************************
1052  * IPortFilterTopology
1053  *****************************************************************************
1054  */
1055 
1056 #undef INTERFACE
1057 #define INTERFACE IPortFilterTopology
1058 
1059 DECLARE_INTERFACE_(IPortFilterTopology, IIrpTarget)
1060 {
1061     DEFINE_ABSTRACT_UNKNOWN()
1062 
1063     DEFINE_ABSTRACT_IRPTARGET()
1064 
1065     STDMETHOD_(NTSTATUS, Init)(THIS_
1066         IN PPORTTOPOLOGY Port)PURE;
1067 };
1068 
1069 typedef IPortFilterTopology *PPORTFILTERTOPOLOGY;
1070 
1071 #define IMP_IPortFilterTopology        \
1072     IMP_IIrpTarget;                    \
1073     STDMETHODIMP_(NTSTATUS) Init(THIS_ \
1074         IN PPORTTOPOLOGY Port)
1075 
1076 #undef INTERFACE
1077 
1078 /*****************************************************************************
1079  * IPortWaveRTStreamInit
1080  *****************************************************************************
1081  */
1082 
1083 #undef INTERFACE
1084 #define INTERFACE IPortWaveRTStreamInit
1085 
1086 
1087 DECLARE_INTERFACE_(IPortWaveRTStreamInit, IUnknown)
1088 {
1089     DEFINE_ABSTRACT_UNKNOWN()
1090 
1091     STDMETHOD_(PMDL, AllocatePagesForMdl)
1092     (   THIS_
1093         IN      PHYSICAL_ADDRESS    HighAddress,
1094         IN      SIZE_T              TotalBytes
1095     )   PURE;
1096 
1097     STDMETHOD_(PMDL, AllocateContiguousPagesForMdl)
1098     (   THIS_
1099         IN      PHYSICAL_ADDRESS    LowAddress,
1100         IN      PHYSICAL_ADDRESS    HighAddress,
1101         IN      SIZE_T              TotalBytes
1102     )   PURE;
1103 
1104     STDMETHOD_(PVOID, MapAllocatedPages)
1105     (   THIS_
1106         IN      PMDL                    MemoryDescriptorList,
1107         IN      MEMORY_CACHING_TYPE     CacheType
1108     )   PURE;
1109 
1110     STDMETHOD_(VOID, UnmapAllocatedPages)
1111     (   THIS_
1112         IN      PVOID   BaseAddress,
1113         IN      PMDL    MemoryDescriptorList
1114     )   PURE;
1115 
1116     STDMETHOD_(VOID, FreePagesFromMdl)
1117     (   THIS_
1118         IN      PMDL    MemoryDescriptorList
1119     )   PURE;
1120 
1121     STDMETHOD_(ULONG, GetPhysicalPagesCount)
1122     (   THIS_
1123         IN      PMDL    MemoryDescriptorList
1124     )   PURE;
1125 
1126     STDMETHOD_(PHYSICAL_ADDRESS, GetPhysicalPageAddress)
1127     (   THIS_
1128         IN      PPHYSICAL_ADDRESS Address,
1129         IN      PMDL              MemoryDescriptorList,
1130         IN      ULONG             Index
1131     )   PURE;
1132 };
1133 
1134 #undef INTERFACE
1135 
1136 #define IMP_IPortWaveRTStreamInit                                         \
1137     STDMETHODIMP_(PMDL) AllocatePagesForMdl                               \
1138     (   THIS_                                                             \
1139         IN      PHYSICAL_ADDRESS    HighAddress,                          \
1140         IN      SIZE_T              TotalBytes                            \
1141     );                                                                    \
1142                                                                           \
1143     STDMETHODIMP_(PMDL) AllocateContiguousPagesForMdl                     \
1144     (   THIS_                                                             \
1145         IN      PHYSICAL_ADDRESS    LowAddress,                           \
1146         IN      PHYSICAL_ADDRESS    HighAddress,                          \
1147         IN      SIZE_T              TotalBytes                            \
1148     );                                                                    \
1149                                                                           \
1150     STDMETHODIMP_(PVOID) MapAllocatedPages                                \
1151     (   THIS_                                                             \
1152         IN      PMDL                    MemoryDescriptorList,             \
1153         IN      MEMORY_CACHING_TYPE     CacheType                         \
1154     );                                                                    \
1155                                                                           \
1156     STDMETHODIMP_(VOID) UnmapAllocatedPages                               \
1157     (   THIS_                                                             \
1158         IN      PVOID   BaseAddress,                                      \
1159         IN      PMDL    MemoryDescriptorList                              \
1160     );                                                                    \
1161                                                                           \
1162     STDMETHODIMP_(VOID) FreePagesFromMdl                                  \
1163     (   THIS_                                                             \
1164         IN      PMDL    MemoryDescriptorList                              \
1165     );                                                                    \
1166                                                                           \
1167     STDMETHODIMP_(ULONG) GetPhysicalPagesCount                            \
1168     (   THIS_                                                             \
1169         IN      PMDL    MemoryDescriptorList                              \
1170     );                                                                    \
1171                                                                           \
1172     STDMETHODIMP_(PHYSICAL_ADDRESS) GetPhysicalPageAddress                \
1173     (   THIS_                                                             \
1174         IN      PPHYSICAL_ADDRESS Address,                                \
1175         IN      PMDL              MemoryDescriptorList,                   \
1176         IN      ULONG             Index                                   \
1177     )
1178 
1179 #ifndef IMP_IPortClsVersion
1180 
1181 #define IMP_IPortClsVersion \
1182     STDMETHODIMP_(DWORD) GetVersion(void);
1183 
1184 #endif
1185 
1186 #ifdef IMP_IPortWaveRT
1187 #define IMP_IPortWaveRT IMP_IPort
1188 #endif
1189 
1190 #endif
1191