ReactOS  0.4.14-dev-77-gd9e7c48
dmusic.c
Go to the documentation of this file.
1 /*
2  * IDirectMusic8 Implementation
3  *
4  * Copyright (C) 2003-2004 Rok Mandeljc
5  * Copyright (C) 2012 Christian Costa
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21 
22 #include <stdio.h>
23 
24 #include "dmusic_private.h"
25 
27 
28 static inline IDirectMusic8Impl *impl_from_IDirectMusic8(IDirectMusic8 *iface)
29 {
30  return CONTAINING_RECORD(iface, IDirectMusic8Impl, IDirectMusic8_iface);
31 }
32 
33 /* IDirectMusic8Impl IUnknown part: */
35 {
37 
38  TRACE("(%p)->(%s, %p)\n", iface, debugstr_dmguid(riid), ret_iface);
39 
40  if (IsEqualIID (riid, &IID_IUnknown) ||
41  IsEqualIID (riid, &IID_IDirectMusic) ||
42  IsEqualIID (riid, &IID_IDirectMusic2) ||
43  IsEqualIID (riid, &IID_IDirectMusic8))
44  {
45  IDirectMusic8_AddRef(iface);
46  *ret_iface = iface;
47  return S_OK;
48  }
49 
50  *ret_iface = NULL;
51 
52  WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ret_iface);
53 
54  return E_NOINTERFACE;
55 }
56 
58 {
61 
62  TRACE("(%p)->(): new ref = %u\n", This, ref);
63 
64  return ref;
65 }
66 
68 {
71 
72  TRACE("(%p)->(): new ref = %u\n", This, ref);
73 
74  if (!ref) {
75  IReferenceClock_Release(&This->master_clock->IReferenceClock_iface);
76  if (This->dsound)
77  IDirectSound_Release(This->dsound);
78  HeapFree(GetProcessHeap(), 0, This->system_ports);
79  HeapFree(GetProcessHeap(), 0, This->ports);
82  }
83 
84  return ref;
85 }
86 
87 /* IDirectMusic8Impl IDirectMusic part: */
89 {
91 
92  TRACE("(%p, %d, %p)\n", This, index, port_caps);
93 
94  if (!port_caps)
95  return E_POINTER;
96 
97  if (index >= This->num_system_ports)
98  return S_FALSE;
99 
100  *port_caps = This->system_ports[index].caps;
101 
102  return S_OK;
103 }
104 
106 {
108 
109  TRACE("(%p)->(%p, %p, %p)\n", This, buffer_desc, buffer, unkouter);
110 
111  if (unkouter)
112  return CLASS_E_NOAGGREGATION;
113 
114  if (!buffer_desc || !buffer)
115  return E_POINTER;
116 
117  return DMUSIC_CreateDirectMusicBufferImpl(buffer_desc, (LPVOID)buffer);
118 }
119 
121 {
123  int i;
124  DMUS_PORTCAPS port_caps;
125  IDirectMusicPort* new_port = NULL;
126  HRESULT hr;
127  GUID default_port;
128  const GUID *request_port = rclsid_port;
129 
130  TRACE("(%p)->(%s, %p, %p, %p)\n", This, debugstr_dmguid(rclsid_port), port_params, port, unkouter);
131 
132  if (!rclsid_port || !port)
133  return E_POINTER;
134  if (!port_params)
135  return E_INVALIDARG;
136  if (unkouter)
137  return CLASS_E_NOAGGREGATION;
138  if (!This->dsound)
139  return DMUS_E_DSOUND_NOT_SET;
140 
141  if (TRACE_ON(dmusic))
142  dump_DMUS_PORTPARAMS(port_params);
143 
144  ZeroMemory(&port_caps, sizeof(DMUS_PORTCAPS));
145  port_caps.dwSize = sizeof(DMUS_PORTCAPS);
146 
147  if (IsEqualGUID(request_port, &GUID_NULL)) {
148  hr = IDirectMusic8_GetDefaultPort(iface, &default_port);
149  if(FAILED(hr))
150  return hr;
151  request_port = &default_port;
152  }
153 
154  for (i = 0; S_FALSE != IDirectMusic8Impl_EnumPort(iface, i, &port_caps); i++) {
155  if (IsEqualCLSID(request_port, &port_caps.guidPort)) {
156  hr = This->system_ports[i].create(This, port_params, &port_caps, &new_port);
157  if (FAILED(hr)) {
158  *port = NULL;
159  return hr;
160  }
161  This->num_ports++;
162  if (!This->ports)
163  This->ports = HeapAlloc(GetProcessHeap(), 0,
164  sizeof(*This->ports) * This->num_ports);
165  else
166  This->ports = HeapReAlloc(GetProcessHeap(), 0, This->ports,
167  sizeof(*This->ports) * This->num_ports);
168  This->ports[This->num_ports - 1] = new_port;
169  *port = new_port;
170  return S_OK;
171  }
172  }
173 
174  return E_NOINTERFACE;
175 }
176 
177 void dmusic_remove_port(IDirectMusic8Impl *dmusic, IDirectMusicPort *port)
178 {
179  BOOL found = FALSE;
180  int i;
181 
182  TRACE("Removing port %p.\n", port);
183 
184  for (i = 0; i < dmusic->num_ports; i++)
185  {
186  if (dmusic->ports[i] == port) {
187  found = TRUE;
188  break;
189  }
190  }
191 
192  if (!found)
193  {
194  ERR("Port %p not found in ports array.\n", port);
195  return;
196  }
197 
198  if (!--dmusic->num_ports) {
199  HeapFree(GetProcessHeap(), 0, dmusic->ports);
200  dmusic->ports = NULL;
201  return;
202  }
203 
204  memmove(&dmusic->ports[i], &dmusic->ports[i + 1],
205  (dmusic->num_ports - i) * sizeof(*dmusic->ports));
206  dmusic->ports = HeapReAlloc(GetProcessHeap(), 0, dmusic->ports,
207  sizeof(*dmusic->ports) * dmusic->num_ports);
208 }
209 
211 {
212  TRACE("(%p)->(%d, %p)\n", iface, index, clock_info);
213 
214  if (!clock_info)
215  return E_POINTER;
216 
217  if (index > 1)
218  return S_FALSE;
219 
220  if (!index)
221  {
222  static const GUID guid_system_clock = { 0x58d58419, 0x71b4, 0x11d1, { 0xa7, 0x4c, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12 } };
223  static const WCHAR name_system_clock[] = { 'S','y','s','t','e','m',' ','C','l','o','c','k',0 };
224 
225  clock_info->ctType = 0;
226  clock_info->guidClock = guid_system_clock;
227  strcpyW(clock_info->wszDescription, name_system_clock);
228  }
229  else
230  {
231  static const GUID guid_dsound_clock = { 0x58d58420, 0x71b4, 0x11d1, { 0xa7, 0x4c, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12 } };
232  static const WCHAR name_dsound_clock[] = { 'D','i','r','e','c','t','S','o','u','n','d',' ','C','l','o','c','k',0 };
233 
234  clock_info->ctType = 0;
235  clock_info->guidClock = guid_dsound_clock;
236  strcpyW(clock_info->wszDescription, name_dsound_clock);
237  }
238 
239  return S_OK;
240 }
241 
243 {
245 
246  TRACE("(%p)->(%p, %p)\n", This, guid_clock, reference_clock);
247 
248  if (guid_clock)
249  *guid_clock = This->master_clock->pClockInfo.guidClock;
250  if (reference_clock) {
251  *reference_clock = &This->master_clock->IReferenceClock_iface;
252  IReferenceClock_AddRef(*reference_clock);
253  }
254 
255  return S_OK;
256 }
257 
259 {
261 
262  FIXME("(%p)->(%s): stub\n", This, debugstr_dmguid(rguidClock));
263 
264  return S_OK;
265 }
266 
268 {
270  int i;
271  HRESULT hr;
272 
273  TRACE("(%p)->(%u)\n", This, enable);
274 
275  for (i = 0; i < This->num_ports; i++)
276  {
278  if (FAILED(hr))
279  return hr;
280  }
281 
282  return S_OK;
283 }
284 
286 {
288  HKEY hkGUID;
289  DWORD returnTypeGUID, sizeOfReturnBuffer = 50;
290  char returnBuffer[51];
291  GUID defaultPortGUID;
292  WCHAR buff[51];
293 
294  TRACE("(%p)->(%p)\n", This, guid_port);
295 
296  if ((RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\DirectMusic\\Defaults" , 0, KEY_READ, &hkGUID) != ERROR_SUCCESS) ||
297  (RegQueryValueExA(hkGUID, "DefaultOutputPort", NULL, &returnTypeGUID, (LPBYTE)returnBuffer, &sizeOfReturnBuffer) != ERROR_SUCCESS))
298  {
299  WARN(": registry entry missing\n" );
300  *guid_port = CLSID_DirectMusicSynth;
301  return S_OK;
302  }
303  /* FIXME: Check return types to ensure we're interpreting data right */
304  MultiByteToWideChar(CP_ACP, 0, returnBuffer, -1, buff, ARRAY_SIZE(buff));
305  CLSIDFromString(buff, &defaultPortGUID);
306  *guid_port = defaultPortGUID;
307 
308  return S_OK;
309 }
310 
311 static HRESULT WINAPI IDirectMusic8Impl_SetDirectSound(IDirectMusic8 *iface, IDirectSound *dsound,
312  HWND hwnd)
313 {
315  HRESULT hr;
316  int i;
317 
318  TRACE("(%p)->(%p, %p)\n", This, dsound, hwnd);
319 
320  for (i = 0; i < This->num_ports; i++)
321  {
323  if (FAILED(hr))
324  return hr;
325  }
326 
327  if (This->dsound)
328  IDirectSound_Release(This->dsound);
329 
330  if (!dsound) {
331  hr = DirectSoundCreate8(NULL, (IDirectSound8 **)&This->dsound, NULL);
332  if (FAILED(hr))
333  return hr;
336  if (FAILED(hr)) {
337  IDirectSound_Release(This->dsound);
338  This->dsound = NULL;
339  }
340  return hr;
341  }
342 
343  IDirectSound_AddRef(dsound);
344  This->dsound = dsound;
345 
346  return S_OK;
347 }
348 
350 {
352 
353  FIXME("(%p)->(%p): stub\n", This, clock);
354 
355  return S_OK;
356 }
357 
358 static const IDirectMusic8Vtbl DirectMusic8_Vtbl = {
372 };
373 
375 {
376  static const WCHAR emulated[] = {' ','[','E','m','u','l','a','t','e','d',']',0};
377  port_info * port;
378  ULONG nb_ports;
379  ULONG nb_midi_out;
380  ULONG nb_midi_in;
381  MIDIOUTCAPSW caps_out;
382  MIDIINCAPSW caps_in;
383  IDirectMusicSynth8* synth;
384  HRESULT hr;
385  ULONG i;
386 
387  TRACE("(%p)\n", object);
388 
389  /* NOTE:
390  - it seems some native versions get the rest of devices through dmusic32.EnumLegacyDevices...*sigh*...which is undocumented
391  - should we enum wave devices ? Native does not seem to
392  */
393 
394  nb_midi_out = midiOutGetNumDevs();
395  nb_midi_in = midiInGetNumDevs();
396  nb_ports = 1 /* midi mapper */ + nb_midi_out + nb_midi_in + 1 /* synth port */;
397 
398  port = object->system_ports = HeapAlloc(GetProcessHeap(), 0, nb_ports * sizeof(port_info));
399  if (!object->system_ports)
400  return;
401 
402  /* Fill common port caps for all winmm ports */
403  for (i = 0; i < (nb_ports - 1 /* synth port*/); i++)
404  {
405  object->system_ports[i].caps.dwSize = sizeof(DMUS_PORTCAPS);
406  object->system_ports[i].caps.dwType = DMUS_PORT_WINMM_DRIVER;
407  object->system_ports[i].caps.dwMemorySize = 0;
408  object->system_ports[i].caps.dwMaxChannelGroups = 1;
409  object->system_ports[i].caps.dwMaxVoices = 0;
410  object->system_ports[i].caps.dwMaxAudioChannels = 0;
411  object->system_ports[i].caps.dwEffectFlags = DMUS_EFFECT_NONE;
412  /* Fake port GUID */
413  object->system_ports[i].caps.guidPort = IID_IUnknown;
414  object->system_ports[i].caps.guidPort.Data1 = i + 1;
415  }
416 
417  /* Fill midi mapper port info */
418  port->device = MIDI_MAPPER;
419  port->create = midi_out_port_create;
420  midiOutGetDevCapsW(MIDI_MAPPER, &caps_out, sizeof(caps_out));
421  strcpyW(port->caps.wszDescription, caps_out.szPname);
422  strcatW(port->caps.wszDescription, emulated);
423  port->caps.dwFlags = DMUS_PC_SHAREABLE;
424  port->caps.dwClass = DMUS_PC_OUTPUTCLASS;
425  port++;
426 
427  /* Fill midi out port info */
428  for (i = 0; i < nb_midi_out; i++)
429  {
430  port->device = i;
431  port->create = midi_out_port_create;
432  midiOutGetDevCapsW(i, &caps_out, sizeof(caps_out));
433  strcpyW(port->caps.wszDescription, caps_out.szPname);
434  strcatW(port->caps.wszDescription, emulated);
435  port->caps.dwFlags = DMUS_PC_SHAREABLE | DMUS_PC_EXTERNAL;
436  port->caps.dwClass = DMUS_PC_OUTPUTCLASS;
437  port++;
438  }
439 
440  /* Fill midi in port info */
441  for (i = 0; i < nb_midi_in; i++)
442  {
443  port->device = i;
444  port->create = midi_in_port_create;
445  midiInGetDevCapsW(i, &caps_in, sizeof(caps_in));
446  strcpyW(port->caps.wszDescription, caps_in.szPname);
447  strcatW(port->caps.wszDescription, emulated);
448  port->caps.dwFlags = DMUS_PC_EXTERNAL;
449  port->caps.dwClass = DMUS_PC_INPUTCLASS;
450  port++;
451  }
452 
453  /* Fill synth port info */
454  port->create = synth_port_create;
455  hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynth8, (void**)&synth);
456  if (SUCCEEDED(hr))
457  {
458  port->caps.dwSize = sizeof(port->caps);
459  hr = IDirectMusicSynth8_GetPortCaps(synth, &port->caps);
461  }
462  if (FAILED(hr))
463  nb_ports--;
464 
465  object->num_system_ports = nb_ports;
466 }
467 
468 /* For ClassFactory */
470 {
471  IDirectMusic8Impl *dmusic;
472  HRESULT ret;
473 
474  TRACE("(%s, %p, %p)\n", debugstr_guid(riid), ret_iface, unkouter);
475 
476  *ret_iface = NULL;
477  if (unkouter)
478  return CLASS_E_NOAGGREGATION;
479 
481  if (!dmusic)
482  return E_OUTOFMEMORY;
483 
484  dmusic->IDirectMusic8_iface.lpVtbl = &DirectMusic8_Vtbl;
485  dmusic->ref = 1;
486  ret = DMUSIC_CreateReferenceClockImpl(&IID_IReferenceClock, (void **)&dmusic->master_clock, NULL);
487  if (FAILED(ret)) {
488  HeapFree(GetProcessHeap(), 0, dmusic);
489  return ret;
490  }
491 
492  create_system_ports_list(dmusic);
493 
497 
498  return ret;
499 }
static HRESULT WINAPI IDirectMusic8Impl_EnumMasterClock(LPDIRECTMUSIC8 iface, DWORD index, LPDMUS_CLOCKINFO clock_info)
Definition: dmusic.c:210
static HRESULT WINAPI IDirectMusic8Impl_SetMasterClock(LPDIRECTMUSIC8 iface, REFGUID rguidClock)
Definition: dmusic.c:258
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4023
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define DMUS_PC_OUTPUTCLASS
Definition: dmusicc.h:181
#define REFIID
Definition: guiddef.h:118
#define TRUE
Definition: types.h:120
HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID, LPDIRECTSOUND8 *ppDS, IUnknown *pUnkOuter)
Definition: directsound.c:504
#define E_NOINTERFACE
Definition: winerror.h:2364
#define IDirectMusic8_AddRef(p)
Definition: dmusicc.h:440
#define ERROR_SUCCESS
Definition: deptool.c:10
static HRESULT WINAPI IDirectMusic8Impl_QueryInterface(LPDIRECTMUSIC8 iface, REFIID riid, LPVOID *ret_iface)
Definition: dmusic.c:34
HRESULT hr
Definition: shlfolder.c:183
Definition: scsiwmi.h:51
static HRESULT WINAPI IDirectMusic8Impl_GetMasterClock(LPDIRECTMUSIC8 iface, LPGUID guid_clock, IReferenceClock **reference_clock)
Definition: dmusic.c:242
void dmusic_remove_port(IDirectMusic8Impl *dmusic, IDirectMusicPort *port)
Definition: dmusic.c:177
#define MIDI_MAPPER
Definition: mmsystem.h:253
const char * debugstr_dmguid(const GUID *id)
Definition: dmusic_main.c:237
static HRESULT WINAPI IDirectMusic8Impl_SetDirectSound(IDirectMusic8 *iface, IDirectSound *dsound, HWND hwnd)
Definition: dmusic.c:311
#define KEY_READ
Definition: nt_native.h:1023
#define DMUS_PC_INPUTCLASS
Definition: dmusicc.h:180
REFIID riid
Definition: precomp.h:44
#define REFCLSID
Definition: guiddef.h:117
#define CP_ACP
Definition: compat.h:99
#define WARN(fmt,...)
Definition: debug.h:111
HRESULT DMUSIC_CreateDirectMusicBufferImpl(LPDMUS_BUFFERDESC desc, LPVOID *ret_iface)
Definition: buffer.c:294
struct IDirectMusicBuffer * LPDIRECTMUSICBUFFER
Definition: dmusicc.h:97
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3331
#define ZeroMemory
Definition: winbase.h:1635
GLuint buffer
Definition: glext.h:5915
DWORD dwSize
Definition: dmusicc.h:289
struct IDirectMusic8 * LPDIRECTMUSIC8
Definition: dmusicc.h:96
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1146
#define DMUS_E_DSOUND_NOT_SET
Definition: dmerror.h:94
#define IDirectMusic8_Release(p)
Definition: dmusicc.h:441
Definition: send.c:47
void dump_DMUS_PORTPARAMS(LPDMUS_PORTPARAMS params)
Definition: dmusic_main.c:491
#define IDirectMusicPort_SetDirectSound(p, a, b)
Definition: dmusicc.h:696
static HRESULT WINAPI IDirectMusic8Impl_SetExternalMasterClock(LPDIRECTMUSIC8 iface, IReferenceClock *clock)
Definition: dmusic.c:349
static void DMUSIC_UnlockModule(void)
HRESULT synth_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN
Definition: port.c:814
GUID guidPort
Definition: dmusicc.h:291
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
DMUS_CLOCKTYPE ctType
Definition: dmusicc.h:364
#define IDirectMusicSynth8_GetPortCaps(p, a)
Definition: dmusics.h:180
unsigned char * LPBYTE
Definition: typedefs.h:52
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
unsigned int BOOL
Definition: ntddk_ex.h:94
#define DMUS_PC_EXTERNAL
Definition: dmusicc.h:184
static LPUNKNOWN
Definition: ndr_ole.c:49
GLenum GLint ref
Definition: glext.h:6028
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_FALSE
Definition: winerror.h:2357
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static void DMUSIC_LockModule(void)
GLuint index
Definition: glext.h:6031
#define debugstr_guid
Definition: kernel32.h:35
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static HRESULT WINAPI IDirectMusic8Impl_CreatePort(LPDIRECTMUSIC8 iface, REFCLSID rclsid_port, LPDMUS_PORTPARAMS port_params, LPDIRECTMUSICPORT *port, LPUNKNOWN unkouter)
Definition: dmusic.c:120
#define IDirectMusicSynth8_Release(p)
Definition: dmusics.h:171
struct _DMUS_PORTCAPS DMUS_PORTCAPS
Definition: dmusicc.h:268
static HRESULT WINAPI IDirectMusic8Impl_GetDefaultPort(LPDIRECTMUSIC8 iface, LPGUID guid_port)
Definition: dmusic.c:285
static ULONG WINAPI IDirectMusic8Impl_AddRef(LPDIRECTMUSIC8 iface)
Definition: dmusic.c:57
#define DMUS_PORT_WINMM_DRIVER
Definition: dmusicc.h:197
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1126
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
UINT WINAPI midiInGetDevCapsW(UINT_PTR uDeviceID, LPMIDIINCAPSW lpCaps, UINT uSize)
Definition: winmm.c:1195
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:8
unsigned long DWORD
Definition: ntddk_ex.h:95
static ULONG WINAPI IDirectMusic8Impl_Release(LPDIRECTMUSIC8 iface)
Definition: dmusic.c:67
int ret
#define DMUS_EFFECT_NONE
Definition: dmusicc.h:172
#define index(s, c)
Definition: various.h:29
HRESULT WINAPI DMUSIC_CreateDirectMusicImpl(LPCGUID riid, LPVOID *ret_iface, LPUNKNOWN unkouter)
Definition: dmusic.c:469
#define InterlockedDecrement
Definition: armddk.h:52
#define GUID_NULL
Definition: ks.h:106
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define IDirectSound_SetCooperativeLevel(p, a, b)
Definition: dsound.h:458
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define ERR(fmt,...)
Definition: debug.h:109
WCHAR wszDescription[DMUS_MAX_DESCRIPTION]
Definition: dmusicc.h:366
HRESULT midi_out_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN
Definition: port.c:1201
#define S_OK
Definition: intsafe.h:59
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
GLboolean enable
Definition: glext.h:11120
#define DMUS_PC_SHAREABLE
Definition: dmusicc.h:191
#define InterlockedIncrement
Definition: armddk.h:53
#define IDirectSound_Release(p)
Definition: dsound.h:453
#define IReferenceClock_Release(p)
Definition: dmusicc.h:752
static IDirectMusic8Impl * impl_from_IDirectMusic8(IDirectMusic8 *iface)
Definition: dmusic.c:28
#define ARRAY_SIZE(a)
Definition: main.h:24
IDirectMusicPort ** ports
static const IDirectMusic8Vtbl DirectMusic8_Vtbl
Definition: dmusic.c:358
#define HeapReAlloc
Definition: compat.h:393
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
UINT WINAPI midiOutGetDevCapsW(UINT_PTR uDeviceID, LPMIDIOUTCAPSW lpCaps, UINT uSize)
Definition: winmm.c:817
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
_Check_return_ _CRTIMP clock_t __cdecl clock(void)
Definition: clock.c:23
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
static HRESULT WINAPI IDirectMusic8Impl_Activate(LPDIRECTMUSIC8 iface, BOOL enable)
Definition: dmusic.c:267
struct IDirectMusicPort * LPDIRECTMUSICPORT
Definition: dmusicc.h:109
#define MultiByteToWideChar
Definition: compat.h:100
static HRESULT WINAPI IDirectMusic8Impl_CreateMusicBuffer(LPDIRECTMUSIC8 iface, LPDMUS_BUFFERDESC buffer_desc, LPDIRECTMUSICBUFFER *buffer, LPUNKNOWN unkouter)
Definition: dmusic.c:105
#define IDirectMusicPort_Activate(p, a)
Definition: dmusicc.h:693
UINT WINAPI midiInGetNumDevs(void)
Definition: winmm.c:1187
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2247
unsigned int ULONG
Definition: retypes.h:1
#define IReferenceClock_AddRef(p)
Definition: dmusicc.h:751
IDirectMusic8 IDirectMusic8_iface
WINE_DEFAULT_DEBUG_CHANNEL(dmusic)
static HRESULT WINAPI IDirectMusic8Impl_EnumPort(LPDIRECTMUSIC8 iface, DWORD index, LPDMUS_PORTCAPS port_caps)
Definition: dmusic.c:88
#define IDirectSound_AddRef(p)
Definition: dsound.h:452
IReferenceClockImpl * master_clock
#define E_POINTER
Definition: winerror.h:2365
USHORT port
Definition: uri.c:227
#define DSSCL_PRIORITY
Definition: dsound.h:248
#define IDirectMusic8_GetDefaultPort(p, a)
Definition: dmusicc.h:450
#define TRACE_ON(x)
Definition: compat.h:65
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
static unsigned char buff[32768]
Definition: fatten.c:17
UINT WINAPI midiOutGetNumDevs(void)
Definition: winmm.c:809
#define HeapFree(x, y, z)
Definition: compat.h:394
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static void create_system_ports_list(IDirectMusic8Impl *object)
Definition: dmusic.c:374
HRESULT DMUSIC_CreateReferenceClockImpl(LPCGUID riid, LPVOID *ret_iface, LPUNKNOWN unkouter)
Definition: clock.c:121
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
HRESULT midi_in_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN
Definition: port.c:1209