1 | #ifndef _DMUSICKS_
|
---|
2 | #define _DMUSICKS_
|
---|
3 |
|
---|
4 | #define DONT_HOLD_FOR_SEQUENCING 0x8000000000000000
|
---|
5 |
|
---|
6 | #ifndef REFERENCE_TIME
|
---|
7 | typedef LONGLONG REFERENCE_TIME;
|
---|
8 | #endif
|
---|
9 |
|
---|
10 | typedef struct _DMUS_KERNEL_EVENT {
|
---|
11 | BYTE bReserved;
|
---|
12 | BYTE cbStruct;
|
---|
13 | USHORT cbEvent;
|
---|
14 | USHORT usChannelGroup;
|
---|
15 | USHORT usFlags;
|
---|
16 | REFERENCE_TIME ullPresTime100ns;
|
---|
17 | ULONGLONG ullBytePosition;
|
---|
18 | struct _DMUS_KERNEL_EVENT *pNextEvt;
|
---|
19 | union {
|
---|
20 | BYTE abData[sizeof(PBYTE)];
|
---|
21 | PBYTE pbData;
|
---|
22 | struct _DMUS_KERNEL_EVENT *pPackageEvt;
|
---|
23 | } uData;
|
---|
24 | } DMUS_KERNEL_EVENT, *PDMUS_KERNEL_EVENT;
|
---|
25 |
|
---|
26 | typedef enum {
|
---|
27 | DMUS_STREAM_MIDI_INVALID = -1,
|
---|
28 | DMUS_STREAM_MIDI_RENDER = 0,
|
---|
29 | DMUS_STREAM_MIDI_CAPTURE,
|
---|
30 | DMUS_STREAM_WAVE_SINK
|
---|
31 | } DMUS_STREAM_TYPE;
|
---|
32 |
|
---|
33 | DEFINE_GUID(CLSID_MiniportDriverDMusUART, 0xd3f0ce1c, 0xFFFC, 0x11D1, 0x81, 0xB0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xC1);
|
---|
34 | DEFINE_GUID(CLSID_MiniportDriverDMusUARTCapture, 0xD3F0CE1D, 0xFFFC, 0x11D1, 0x81, 0xB0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xC1);
|
---|
35 |
|
---|
36 | /* ===============================================================
|
---|
37 | IMasterClock Interface
|
---|
38 | */
|
---|
39 |
|
---|
40 | #undef INTERFACE
|
---|
41 | #define INTERFACE IMasterClock
|
---|
42 |
|
---|
43 | DECLARE_INTERFACE_(IMasterClock,IUnknown)
|
---|
44 | {
|
---|
45 | DEFINE_ABSTRACT_UNKNOWN()
|
---|
46 |
|
---|
47 | STDMETHOD_(NTSTATUS,GetTime)( THIS_
|
---|
48 | OUT REFERENCE_TIME * pTime
|
---|
49 | ) PURE;
|
---|
50 | };
|
---|
51 |
|
---|
52 | typedef IMasterClock *PMASTERCLOCK;
|
---|
53 |
|
---|
54 | #define IMP_IMasterClock \
|
---|
55 | STDMETHODIMP_(NTSTATUS) GetTime( \
|
---|
56 | OUT REFERENCE_TIME * pTime \
|
---|
57 | )
|
---|
58 |
|
---|
59 | /* ===============================================================
|
---|
60 | IMXF Interface
|
---|
61 | */
|
---|
62 |
|
---|
63 | #undef INTERFACE
|
---|
64 | #define INTERFACE IMXF
|
---|
65 |
|
---|
66 | struct IMXF;
|
---|
67 | typedef struct IMXF *PMXF;
|
---|
68 |
|
---|
69 | #define DEFINE_ABSTRACT_IMXF() \
|
---|
70 | STDMETHOD_(NTSTATUS,SetState)(THIS_ \
|
---|
71 | IN KSSTATE State \
|
---|
72 | ) PURE; \
|
---|
73 | STDMETHOD_(NTSTATUS,PutMessage) \
|
---|
74 | ( THIS_ \
|
---|
75 | IN PDMUS_KERNEL_EVENT pDMKEvt \
|
---|
76 | ) PURE; \
|
---|
77 | STDMETHOD_(NTSTATUS,ConnectOutput) \
|
---|
78 | ( THIS_ \
|
---|
79 | IN PMXF sinkMXF \
|
---|
80 | ) PURE; \
|
---|
81 | STDMETHOD_(NTSTATUS,DisconnectOutput) \
|
---|
82 | ( THIS_ \
|
---|
83 | IN PMXF sinkMXF \
|
---|
84 | ) PURE;
|
---|
85 |
|
---|
86 | #define IMP_IMXF \
|
---|
87 | STDMETHODIMP_(NTSTATUS) SetState \
|
---|
88 | ( \
|
---|
89 | IN KSSTATE State \
|
---|
90 | ); \
|
---|
91 | STDMETHODIMP_(NTSTATUS) PutMessage \
|
---|
92 | ( THIS_ \
|
---|
93 | IN PDMUS_KERNEL_EVENT pDMKEvt \
|
---|
94 | ); \
|
---|
95 | STDMETHODIMP_(NTSTATUS) ConnectOutput \
|
---|
96 | ( THIS_ \
|
---|
97 | IN PMXF sinkMXF \
|
---|
98 | ); \
|
---|
99 | STDMETHODIMP_(NTSTATUS) DisconnectOutput \
|
---|
100 | ( THIS_ \
|
---|
101 | IN PMXF sinkMXF \
|
---|
102 | )
|
---|
103 |
|
---|
104 |
|
---|
105 | DECLARE_INTERFACE_(IMXF,IUnknown)
|
---|
106 | {
|
---|
107 | DEFINE_ABSTRACT_UNKNOWN()
|
---|
108 |
|
---|
109 | DEFINE_ABSTRACT_IMXF()
|
---|
110 | };
|
---|
111 |
|
---|
112 | /* ===============================================================
|
---|
113 | IAllocatorMXF Interface
|
---|
114 | */
|
---|
115 |
|
---|
116 | #undef INTERFACE
|
---|
117 | #define INTERFACE IAllocatorMXF
|
---|
118 |
|
---|
119 | struct IAllocatorMXF;
|
---|
120 | typedef struct IAllocatorMXF *PAllocatorMXF;
|
---|
121 |
|
---|
122 | #define STATIC_IID_IAllocatorMXF\
|
---|
123 | 0xa5f0d62c, 0xb30f, 0x11d2, 0xb7, 0xa3, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1
|
---|
124 | DEFINE_GUIDSTRUCT("a5f0d62c-b30f-11d2-b7a3-0060083316c1", IID_IAllocatorMXF);
|
---|
125 | #define IID_IAllocatorMXF DEFINE_GUIDNAMED(IID_IAllocatorMXF)
|
---|
126 |
|
---|
127 |
|
---|
128 | DECLARE_INTERFACE_(IAllocatorMXF, IMXF)
|
---|
129 | {
|
---|
130 | DEFINE_ABSTRACT_UNKNOWN()
|
---|
131 |
|
---|
132 | DEFINE_ABSTRACT_IMXF()
|
---|
133 |
|
---|
134 | STDMETHOD_(NTSTATUS,GetMessage)(THIS_
|
---|
135 | OUT PDMUS_KERNEL_EVENT * ppDMKEvt
|
---|
136 | ) PURE;
|
---|
137 |
|
---|
138 | STDMETHOD_(USHORT,GetBufferSize)(THIS) PURE;
|
---|
139 |
|
---|
140 | STDMETHOD_(NTSTATUS,GetBuffer)(THIS_
|
---|
141 | OUT PBYTE * ppBuffer
|
---|
142 | )PURE;
|
---|
143 |
|
---|
144 | STDMETHOD_(NTSTATUS,PutBuffer)(THIS_
|
---|
145 | IN PBYTE pBuffer
|
---|
146 | ) PURE;
|
---|
147 | };
|
---|
148 |
|
---|
149 | #define IMP_IAllocatorMXF \
|
---|
150 | IMP_IMXF; \
|
---|
151 | STDMETHODIMP_(NTSTATUS) GetMessage( \
|
---|
152 | OUT PDMUS_KERNEL_EVENT * ppDMKEvt \
|
---|
153 | ); \
|
---|
154 | \
|
---|
155 | STDMETHODIMP_(USHORT) GetBufferSize(void); \
|
---|
156 | \
|
---|
157 | STDMETHODIMP_(NTSTATUS) GetBuffer( \
|
---|
158 | OUT PBYTE * ppBuffer \
|
---|
159 | ); \
|
---|
160 | \
|
---|
161 | STDMETHODIMP_(NTSTATUS) PutBuffer( \
|
---|
162 | IN PBYTE pBuffer \
|
---|
163 | )
|
---|
164 |
|
---|
165 | #undef INTERFACE
|
---|
166 | #define INTERFACE IPortDMus
|
---|
167 |
|
---|
168 | DEFINE_GUID(IID_IPortDMus, 0xc096df9c, 0xfb09, 0x11d1, 0x81, 0xb0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1);
|
---|
169 | DEFINE_GUID(CLSID_PortDMus, 0xb7902fe9, 0xfb0a, 0x11d1, 0x81, 0xb0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1);
|
---|
170 |
|
---|
171 | DECLARE_INTERFACE_(IPortDMus, IPort)
|
---|
172 | {
|
---|
173 | DEFINE_ABSTRACT_UNKNOWN()
|
---|
174 |
|
---|
175 | DEFINE_ABSTRACT_PORT()
|
---|
176 |
|
---|
177 | STDMETHOD_(void,Notify)(THIS_
|
---|
178 | IN PSERVICEGROUP ServiceGroup OPTIONAL
|
---|
179 | )PURE;
|
---|
180 |
|
---|
181 | STDMETHOD_(void,RegisterServiceGroup)(THIS_
|
---|
182 | IN PSERVICEGROUP ServiceGroup
|
---|
183 | ) PURE;
|
---|
184 | };
|
---|
185 | typedef IPortDMus *PPORTDMUS;
|
---|
186 |
|
---|
187 | #define IMP_IPortDMus \
|
---|
188 | IMP_IPort; \
|
---|
189 | STDMETHODIMP_(void) Notify( \
|
---|
190 | IN PSERVICEGROUP ServiceGroup OPTIONAL \
|
---|
191 | ); \
|
---|
192 | \
|
---|
193 | STDMETHODIMP_(void) RegisterServiceGroup( \
|
---|
194 | IN PSERVICEGROUP ServiceGroup \
|
---|
195 | )
|
---|
196 |
|
---|
197 | #undef INTERFACE
|
---|
198 | #define INTERFACE IMiniportDMus
|
---|
199 |
|
---|
200 | DEFINE_GUID(IID_IMiniportDMus, 0xc096df9d, 0xfb09, 0x11d1, 0x81, 0xb0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1);
|
---|
201 | DECLARE_INTERFACE_(IMiniportDMus, IMiniport)
|
---|
202 | {
|
---|
203 | DEFINE_ABSTRACT_UNKNOWN()
|
---|
204 |
|
---|
205 | DEFINE_ABSTRACT_MINIPORT()
|
---|
206 |
|
---|
207 | STDMETHOD_(NTSTATUS,Init)(THIS_
|
---|
208 | IN PUNKNOWN UnknownAdapter,
|
---|
209 | IN PRESOURCELIST ResourceList,
|
---|
210 | IN PPORTDMUS Port,
|
---|
211 | OUT PSERVICEGROUP * ServiceGroup
|
---|
212 | ) PURE;
|
---|
213 |
|
---|
214 | STDMETHOD_(void,Service)(THIS) PURE;
|
---|
215 |
|
---|
216 | STDMETHOD_(NTSTATUS,NewStream)(THIS_
|
---|
217 | OUT PMXF * MXF,
|
---|
218 | IN PUNKNOWN OuterUnknown OPTIONAL,
|
---|
219 | IN POOL_TYPE PoolType,
|
---|
220 | IN ULONG PinID,
|
---|
221 | IN DMUS_STREAM_TYPE StreamType,
|
---|
222 | IN PKSDATAFORMAT DataFormat,
|
---|
223 | OUT PSERVICEGROUP * ServiceGroup,
|
---|
224 | IN PAllocatorMXF AllocatorMXF,
|
---|
225 | IN PMASTERCLOCK MasterClock,
|
---|
226 | OUT PULONGLONG SchedulePreFetch
|
---|
227 | ) PURE;
|
---|
228 | };
|
---|
229 |
|
---|
230 | typedef IMiniportDMus *PMINIPORTDMUS;
|
---|
231 | #undef INTERFACE
|
---|
232 |
|
---|
233 | #define IMP_IMiniportDMus \
|
---|
234 | IMP_IMiniport; \
|
---|
235 | STDMETHODIMP_(NTSTATUS) Init( \
|
---|
236 | IN PUNKNOWN UnknownAdapter, \
|
---|
237 | IN PRESOURCELIST ResourceList, \
|
---|
238 | IN PPORTDMUS Port, \
|
---|
239 | OUT PSERVICEGROUP * ServiceGroup \
|
---|
240 | ); \
|
---|
241 | \
|
---|
242 | STDMETHODIMP_(void) Service(THIS); \
|
---|
243 | \
|
---|
244 | STDMETHODIMP_(NTSTATUS) NewStream( \
|
---|
245 | OUT PMXF * MXF, \
|
---|
246 | IN PUNKNOWN OuterUnknown, \
|
---|
247 | IN POOL_TYPE PoolType, \
|
---|
248 | IN ULONG PinID, \
|
---|
249 | IN DMUS_STREAM_TYPE StreamType, \
|
---|
250 | IN PKSDATAFORMAT DataFormat, \
|
---|
251 | OUT PSERVICEGROUP * ServiceGroup, \
|
---|
252 | IN PAllocatorMXF AllocatorMXF, \
|
---|
253 | IN PMASTERCLOCK MasterClock, \
|
---|
254 | OUT PULONGLONG SchedulePreFetch \
|
---|
255 | )
|
---|
256 |
|
---|
257 | #endif /* _DMUSICKS_ */
|
---|
258 |
|
---|