ReactOS  0.4.14-dev-114-gc8cbd56
dmusicks.h
Go to the documentation of this file.
1 #ifndef _DMUSICKS_
2 #define _DMUSICKS_
3 
4 #include <dmusprop.h>
5 
6 #define DONT_HOLD_FOR_SEQUENCING 0x8000000000000000
7 
8 #ifndef REFERENCE_TIME
10 #endif
11 
12 typedef struct _DMUS_KERNEL_EVENT {
21  union {
22  BYTE abData[sizeof(PBYTE)];
25  } uData;
27 
28 typedef enum {
34 
35 DEFINE_GUID(CLSID_MiniportDriverDMusUART, 0xd3f0ce1c, 0xFFFC, 0x11D1, 0x81, 0xB0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xC1);
36 DEFINE_GUID(CLSID_MiniportDriverDMusUARTCapture, 0xD3F0CE1D, 0xFFFC, 0x11D1, 0x81, 0xB0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xC1);
37 
38 /* ===============================================================
39  IMasterClock Interface
40 */
41 
42 #undef INTERFACE
43 #define INTERFACE IMasterClock
44 
47 
50  ) PURE;
51 };
52 
53 typedef IMasterClock *PMASTERCLOCK;
54 
55 #define IMP_IMasterClock \
56  STDMETHODIMP_(NTSTATUS) GetTime( \
57  _Out_ REFERENCE_TIME *pTime \
58  )
59 
60 /* ===============================================================
61  IMXF Interface
62 */
63 
64 #undef INTERFACE
65 #define INTERFACE IMXF
66 
67 struct IMXF;
68 typedef struct IMXF *PMXF;
69 
70 #define DEFINE_ABSTRACT_IMXF() \
71  STDMETHOD_(NTSTATUS,SetState)(THIS_ \
72  _In_ KSSTATE State \
73  ) PURE; \
74  STDMETHOD_(NTSTATUS,PutMessage)(THIS_ \
75  _In_ PDMUS_KERNEL_EVENT pDMKEvt \
76  ) PURE; \
77  STDMETHOD_(NTSTATUS,ConnectOutput)(THIS_ \
78  _In_ PMXF sinkMXF \
79  ) PURE; \
80  STDMETHOD_(NTSTATUS,DisconnectOutput)(THIS_ \
81  _In_ PMXF sinkMXF \
82  ) PURE;
83 
84 #define IMP_IMXF \
85  STDMETHODIMP_(NTSTATUS) SetState ( \
86  _In_ KSSTATE State); \
87  STDMETHODIMP_(NTSTATUS) PutMessage (THIS_ \
88  _In_ PDMUS_KERNEL_EVENT pDMKEvt); \
89  STDMETHODIMP_(NTSTATUS) ConnectOutput (THIS_ \
90  _In_ PMXF sinkMXF); \
91  STDMETHODIMP_(NTSTATUS) DisconnectOutput (THIS_ \
92  _In_ PMXF sinkMXF)
93 
97 };
98 
99 /* ===============================================================
100  IAllocatorMXF Interface
101 */
102 
103 #undef INTERFACE
104 #define INTERFACE IAllocatorMXF
105 
106 struct IAllocatorMXF;
107 typedef struct IAllocatorMXF *PAllocatorMXF;
108 
109 #define STATIC_IID_IAllocatorMXF\
110  0xa5f0d62c, 0xb30f, 0x11d2, {0xb7, 0xa3, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1}
111 DEFINE_GUIDSTRUCT("a5f0d62c-b30f-11d2-b7a3-0060083316c1", IID_IAllocatorMXF);
112 #define IID_IAllocatorMXF DEFINE_GUIDNAMED(IID_IAllocatorMXF)
113 
114 
115 DECLARE_INTERFACE_(IAllocatorMXF, IMXF) {
117 
119 
121  _Out_ PDMUS_KERNEL_EVENT *ppDMKEvt
122  ) PURE;
123 
124  STDMETHOD_(USHORT,GetBufferSize)(THIS) PURE;
125 
126  STDMETHOD_(NTSTATUS,GetBuffer)(THIS_
127  _Outptr_result_bytebuffer_(_Inexpressible_(GetBufferSize bytes)) PBYTE *ppBuffer
128  )PURE;
129 
130  STDMETHOD_(NTSTATUS,PutBuffer)(THIS_
132  ) PURE;
133 };
134 
135 #define IMP_IAllocatorMXF \
136  IMP_IMXF; \
137  STDMETHODIMP_(NTSTATUS) GetMessage( \
138  _Out_ PDMUS_KERNEL_EVENT *ppDMKEvt); \
139  \
140  STDMETHODIMP_(USHORT) GetBufferSize(void); \
141  \
142  STDMETHODIMP_(NTSTATUS) GetBuffer( \
143  _Outptr_result_bytebuffer_(_Inexpressible_(GetBufferSize bytes)) \
144  PBYTE *ppBuffer); \
145  \
146  STDMETHODIMP_(NTSTATUS) PutBuffer( \
147  _In_ PBYTE pBuffer)
148 
149 #undef INTERFACE
150 #define INTERFACE IPortDMus
151 
152 DEFINE_GUID(IID_IPortDMus, 0xc096df9c, 0xfb09, 0x11d1, 0x81, 0xb0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1);
153 DEFINE_GUID(CLSID_PortDMus, 0xb7902fe9, 0xfb0a, 0x11d1, 0x81, 0xb0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1);
154 
155 DECLARE_INTERFACE_(IPortDMus, IPort) {
157 
159 
160  STDMETHOD_(void,Notify)(THIS_
161  _In_opt_ PSERVICEGROUP ServiceGroup
162  ) PURE;
163 
164  STDMETHOD_(void,RegisterServiceGroup)(THIS_
165  _In_ PSERVICEGROUP ServiceGroup
166  ) PURE;
167 };
168 typedef IPortDMus *PPORTDMUS;
169 
170 #define IMP_IPortDMus \
171  IMP_IPort; \
172  STDMETHODIMP_(void) Notify( \
173  _In_opt_ PSERVICEGROUP ServiceGroup); \
174  \
175  STDMETHODIMP_(void) RegisterServiceGroup( \
176  _In_ PSERVICEGROUP ServiceGroup)
177 
178 #undef INTERFACE
179 #define INTERFACE IMiniportDMus
180 
181 DEFINE_GUID(IID_IMiniportDMus, 0xc096df9d, 0xfb09, 0x11d1, 0x81, 0xb0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1);
182 
183 DECLARE_INTERFACE_(IMiniportDMus, IMiniport) {
185 
187 
189  _In_opt_ PUNKNOWN UnknownAdapter,
192  _Out_ PSERVICEGROUP *ServiceGroup
193  ) PURE;
194 
195  STDMETHOD_(void,Service)(THIS) PURE;
196 
197  STDMETHOD_(NTSTATUS,NewStream)(THIS_
198  _Out_ PMXF *MXF,
199  _In_opt_ PUNKNOWN OuterUnknown,
201  _In_ ULONG PinID,
202  _In_ DMUS_STREAM_TYPE StreamType,
204  _Out_ PSERVICEGROUP *ServiceGroup,
205  _In_ PAllocatorMXF AllocatorMXF,
207  _Out_ PULONGLONG SchedulePreFetch
208  ) PURE;
209 };
210 
211 typedef IMiniportDMus *PMINIPORTDMUS;
212 #undef INTERFACE
213 
214 #define IMP_IMiniportDMus \
215  IMP_IMiniport; \
216  STDMETHODIMP_(NTSTATUS) Init( \
217  _In_opt_ PUNKNOWN UnknownAdapter, \
218  _In_ PRESOURCELIST ResourceList, \
219  _In_ PPORTDMUS Port, \
220  _Out_ PSERVICEGROUP *ServiceGroup); \
221  \
222  STDMETHODIMP_(void) Service(THIS); \
223  \
224  STDMETHODIMP_(NTSTATUS) NewStream( \
225  _Out_ PMXF *MXF, \
226  _In_opt_ PUNKNOWN OuterUnknown, \
227  _In_ POOL_TYPE PoolType, \
228  _In_ ULONG PinID, \
229  _In_ DMUS_STREAM_TYPE StreamType, \
230  _In_ PKSDATAFORMAT DataFormat, \
231  _Out_ PSERVICEGROUP *ServiceGroup, \
232  _In_ PAllocatorMXF AllocatorMXF, \
233  _In_ PMASTERCLOCK MasterClock, \
234  _Out_ PULONGLONG SchedulePreFetch)
235 
236 
237 #define STATIC_KSAUDFNAME_DMUSIC_MPU_OUT\
238  0xA4DF0EB5, 0xBAC9, 0x11d2, {0xB7, 0xA8, 0x00, 0x60, 0x08, 0x33, 0x16, 0xC1}
239 DEFINE_GUIDSTRUCT("A4DF0EB5-BAC9-11d2-B7A8-0060083316C1", KSAUDFNAME_DMUSIC_MPU_OUT);
240 #define KSAUDFNAME_DMUSIC_MPU_OUT DEFINE_GUIDNAMED(KSAUDFNAME_DMUSIC_MPU_OUT)
241 
242 #define STATIC_KSAUDFNAME_DMUSIC_MPU_IN\
243  0xB2EC0A7D, 0xBAC9, 0x11d2, {0xB7, 0xA8, 0x00, 0x60, 0x08, 0x33, 0x16, 0xC1}
244 DEFINE_GUIDSTRUCT("B2EC0A7D-BAC9-11d2-B7A8-0060083316C1", KSAUDFNAME_DMUSIC_MPU_IN);
245 #define KSAUDFNAME_DMUSIC_MPU_IN DEFINE_GUIDNAMED(KSAUDFNAME_DMUSIC_MPU_IN)
246 
247 #define STATIC_IID_IMXF\
248  0xc096df9e, 0xfb09, 0x11d1, {0x81, 0xb0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1}
249 DEFINE_GUIDSTRUCT("c096df9e-fb09-11d1-81b0-0060083316c1", IID_IMXF);
250 #define IID_IMXF DEFINE_GUIDNAMED(IID_IMXF)
251 
252 #define DMUS_KEF_EVENT_COMPLETE 0x0000
253 #define DMUS_KEF_EVENT_INCOMPLETE 0x0001
254 #define DMUS_KEF_PACKAGE_EVENT 0x0002
255 #define kBytePositionNone (~(ULONGLONG)0)
256 
257 #define SHORT_EVT(evt) ((evt)->cbEvent <= sizeof(PBYTE))
258 #define PACKAGE_EVT(evt) ((evt)->usFlags & DMUS_KEF_PACKAGE_EVENT)
259 #define INCOMPLETE_EVT(evt) ((evt)->usFlags & DMUS_KEF_EVENT_INCOMPLETE)
260 #define COMPLETE_EVT(evt) (((evt)->usFlags & DMUS_KEF_EVENT_INCOMPLETE) == 0)
261 
262 #define SET_INCOMPLETE_EVT(evt) ((evt)->usFlags |= DMUS_KEF_EVENT_INCOMPLETE)
263 #define SET_COMPLETE_EVT(evt) ((evt)->usFlags &= (~DMUS_KEF_EVENT_INCOMPLETE))
264 #define SET_PACKAGE_EVT(evt) ((evt)->usFlags |= DMUS_KEF_PACKAGE_EVENT)
265 #define CLEAR_PACKAGE_EVT(evt) ((evt)->usFlags &= (~DMUS_KEF_PACKAGE_EVENT))
266 
267 #endif /* _DMUSICKS_ */
IServiceGroup * PSERVICEGROUP
Definition: portcls.h:614
BOOL WINAPI SHIM_OBJ_NAME() Notify(DWORD fdwReason, PVOID ptr)
#define KSAUDFNAME_DMUSIC_MPU_OUT
Definition: dmusicks.h:240
#define DEFINE_ABSTRACT_IMXF()
Definition: dmusicks.h:70
CPPORT Port[4]
Definition: headless.c:34
DEFINE_GUIDSTRUCT("a5f0d62c-b30f-11d2-b7a3-0060083316c1", IID_IAllocatorMXF)
#define DEFINE_ABSTRACT_UNKNOWN()
Definition: ksiface.h:5
#define THIS_
Definition: basetyps.h:65
#define DEFINE_ABSTRACT_MINIPORT()
Definition: portcls.h:1269
#define THIS
Definition: basetyps.h:66
#define IID_IAllocatorMXF
Definition: dmusicks.h:112
LONG NTSTATUS
Definition: precomp.h:26
struct _DMUS_KERNEL_EVENT * PDMUS_KERNEL_EVENT
IPortDMus * PPORTDMUS
Definition: dmusicks.h:167
#define IID_IMXF
Definition: dmusicks.h:250
const MUI_LANGUAGE_RESOURCE ResourceList[]
Definition: muilanguages.h:414
#define _In_opt_
Definition: no_sal2.h:213
struct _DMUS_KERNEL_EVENT * pNextEvt
Definition: dmusicks.h:20
IMasterClock * PMASTERCLOCK
Definition: dmusicks.h:51
ULONGLONG ullBytePosition
Definition: dmusicks.h:19
struct IAllocatorMXF * PAllocatorMXF
Definition: dmusicks.h:107
static unsigned char bytes[4]
Definition: adnsresfilter.c:74
BYTE abData[sizeof(PBYTE)]
Definition: dmusicks.h:22
_In_ PCCERT_CONTEXT _In_opt_ LPFILETIME pTime
Definition: wincrypt.h:4840
PVOID pBuffer
#define _Out_
Definition: no_sal2.h:323
REFERENCE_TIME ullPresTime100ns
Definition: dmusicks.h:18
int64_t LONGLONG
Definition: typedefs.h:66
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
INT POOL_TYPE
Definition: typedefs.h:76
uint64_t ULONGLONG
Definition: typedefs.h:65
DECLARE_INTERFACE_(IMasterClock, IUnknown)
Definition: dmusicks.h:45
unsigned char BYTE
Definition: mem.h:68
DEFINE_GUID(CLSID_MiniportDriverDMusUART, 0xd3f0ce1c, 0xFFFC, 0x11D1, 0x81, 0xB0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xC1)
USHORT usChannelGroup
Definition: dmusicks.h:16
IResourceList * PRESOURCELIST
Definition: portcls.h:442
#define _In_
Definition: no_sal2.h:204
unsigned short USHORT
Definition: pedump.c:61
IMiniportDMus * PMINIPORTDMUS
Definition: dmusicks.h:209
#define PURE
Definition: basetyps.h:64
#define GetMessage
Definition: winuser.h:5691
#define KSAUDFNAME_DMUSIC_MPU_IN
Definition: dmusicks.h:245
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
Definition: ntbasedef.h:390
#define _Outptr_result_bytebuffer_(size)
Definition: no_sal2.h:420
#define GetTime(fmt)
Definition: lcformat.c:97
unsigned int ULONG
Definition: retypes.h:1
union _DMUS_KERNEL_EVENT::@1855 uData
#define STDMETHOD_(t, m)
Definition: basetyps.h:63
struct IMXF * PMXF
Definition: dmusicks.h:68
struct _DMUS_KERNEL_EVENT DMUS_KERNEL_EVENT
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T _In_ POOL_TYPE PoolType
Definition: fltkernel.h:1444
static PHARDWARE_TIMER MasterClock
Definition: pit.c:28
struct _DMUS_KERNEL_EVENT * pPackageEvt
Definition: dmusicks.h:24
BYTE * PBYTE
Definition: pedump.c:66
DMUS_STREAM_TYPE
Definition: dmusicks.h:28
#define DEFINE_ABSTRACT_PORT()
Definition: portcls.h:1037