2002-06-13 19:15:06 +00:00
|
|
|
/* DirectSound
|
|
|
|
*
|
|
|
|
* Copyright 1998 Marcus Meissner
|
|
|
|
* Copyright 1998 Rob Riggs
|
|
|
|
* Copyright 2000-2002 TransGaming Technologies, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-06-13 19:15:06 +00:00
|
|
|
*/
|
|
|
|
|
2007-04-29 16:45:44 +00:00
|
|
|
#define COBJMACROS
|
2003-09-05 23:08:26 +00:00
|
|
|
#include <stdarg.h>
|
2002-06-13 19:15:06 +00:00
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
2005-10-17 09:24:50 +00:00
|
|
|
#include "winuser.h"
|
2002-06-13 19:15:06 +00:00
|
|
|
#include "mmsystem.h"
|
2002-09-12 22:07:02 +00:00
|
|
|
#include "winternl.h"
|
2003-04-29 22:49:52 +00:00
|
|
|
#include "winnls.h"
|
2005-01-28 17:21:07 +00:00
|
|
|
#include "vfwmsgs.h"
|
2002-06-13 19:15:06 +00:00
|
|
|
#include "mmddk.h"
|
|
|
|
#include "wine/debug.h"
|
|
|
|
#include "dsound.h"
|
|
|
|
#include "dsdriver.h"
|
|
|
|
#include "dsound_private.h"
|
2004-07-22 19:40:44 +00:00
|
|
|
#include "dsconf.h"
|
2002-06-13 19:15:06 +00:00
|
|
|
|
2005-01-28 17:21:07 +00:00
|
|
|
#ifdef NONAMELESSSTRUCT
|
|
|
|
# define S(x) (x).s
|
|
|
|
#else
|
|
|
|
# define S(x) (x)
|
|
|
|
#endif
|
|
|
|
|
2002-06-13 19:15:06 +00:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(dsound);
|
|
|
|
|
2003-08-20 18:18:23 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
* IKsPrivatePropertySet
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* IUnknown methods */
|
|
|
|
static HRESULT WINAPI IKsPrivatePropertySetImpl_QueryInterface(
|
|
|
|
LPKSPROPERTYSET iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPVOID *ppobj )
|
|
|
|
{
|
2004-09-09 20:17:07 +00:00
|
|
|
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface;
|
2003-08-20 18:18:23 +00:00
|
|
|
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
|
|
|
|
|
2007-04-29 16:45:44 +00:00
|
|
|
if (IsEqualIID(riid, &IID_IUnknown) ||
|
|
|
|
IsEqualIID(riid, &IID_IKsPropertySet)) {
|
|
|
|
*ppobj = iface;
|
|
|
|
IUnknown_AddRef(iface);
|
|
|
|
return S_OK;
|
|
|
|
}
|
2003-08-20 18:18:23 +00:00
|
|
|
*ppobj = NULL;
|
2007-04-29 16:45:44 +00:00
|
|
|
return E_NOINTERFACE;
|
2003-08-20 18:18:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI IKsPrivatePropertySetImpl_AddRef(LPKSPROPERTYSET iface)
|
|
|
|
{
|
2004-09-09 20:17:07 +00:00
|
|
|
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface;
|
2005-02-11 11:49:05 +00:00
|
|
|
ULONG ref = InterlockedIncrement(&(This->ref));
|
2006-11-12 13:40:35 +00:00
|
|
|
TRACE("(%p) ref was %d\n", This, ref - 1);
|
2005-02-11 11:49:05 +00:00
|
|
|
return ref;
|
2002-06-13 19:15:06 +00:00
|
|
|
}
|
|
|
|
|
2003-08-20 18:18:23 +00:00
|
|
|
static ULONG WINAPI IKsPrivatePropertySetImpl_Release(LPKSPROPERTYSET iface)
|
|
|
|
{
|
2004-09-09 20:17:07 +00:00
|
|
|
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface;
|
2005-02-11 11:49:05 +00:00
|
|
|
ULONG ref = InterlockedDecrement(&(This->ref));
|
2006-11-12 13:40:35 +00:00
|
|
|
TRACE("(%p) ref was %d\n", This, ref + 1);
|
2002-06-13 19:15:06 +00:00
|
|
|
|
2005-02-11 11:49:05 +00:00
|
|
|
if (!ref) {
|
|
|
|
HeapFree(GetProcessHeap(), 0, This);
|
|
|
|
TRACE("(%p) released\n", This);
|
2004-09-16 19:08:04 +00:00
|
|
|
}
|
2005-02-11 11:49:05 +00:00
|
|
|
return ref;
|
2002-06-13 19:15:06 +00:00
|
|
|
}
|
|
|
|
|
2009-12-09 15:57:58 +00:00
|
|
|
static HRESULT DSPROPERTY_WaveDeviceMappingW(
|
2004-07-13 23:35:09 +00:00
|
|
|
LPVOID pPropData,
|
2003-04-29 22:49:52 +00:00
|
|
|
ULONG cbPropData,
|
|
|
|
PULONG pcbReturned )
|
|
|
|
{
|
2005-04-13 14:39:49 +00:00
|
|
|
HRESULT hr = DSERR_INVALIDPARAM;
|
2009-12-09 15:57:58 +00:00
|
|
|
PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA ppd;
|
2006-11-12 13:40:35 +00:00
|
|
|
TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
|
2006-08-22 11:36:08 +00:00
|
|
|
pPropData,cbPropData,pcbReturned);
|
2003-04-29 22:49:52 +00:00
|
|
|
|
2009-01-10 23:15:53 +00:00
|
|
|
ppd = pPropData;
|
2003-04-29 22:49:52 +00:00
|
|
|
|
|
|
|
if (!ppd) {
|
|
|
|
WARN("invalid parameter: pPropData\n");
|
|
|
|
return DSERR_INVALIDPARAM;
|
|
|
|
}
|
|
|
|
|
2005-04-13 14:39:49 +00:00
|
|
|
if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER) {
|
|
|
|
ULONG wod;
|
|
|
|
unsigned int wodn;
|
|
|
|
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n");
|
|
|
|
wodn = waveOutGetNumDevs();
|
|
|
|
for (wod = 0; wod < wodn; wod++) {
|
2009-12-09 15:57:58 +00:00
|
|
|
WAVEOUTCAPSW capsW;
|
2005-04-13 14:39:49 +00:00
|
|
|
MMRESULT res;
|
2009-12-09 15:57:58 +00:00
|
|
|
res = waveOutGetDevCapsW(wod, &capsW, sizeof(capsW));
|
2005-04-13 14:39:49 +00:00
|
|
|
if (res == MMSYSERR_NOERROR) {
|
2009-12-09 15:57:58 +00:00
|
|
|
if (lstrcmpW(capsW.szPname, ppd->DeviceName) == 0) {
|
2005-04-13 14:39:49 +00:00
|
|
|
ppd->DeviceId = DSOUND_renderer_guids[wod];
|
|
|
|
hr = DS_OK;
|
|
|
|
TRACE("found %s for %s\n", debugstr_guid(&ppd->DeviceId),
|
2009-12-09 15:57:58 +00:00
|
|
|
debugstr_w(ppd->DeviceName));
|
2005-04-13 14:39:49 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE) {
|
|
|
|
ULONG wid;
|
|
|
|
unsigned int widn;
|
|
|
|
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n");
|
|
|
|
widn = waveInGetNumDevs();
|
|
|
|
for (wid = 0; wid < widn; wid++) {
|
2009-12-09 15:57:58 +00:00
|
|
|
WAVEINCAPSW capsW;
|
2005-04-13 14:39:49 +00:00
|
|
|
MMRESULT res;
|
2009-12-09 15:57:58 +00:00
|
|
|
res = waveInGetDevCapsW(wid, &capsW, sizeof(capsW));
|
2005-04-13 14:39:49 +00:00
|
|
|
if (res == MMSYSERR_NOERROR) {
|
2009-12-09 15:57:58 +00:00
|
|
|
if (lstrcmpW(capsW.szPname, ppd->DeviceName) == 0) {
|
2005-04-13 14:39:49 +00:00
|
|
|
ppd->DeviceId = DSOUND_capture_guids[wid];
|
|
|
|
hr = DS_OK;
|
2009-12-09 15:57:58 +00:00
|
|
|
TRACE("found %s for %s\n", debugstr_guid(&ppd->DeviceId),
|
|
|
|
debugstr_w(ppd->DeviceName));
|
2005-04-13 14:39:49 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-04-29 22:49:52 +00:00
|
|
|
|
2005-04-13 14:39:49 +00:00
|
|
|
if (pcbReturned)
|
2009-12-09 15:57:58 +00:00
|
|
|
*pcbReturned = cbPropData;
|
2003-04-29 22:49:52 +00:00
|
|
|
|
2005-04-13 14:39:49 +00:00
|
|
|
return hr;
|
2003-04-29 22:49:52 +00:00
|
|
|
}
|
|
|
|
|
2009-12-09 15:57:58 +00:00
|
|
|
static HRESULT DSPROPERTY_WaveDeviceMappingA(
|
2004-07-13 23:35:09 +00:00
|
|
|
LPVOID pPropData,
|
2003-04-29 22:49:52 +00:00
|
|
|
ULONG cbPropData,
|
|
|
|
PULONG pcbReturned )
|
|
|
|
{
|
2009-12-09 15:57:58 +00:00
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA *ppd = pPropData;
|
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA data;
|
|
|
|
DWORD len;
|
|
|
|
HRESULT hr;
|
2003-04-29 22:49:52 +00:00
|
|
|
|
2009-12-09 15:57:58 +00:00
|
|
|
TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
|
|
|
|
pPropData,cbPropData,pcbReturned);
|
2003-04-29 22:49:52 +00:00
|
|
|
|
2009-12-09 15:57:58 +00:00
|
|
|
if (!ppd || !ppd->DeviceName) {
|
|
|
|
WARN("invalid parameter: ppd=%p\n", ppd);
|
|
|
|
return DSERR_INVALIDPARAM;
|
2003-04-29 22:49:52 +00:00
|
|
|
}
|
|
|
|
|
2009-12-09 15:57:58 +00:00
|
|
|
data.DataFlow = ppd->DataFlow;
|
|
|
|
len = MultiByteToWideChar(CP_ACP, 0, ppd->DeviceName, -1, NULL, 0);
|
|
|
|
data.DeviceName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
|
|
|
if (!data.DeviceName)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, ppd->DeviceName, -1, data.DeviceName, len);
|
|
|
|
|
|
|
|
hr = DSPROPERTY_WaveDeviceMappingW(&data, cbPropData, pcbReturned);
|
|
|
|
HeapFree(GetProcessHeap(), 0, data.DeviceName);
|
|
|
|
ppd->DeviceId = data.DeviceId;
|
2003-04-29 22:49:52 +00:00
|
|
|
|
2005-04-13 14:39:49 +00:00
|
|
|
if (pcbReturned)
|
|
|
|
*pcbReturned = cbPropData;
|
|
|
|
|
|
|
|
return hr;
|
2003-04-29 22:49:52 +00:00
|
|
|
}
|
|
|
|
|
2008-11-28 14:20:03 +00:00
|
|
|
static HRESULT DSPROPERTY_Description1(
|
2003-04-29 22:49:52 +00:00
|
|
|
LPVOID pPropData,
|
|
|
|
ULONG cbPropData,
|
|
|
|
PULONG pcbReturned )
|
|
|
|
{
|
|
|
|
HRESULT err;
|
2009-03-17 14:20:05 +00:00
|
|
|
GUID dev_guid;
|
2003-04-29 22:49:52 +00:00
|
|
|
PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA ppd;
|
2006-11-12 13:40:35 +00:00
|
|
|
TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
|
2006-08-22 11:36:08 +00:00
|
|
|
pPropData,cbPropData,pcbReturned);
|
2003-04-29 22:49:52 +00:00
|
|
|
|
|
|
|
ppd = (PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA) pPropData;
|
|
|
|
|
|
|
|
if (!ppd) {
|
|
|
|
WARN("invalid parameter: pPropData\n");
|
|
|
|
return DSERR_INVALIDPARAM;
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("DeviceId=%s\n",debugstr_guid(&ppd->DeviceId));
|
|
|
|
if ( IsEqualGUID( &ppd->DeviceId , &GUID_NULL) ) {
|
|
|
|
/* default device of type specified by ppd->DataFlow */
|
|
|
|
if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE) {
|
|
|
|
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n");
|
|
|
|
} else if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER) {
|
|
|
|
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n");
|
|
|
|
} else {
|
|
|
|
TRACE("DataFlow=Unknown(%d)\n", ppd->DataFlow);
|
|
|
|
}
|
2006-11-12 13:40:35 +00:00
|
|
|
FIXME("(pPropData=%p,cbPropData=%d,pcbReturned=%p) GUID_NULL not implemented!\n",
|
2006-08-22 11:36:08 +00:00
|
|
|
pPropData,cbPropData,pcbReturned);
|
2003-04-29 22:49:52 +00:00
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
2003-09-03 19:28:20 +00:00
|
|
|
}
|
2003-04-29 22:49:52 +00:00
|
|
|
|
2003-09-03 19:28:20 +00:00
|
|
|
ppd->Type = DIRECTSOUNDDEVICE_TYPE_EMULATED;
|
|
|
|
GetDeviceID(&ppd->DeviceId, &dev_guid);
|
|
|
|
|
2004-07-13 23:35:09 +00:00
|
|
|
if ( IsEqualGUID( &ppd->DeviceId, &DSDEVID_DefaultPlayback) ||
|
2003-09-03 19:28:20 +00:00
|
|
|
IsEqualGUID( &ppd->DeviceId, &DSDEVID_DefaultVoicePlayback) ) {
|
|
|
|
ULONG wod;
|
2004-09-08 01:23:57 +00:00
|
|
|
unsigned int wodn;
|
2003-09-03 19:28:20 +00:00
|
|
|
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n");
|
|
|
|
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
|
|
|
|
wodn = waveOutGetNumDevs();
|
|
|
|
for (wod = 0; wod < wodn; wod++) {
|
2005-03-15 15:40:35 +00:00
|
|
|
if (IsEqualGUID( &dev_guid, &DSOUND_renderer_guids[wod] ) ) {
|
2004-08-20 20:01:31 +00:00
|
|
|
DSDRIVERDESC desc;
|
|
|
|
ppd->WaveDeviceId = wod;
|
|
|
|
ppd->Devnode = wod;
|
2009-01-28 00:07:25 +00:00
|
|
|
err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
|
2004-08-20 20:01:31 +00:00
|
|
|
if (err == DS_OK) {
|
|
|
|
PIDSDRIVER drv = NULL;
|
2005-03-28 14:17:51 +00:00
|
|
|
lstrcpynA(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA));
|
|
|
|
lstrcpynA(ppd->ModuleA, desc.szDrvname, sizeof(ppd->ModuleA));
|
2004-08-20 20:01:31 +00:00
|
|
|
MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) );
|
2005-01-28 17:21:07 +00:00
|
|
|
MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) );
|
2009-01-28 00:07:25 +00:00
|
|
|
err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
|
2004-08-20 20:01:31 +00:00
|
|
|
if (err == DS_OK && drv)
|
|
|
|
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
|
2005-03-14 10:03:54 +00:00
|
|
|
else
|
|
|
|
WARN("waveOutMessage(DRV_QUERYDSOUNDIFACE) failed\n");
|
2004-08-20 20:01:31 +00:00
|
|
|
break;
|
|
|
|
} else {
|
2005-03-14 10:03:54 +00:00
|
|
|
WARN("waveOutMessage(DRV_QUERYDSOUNDDESC) failed\n");
|
2004-08-20 20:01:31 +00:00
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
|
|
|
}
|
|
|
|
}
|
2003-09-03 19:28:20 +00:00
|
|
|
}
|
|
|
|
} else if ( IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultCapture) ||
|
|
|
|
IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoiceCapture) ) {
|
|
|
|
ULONG wid;
|
2004-09-08 01:23:57 +00:00
|
|
|
unsigned int widn;
|
2003-09-03 19:28:20 +00:00
|
|
|
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n");
|
|
|
|
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
|
|
|
|
widn = waveInGetNumDevs();
|
|
|
|
for (wid = 0; wid < widn; wid++) {
|
2009-03-17 14:20:05 +00:00
|
|
|
if (IsEqualGUID( &dev_guid, &DSOUND_capture_guids[wid] ) ) {
|
2004-08-20 20:01:31 +00:00
|
|
|
DSDRIVERDESC desc;
|
|
|
|
ppd->WaveDeviceId = wid;
|
|
|
|
ppd->Devnode = wid;
|
2009-01-28 00:07:25 +00:00
|
|
|
err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
|
2004-08-20 20:01:31 +00:00
|
|
|
if (err == DS_OK) {
|
|
|
|
PIDSCDRIVER drv;
|
2005-03-28 14:17:51 +00:00
|
|
|
lstrcpynA(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA));
|
|
|
|
lstrcpynA(ppd->ModuleA, desc.szDrvname, sizeof(ppd->ModuleA));
|
2004-08-20 20:01:31 +00:00
|
|
|
MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) );
|
2005-01-28 17:21:07 +00:00
|
|
|
MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) );
|
2009-01-28 00:07:25 +00:00
|
|
|
err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0));
|
2004-08-20 20:01:31 +00:00
|
|
|
if (err == DS_OK && drv)
|
|
|
|
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
|
2005-03-14 10:03:54 +00:00
|
|
|
else
|
|
|
|
WARN("waveInMessage(DRV_QUERYDSOUNDIFACE) failed\n");
|
2004-08-20 20:01:31 +00:00
|
|
|
break;
|
|
|
|
} else {
|
2005-03-14 10:03:54 +00:00
|
|
|
WARN("waveInMessage(DRV_QUERYDSOUNDDESC) failed\n");
|
2004-08-20 20:01:31 +00:00
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
|
|
|
}
|
|
|
|
}
|
2003-04-29 22:49:52 +00:00
|
|
|
}
|
2003-09-03 19:28:20 +00:00
|
|
|
} else {
|
2003-09-19 00:10:51 +00:00
|
|
|
BOOL found = FALSE;
|
|
|
|
ULONG wod;
|
2004-09-08 01:23:57 +00:00
|
|
|
unsigned int wodn;
|
2003-09-19 00:10:51 +00:00
|
|
|
/* given specific device so try the render devices first */
|
|
|
|
wodn = waveOutGetNumDevs();
|
|
|
|
for (wod = 0; wod < wodn; wod++) {
|
2005-03-15 15:40:35 +00:00
|
|
|
if (IsEqualGUID( &ppd->DeviceId, &DSOUND_renderer_guids[wod] ) ) {
|
2004-08-20 20:01:31 +00:00
|
|
|
DSDRIVERDESC desc;
|
|
|
|
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n");
|
|
|
|
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
|
|
|
|
ppd->WaveDeviceId = wod;
|
|
|
|
ppd->Devnode = wod;
|
2009-01-28 00:07:25 +00:00
|
|
|
err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
|
2004-08-20 20:01:31 +00:00
|
|
|
if (err == DS_OK) {
|
|
|
|
PIDSDRIVER drv = NULL;
|
2005-03-28 14:17:51 +00:00
|
|
|
lstrcpynA(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA));
|
|
|
|
lstrcpynA(ppd->ModuleA, desc.szDrvname, sizeof(ppd->ModuleA));
|
2004-08-20 20:01:31 +00:00
|
|
|
MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) );
|
2005-01-28 17:21:07 +00:00
|
|
|
MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) );
|
2009-01-28 00:07:25 +00:00
|
|
|
err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
|
2004-08-20 20:01:31 +00:00
|
|
|
if (err == DS_OK && drv)
|
|
|
|
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
|
2005-03-14 10:03:54 +00:00
|
|
|
else
|
|
|
|
WARN("waveOutMessage(DRV_QUERYDSOUNDIFACE) failed\n");
|
2004-08-20 20:01:31 +00:00
|
|
|
found = TRUE;
|
|
|
|
break;
|
|
|
|
} else {
|
2005-03-14 10:03:54 +00:00
|
|
|
WARN("waveOutMessage(DRV_QUERYDSOUNDDESC) failed\n");
|
2004-08-20 20:01:31 +00:00
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
|
|
|
}
|
|
|
|
}
|
2003-09-19 00:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (found == FALSE) {
|
2004-08-20 20:01:31 +00:00
|
|
|
ULONG wid;
|
2004-09-08 01:23:57 +00:00
|
|
|
unsigned int widn;
|
2004-08-20 20:01:31 +00:00
|
|
|
/* given specific device so try the capture devices next */
|
|
|
|
widn = waveInGetNumDevs();
|
|
|
|
for (wid = 0; wid < widn; wid++) {
|
2005-03-15 15:40:35 +00:00
|
|
|
if (IsEqualGUID( &ppd->DeviceId, &DSOUND_capture_guids[wid] ) ) {
|
2004-08-20 20:01:31 +00:00
|
|
|
DSDRIVERDESC desc;
|
|
|
|
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n");
|
|
|
|
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
|
|
|
|
ppd->WaveDeviceId = wid;
|
|
|
|
ppd->Devnode = wid;
|
2009-01-28 00:07:25 +00:00
|
|
|
err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
|
2004-08-20 20:01:31 +00:00
|
|
|
if (err == DS_OK) {
|
|
|
|
PIDSDRIVER drv = NULL;
|
2005-03-28 14:17:51 +00:00
|
|
|
lstrcpynA(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA));
|
|
|
|
lstrcpynA(ppd->ModuleA, desc.szDrvname, sizeof(ppd->ModuleA));
|
2004-08-20 20:01:31 +00:00
|
|
|
MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) );
|
2005-01-28 17:21:07 +00:00
|
|
|
MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) );
|
2009-01-28 00:07:25 +00:00
|
|
|
err = mmErr(waveInMessage(UlongToHandle(wid), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
|
2004-08-20 20:01:31 +00:00
|
|
|
if (err == DS_OK && drv)
|
|
|
|
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
|
2005-03-14 10:03:54 +00:00
|
|
|
else
|
|
|
|
WARN("waveInMessage(DRV_QUERYDSOUNDIFACE) failed\n");
|
2004-08-20 20:01:31 +00:00
|
|
|
found = TRUE;
|
|
|
|
break;
|
|
|
|
} else {
|
2005-03-14 10:03:54 +00:00
|
|
|
WARN("waveInMessage(DRV_QUERYDSOUNDDESC) failed\n");
|
2004-08-20 20:01:31 +00:00
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (found == FALSE) {
|
|
|
|
WARN("device not found\n");
|
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
|
|
|
}
|
2003-09-19 00:10:51 +00:00
|
|
|
}
|
2003-04-29 22:49:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (pcbReturned) {
|
2004-07-13 23:35:09 +00:00
|
|
|
*pcbReturned = cbPropData;
|
2006-11-12 13:40:35 +00:00
|
|
|
TRACE("*pcbReturned=%d\n", *pcbReturned);
|
2003-04-29 22:49:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2008-11-28 14:20:03 +00:00
|
|
|
static HRESULT DSPROPERTY_DescriptionA(
|
2003-04-29 22:49:52 +00:00
|
|
|
LPVOID pPropData,
|
|
|
|
ULONG cbPropData,
|
|
|
|
PULONG pcbReturned )
|
|
|
|
{
|
2009-01-10 23:15:53 +00:00
|
|
|
PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA ppd = pPropData;
|
2003-09-15 20:08:05 +00:00
|
|
|
HRESULT err;
|
2004-08-20 20:01:31 +00:00
|
|
|
GUID dev_guid;
|
2006-11-12 13:40:35 +00:00
|
|
|
TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
|
2006-08-22 11:36:08 +00:00
|
|
|
pPropData,cbPropData,pcbReturned);
|
2003-09-15 20:08:05 +00:00
|
|
|
|
|
|
|
TRACE("DeviceId=%s\n",debugstr_guid(&ppd->DeviceId));
|
|
|
|
if ( IsEqualGUID( &ppd->DeviceId , &GUID_NULL) ) {
|
|
|
|
/* default device of type specified by ppd->DataFlow */
|
|
|
|
if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE) {
|
|
|
|
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n");
|
|
|
|
} else if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER) {
|
|
|
|
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n");
|
|
|
|
} else {
|
|
|
|
TRACE("DataFlow=Unknown(%d)\n", ppd->DataFlow);
|
|
|
|
}
|
2006-11-12 13:40:35 +00:00
|
|
|
FIXME("(pPropData=%p,cbPropData=%d,pcbReturned=%p) GUID_NULL not implemented!\n",
|
2006-08-22 11:36:08 +00:00
|
|
|
pPropData,cbPropData,pcbReturned);
|
2003-09-15 20:08:05 +00:00
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
ppd->Type = DIRECTSOUNDDEVICE_TYPE_EMULATED;
|
|
|
|
GetDeviceID(&ppd->DeviceId, &dev_guid);
|
|
|
|
|
|
|
|
if ( IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultPlayback) ||
|
|
|
|
IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoicePlayback) ) {
|
|
|
|
ULONG wod;
|
2004-09-08 01:23:57 +00:00
|
|
|
unsigned int wodn;
|
2005-06-01 20:04:06 +00:00
|
|
|
if (IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultPlayback) )
|
|
|
|
TRACE("DSDEVID_DefaultPlayback\n");
|
|
|
|
else
|
|
|
|
TRACE("DSDEVID_DefaultVoicePlayback\n");
|
2003-09-15 20:08:05 +00:00
|
|
|
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
|
|
|
|
wodn = waveOutGetNumDevs();
|
|
|
|
for (wod = 0; wod < wodn; wod++) {
|
2005-03-15 15:40:35 +00:00
|
|
|
if (IsEqualGUID( &dev_guid, &DSOUND_renderer_guids[wod] ) ) {
|
2005-03-14 10:03:54 +00:00
|
|
|
DSDRIVERDESC desc;
|
|
|
|
ppd->WaveDeviceId = wod;
|
2009-01-28 00:07:25 +00:00
|
|
|
err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
|
2005-03-14 10:03:54 +00:00
|
|
|
if (err == DS_OK) {
|
|
|
|
PIDSDRIVER drv = NULL;
|
|
|
|
/* FIXME: this is a memory leak */
|
|
|
|
CHAR * szDescription = HeapAlloc(GetProcessHeap(),0,strlen(desc.szDesc) + 1);
|
|
|
|
CHAR * szModule = HeapAlloc(GetProcessHeap(),0,strlen(desc.szDrvname) + 1);
|
|
|
|
CHAR * szInterface = HeapAlloc(GetProcessHeap(),0,strlen("Interface") + 1);
|
|
|
|
|
|
|
|
if (szDescription && szModule && szInterface) {
|
|
|
|
strcpy(szDescription, desc.szDesc);
|
|
|
|
strcpy(szModule, desc.szDrvname);
|
|
|
|
strcpy(szInterface, "Interface");
|
|
|
|
|
|
|
|
ppd->Description = szDescription;
|
|
|
|
ppd->Module = szModule;
|
|
|
|
ppd->Interface = szInterface;
|
2009-01-28 00:07:25 +00:00
|
|
|
err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
|
2005-03-14 10:03:54 +00:00
|
|
|
if (err == DS_OK && drv)
|
|
|
|
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
|
|
|
|
else
|
|
|
|
WARN("waveOutMessage(DRV_QUERYDSOUNDIFACE) failed\n");
|
|
|
|
break;
|
2003-09-15 20:08:05 +00:00
|
|
|
} else {
|
2005-03-14 10:03:54 +00:00
|
|
|
WARN("no memory\n");
|
|
|
|
HeapFree(GetProcessHeap(), 0, szDescription);
|
|
|
|
HeapFree(GetProcessHeap(), 0, szModule);
|
|
|
|
HeapFree(GetProcessHeap(), 0, szInterface);
|
|
|
|
return E_OUTOFMEMORY;
|
2003-09-15 20:08:05 +00:00
|
|
|
}
|
2005-03-14 10:03:54 +00:00
|
|
|
} else {
|
|
|
|
WARN("waveOutMessage(DRV_QUERYDSOUNDDESC) failed\n");
|
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
2003-09-15 20:08:05 +00:00
|
|
|
}
|
2005-03-14 10:03:54 +00:00
|
|
|
}
|
2003-09-15 20:08:05 +00:00
|
|
|
}
|
|
|
|
} else if (IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultCapture) ||
|
|
|
|
IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoiceCapture) ) {
|
|
|
|
ULONG wid;
|
2004-09-08 01:23:57 +00:00
|
|
|
unsigned int widn;
|
2005-06-01 20:04:06 +00:00
|
|
|
if (IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultCapture) )
|
|
|
|
TRACE("DSDEVID_DefaultCapture\n");
|
|
|
|
else
|
|
|
|
TRACE("DSDEVID_DefaultVoiceCapture\n");
|
2003-09-15 20:08:05 +00:00
|
|
|
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
|
|
|
|
widn = waveInGetNumDevs();
|
|
|
|
for (wid = 0; wid < widn; wid++) {
|
2005-03-15 15:40:35 +00:00
|
|
|
if (IsEqualGUID( &dev_guid, &DSOUND_capture_guids[wid] ) ) {
|
2005-03-14 10:03:54 +00:00
|
|
|
DSDRIVERDESC desc;
|
|
|
|
ppd->WaveDeviceId = wid;
|
2009-01-28 00:07:25 +00:00
|
|
|
err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
|
2005-03-14 10:03:54 +00:00
|
|
|
if (err == DS_OK) {
|
|
|
|
PIDSCDRIVER drv;
|
|
|
|
/* FIXME: this is a memory leak */
|
|
|
|
CHAR * szDescription = HeapAlloc(GetProcessHeap(),0,strlen(desc.szDesc) + 1);
|
|
|
|
CHAR * szModule = HeapAlloc(GetProcessHeap(),0,strlen(desc.szDrvname) + 1);
|
|
|
|
CHAR * szInterface = HeapAlloc(GetProcessHeap(),0,strlen("Interface") + 1);
|
|
|
|
|
|
|
|
if (szDescription && szModule && szInterface) {
|
|
|
|
strcpy(szDescription, desc.szDesc);
|
|
|
|
strcpy(szModule, desc.szDrvname);
|
|
|
|
strcpy(szInterface, "Interface");
|
|
|
|
|
|
|
|
ppd->Description = szDescription;
|
|
|
|
ppd->Module = szModule;
|
|
|
|
ppd->Interface = szInterface;
|
2009-01-28 00:07:25 +00:00
|
|
|
err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0));
|
2005-03-14 10:03:54 +00:00
|
|
|
if (err == DS_OK && drv)
|
|
|
|
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
|
|
|
|
else
|
2005-06-04 09:38:14 +00:00
|
|
|
WARN("waveInMessage(DRV_QUERYDSOUNDIFACE) failed\n");
|
2005-03-14 10:03:54 +00:00
|
|
|
break;
|
2003-09-15 20:08:05 +00:00
|
|
|
} else {
|
2005-03-14 10:03:54 +00:00
|
|
|
WARN("no memory\n");
|
|
|
|
HeapFree(GetProcessHeap(), 0, szDescription);
|
|
|
|
HeapFree(GetProcessHeap(), 0, szModule);
|
|
|
|
HeapFree(GetProcessHeap(), 0, szInterface);
|
|
|
|
return E_OUTOFMEMORY;
|
2003-09-15 20:08:05 +00:00
|
|
|
}
|
2005-03-14 10:03:54 +00:00
|
|
|
} else {
|
|
|
|
WARN("waveInMessage(DRV_QUERYDSOUNDDESC) failed\n");
|
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
2003-09-15 20:08:05 +00:00
|
|
|
}
|
2005-03-14 10:03:54 +00:00
|
|
|
}
|
2003-09-15 20:08:05 +00:00
|
|
|
}
|
2003-10-08 22:35:26 +00:00
|
|
|
} else {
|
|
|
|
BOOL found = FALSE;
|
|
|
|
ULONG wod;
|
2004-09-08 01:23:57 +00:00
|
|
|
unsigned int wodn;
|
2003-10-08 22:35:26 +00:00
|
|
|
/* given specific device so try the render devices first */
|
2005-06-01 20:04:06 +00:00
|
|
|
TRACE("Checking renderer devices\n");
|
2003-10-08 22:35:26 +00:00
|
|
|
wodn = waveOutGetNumDevs();
|
|
|
|
for (wod = 0; wod < wodn; wod++) {
|
2005-03-15 15:40:35 +00:00
|
|
|
if (IsEqualGUID( &ppd->DeviceId, &DSOUND_renderer_guids[wod] ) ) {
|
2005-03-14 10:03:54 +00:00
|
|
|
DSDRIVERDESC desc;
|
2006-11-12 13:40:35 +00:00
|
|
|
TRACE("DSOUND_renderer_guids[%d]\n", wod);
|
2005-03-14 10:03:54 +00:00
|
|
|
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
|
|
|
|
ppd->WaveDeviceId = wod;
|
2009-01-28 00:07:25 +00:00
|
|
|
err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
|
2005-03-14 10:03:54 +00:00
|
|
|
if (err == DS_OK) {
|
|
|
|
PIDSDRIVER drv = NULL;
|
|
|
|
/* FIXME: this is a memory leak */
|
|
|
|
CHAR * szDescription = HeapAlloc(GetProcessHeap(),0,strlen(desc.szDesc) + 1);
|
|
|
|
CHAR * szModule = HeapAlloc(GetProcessHeap(),0,strlen(desc.szDrvname) + 1);
|
|
|
|
CHAR * szInterface = HeapAlloc(GetProcessHeap(),0,strlen("Interface") + 1);
|
2003-10-08 22:35:26 +00:00
|
|
|
|
2005-03-14 10:03:54 +00:00
|
|
|
if (szDescription && szModule && szInterface) {
|
2003-10-08 22:35:26 +00:00
|
|
|
strcpy(szDescription, desc.szDesc);
|
2005-01-28 17:21:07 +00:00
|
|
|
strcpy(szModule, desc.szDrvname);
|
2003-10-08 22:35:26 +00:00
|
|
|
strcpy(szInterface, "Interface");
|
|
|
|
|
|
|
|
ppd->Description = szDescription;
|
|
|
|
ppd->Module = szModule;
|
|
|
|
ppd->Interface = szInterface;
|
2009-01-28 00:07:25 +00:00
|
|
|
err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
|
2003-10-08 22:35:26 +00:00
|
|
|
if (err == DS_OK && drv)
|
|
|
|
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
|
2005-03-14 10:03:54 +00:00
|
|
|
else
|
|
|
|
WARN("waveOutMessage(DRV_QUERYDSOUNDIFACE) failed\n");
|
2003-10-08 22:35:26 +00:00
|
|
|
found = TRUE;
|
|
|
|
break;
|
|
|
|
} else {
|
2005-03-14 10:03:54 +00:00
|
|
|
WARN("no memory\n");
|
|
|
|
HeapFree(GetProcessHeap(), 0, szDescription);
|
|
|
|
HeapFree(GetProcessHeap(), 0, szModule);
|
|
|
|
HeapFree(GetProcessHeap(), 0, szInterface);
|
|
|
|
return E_OUTOFMEMORY;
|
2003-10-08 22:35:26 +00:00
|
|
|
}
|
2005-03-14 10:03:54 +00:00
|
|
|
} else {
|
|
|
|
WARN("waveOutMessage(DRV_QUERYDSOUNDDESC) failed\n");
|
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
2003-10-08 22:35:26 +00:00
|
|
|
}
|
2005-03-14 10:03:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (found == FALSE) {
|
|
|
|
ULONG wid;
|
|
|
|
unsigned int widn;
|
2005-06-01 20:04:06 +00:00
|
|
|
TRACE("Checking capture devices\n");
|
2005-03-14 10:03:54 +00:00
|
|
|
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
|
|
|
|
widn = waveInGetNumDevs();
|
|
|
|
for (wid = 0; wid < widn; wid++) {
|
2005-06-01 20:04:06 +00:00
|
|
|
if (IsEqualGUID( &ppd->DeviceId, &DSOUND_capture_guids[wid] ) ) {
|
2005-03-14 10:03:54 +00:00
|
|
|
DSDRIVERDESC desc;
|
2006-11-12 13:40:35 +00:00
|
|
|
TRACE("DSOUND_capture_guids[%d]\n", wid);
|
2005-03-14 10:03:54 +00:00
|
|
|
ppd->WaveDeviceId = wid;
|
2009-01-28 00:07:25 +00:00
|
|
|
err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
|
2005-03-14 10:03:54 +00:00
|
|
|
if (err == DS_OK) {
|
|
|
|
PIDSCDRIVER drv;
|
|
|
|
/* FIXME: this is a memory leak */
|
|
|
|
CHAR * szDescription = HeapAlloc(GetProcessHeap(),0,strlen(desc.szDesc) + 1);
|
|
|
|
CHAR * szModule = HeapAlloc(GetProcessHeap(),0,strlen(desc.szDrvname) + 1);
|
|
|
|
CHAR * szInterface = HeapAlloc(GetProcessHeap(),0,strlen("Interface") + 1);
|
|
|
|
|
|
|
|
if (szDescription && szModule && szInterface) {
|
|
|
|
strcpy(szDescription, desc.szDesc);
|
|
|
|
strcpy(szModule, desc.szDrvname);
|
|
|
|
strcpy(szInterface, "Interface");
|
|
|
|
|
|
|
|
ppd->Description = szDescription;
|
|
|
|
ppd->Module = szModule;
|
|
|
|
ppd->Interface = szInterface;
|
2009-01-28 00:07:25 +00:00
|
|
|
err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0));
|
2005-03-14 10:03:54 +00:00
|
|
|
if (err == DS_OK && drv)
|
|
|
|
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
|
|
|
|
else
|
2005-06-04 09:38:14 +00:00
|
|
|
WARN("waveInMessage(DRV_QUERYDSOUNDIFACE) failed\n");
|
2005-03-14 10:03:54 +00:00
|
|
|
found = TRUE;
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
WARN("no memory\n");
|
|
|
|
HeapFree(GetProcessHeap(), 0, szDescription);
|
|
|
|
HeapFree(GetProcessHeap(), 0, szModule);
|
|
|
|
HeapFree(GetProcessHeap(), 0, szInterface);
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
WARN("waveInMessage(DRV_QUERYDSOUNDDESC) failed\n");
|
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-10-08 22:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (found == FALSE) {
|
|
|
|
WARN("device not found\n");
|
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
|
|
|
}
|
2003-09-15 20:08:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (pcbReturned) {
|
|
|
|
*pcbReturned = cbPropData;
|
2006-11-12 13:40:35 +00:00
|
|
|
TRACE("*pcbReturned=%d\n", *pcbReturned);
|
2003-09-15 20:08:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-29 22:49:52 +00:00
|
|
|
}
|
|
|
|
|
2008-11-28 14:20:03 +00:00
|
|
|
static HRESULT DSPROPERTY_DescriptionW(
|
2003-04-29 22:49:52 +00:00
|
|
|
LPVOID pPropData,
|
|
|
|
ULONG cbPropData,
|
|
|
|
PULONG pcbReturned )
|
|
|
|
{
|
2009-01-10 23:15:53 +00:00
|
|
|
PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA ppd = pPropData;
|
2003-04-29 22:49:52 +00:00
|
|
|
HRESULT err;
|
2004-08-20 20:01:31 +00:00
|
|
|
GUID dev_guid;
|
2009-12-09 15:57:59 +00:00
|
|
|
ULONG wod, wid, wodn, widn;
|
|
|
|
DSDRIVERDESC desc;
|
|
|
|
|
2006-11-12 13:40:35 +00:00
|
|
|
TRACE("pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
|
2009-12-09 15:57:59 +00:00
|
|
|
pPropData,cbPropData,pcbReturned);
|
2003-04-29 22:49:52 +00:00
|
|
|
|
|
|
|
TRACE("DeviceId=%s\n",debugstr_guid(&ppd->DeviceId));
|
|
|
|
if ( IsEqualGUID( &ppd->DeviceId , &GUID_NULL) ) {
|
2009-12-09 15:57:59 +00:00
|
|
|
/* default device of type specified by ppd->DataFlow */
|
|
|
|
if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE) {
|
|
|
|
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n");
|
|
|
|
ppd->DeviceId = DSDEVID_DefaultCapture;
|
|
|
|
} else if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER) {
|
|
|
|
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n");
|
|
|
|
ppd->DeviceId = DSDEVID_DefaultPlayback;
|
|
|
|
} else {
|
|
|
|
WARN("DataFlow=Unknown(%d)\n", ppd->DataFlow);
|
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
|
|
|
}
|
2003-09-03 19:28:20 +00:00
|
|
|
}
|
2003-04-29 22:49:52 +00:00
|
|
|
|
2003-09-03 19:28:20 +00:00
|
|
|
GetDeviceID(&ppd->DeviceId, &dev_guid);
|
|
|
|
|
2009-12-09 15:57:59 +00:00
|
|
|
wodn = waveOutGetNumDevs();
|
|
|
|
widn = waveInGetNumDevs();
|
|
|
|
wid = wod = dev_guid.Data4[7];
|
|
|
|
if (!memcmp(&dev_guid, &DSOUND_renderer_guids[0], sizeof(GUID)-1)
|
|
|
|
&& wod < wodn)
|
|
|
|
{
|
|
|
|
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
|
|
|
|
ppd->WaveDeviceId = wod;
|
|
|
|
}
|
|
|
|
else if (!memcmp(&dev_guid, &DSOUND_capture_guids[0], sizeof(GUID)-1)
|
|
|
|
&& wid < widn)
|
|
|
|
{
|
|
|
|
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
|
|
|
|
ppd->WaveDeviceId = wid;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WARN("Device not found\n");
|
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
|
|
|
}
|
2005-03-14 10:03:54 +00:00
|
|
|
|
2009-12-09 15:57:59 +00:00
|
|
|
if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER)
|
|
|
|
err = waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0);
|
|
|
|
else
|
|
|
|
err = waveInMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0);
|
|
|
|
|
|
|
|
if (err != MMSYSERR_NOERROR)
|
|
|
|
{
|
|
|
|
WARN("waveMessage(DRV_QUERYDSOUNDDESC) failed!\n");
|
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* FIXME: Still a memory leak.. */
|
|
|
|
int desclen, modlen;
|
|
|
|
static WCHAR wInterface[] = { 'I','n','t','e','r','f','a','c','e',0 };
|
|
|
|
|
|
|
|
modlen = MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, NULL, 0 );
|
|
|
|
desclen = MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, NULL, 0 );
|
|
|
|
ppd->Module = HeapAlloc(GetProcessHeap(),0,modlen*sizeof(WCHAR));
|
|
|
|
ppd->Description = HeapAlloc(GetProcessHeap(),0,desclen*sizeof(WCHAR));
|
|
|
|
ppd->Interface = wInterface;
|
|
|
|
if (!ppd->Description || !ppd->Module)
|
|
|
|
{
|
|
|
|
WARN("Out of memory\n");
|
|
|
|
HeapFree(GetProcessHeap(), 0, ppd->Description);
|
|
|
|
HeapFree(GetProcessHeap(), 0, ppd->Module);
|
|
|
|
ppd->Description = ppd->Module = NULL;
|
|
|
|
return E_OUTOFMEMORY;
|
2006-08-22 11:36:08 +00:00
|
|
|
}
|
2003-10-08 22:35:26 +00:00
|
|
|
|
2009-12-09 15:57:59 +00:00
|
|
|
MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, ppd->Module, modlen );
|
|
|
|
MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->Description, desclen );
|
2003-04-29 22:49:52 +00:00
|
|
|
}
|
|
|
|
|
2009-12-09 15:57:59 +00:00
|
|
|
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
|
|
|
|
|
2003-04-29 22:49:52 +00:00
|
|
|
if (pcbReturned) {
|
2009-12-09 15:57:59 +00:00
|
|
|
*pcbReturned = sizeof(*ppd);
|
|
|
|
TRACE("*pcbReturned=%d\n", *pcbReturned);
|
2003-04-29 22:49:52 +00:00
|
|
|
}
|
2003-05-02 20:16:48 +00:00
|
|
|
|
2003-04-29 22:49:52 +00:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2008-11-28 14:20:03 +00:00
|
|
|
static HRESULT DSPROPERTY_EnumerateW(
|
2003-04-29 22:49:52 +00:00
|
|
|
LPVOID pPropData,
|
|
|
|
ULONG cbPropData,
|
|
|
|
PULONG pcbReturned )
|
|
|
|
{
|
2009-01-10 23:15:53 +00:00
|
|
|
PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA ppd = pPropData;
|
2009-12-09 15:58:00 +00:00
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA data;
|
|
|
|
BOOL ret;
|
|
|
|
int widn, wodn, i;
|
2006-11-12 13:40:35 +00:00
|
|
|
TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
|
2006-08-22 11:36:08 +00:00
|
|
|
pPropData,cbPropData,pcbReturned);
|
|
|
|
|
2009-12-09 15:58:00 +00:00
|
|
|
if (pcbReturned)
|
|
|
|
*pcbReturned = 0;
|
2006-08-22 11:36:08 +00:00
|
|
|
|
2009-12-09 15:58:00 +00:00
|
|
|
if (!ppd || !ppd->Callback)
|
|
|
|
{
|
|
|
|
WARN("Invalid ppd %p\n", ppd);
|
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
|
|
|
}
|
2006-08-22 11:36:08 +00:00
|
|
|
|
2009-12-09 15:58:00 +00:00
|
|
|
wodn = waveOutGetNumDevs();
|
|
|
|
widn = waveInGetNumDevs();
|
2003-08-06 22:57:24 +00:00
|
|
|
|
2009-12-09 15:58:00 +00:00
|
|
|
data.DeviceId = DSOUND_renderer_guids[0];
|
|
|
|
for (i = 0; i < wodn; ++i)
|
|
|
|
{
|
|
|
|
HRESULT hr;
|
|
|
|
data.DeviceId.Data4[7] = i;
|
|
|
|
hr = DSPROPERTY_DescriptionW(&data, sizeof(data), NULL);
|
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
|
|
|
ERR("DescriptionW failed!\n");
|
2006-08-22 11:36:08 +00:00
|
|
|
return S_OK;
|
|
|
|
}
|
2009-12-09 15:58:00 +00:00
|
|
|
ret = ppd->Callback(&data, ppd->Context);
|
|
|
|
HeapFree(GetProcessHeap(), 0, data.Module);
|
|
|
|
HeapFree(GetProcessHeap(), 0, data.Description);
|
|
|
|
if (!ret)
|
|
|
|
return S_OK;
|
2003-08-06 22:57:24 +00:00
|
|
|
}
|
|
|
|
|
2009-12-09 15:58:00 +00:00
|
|
|
data.DeviceId = DSOUND_capture_guids[0];
|
|
|
|
for (i = 0; i < widn; ++i)
|
|
|
|
{
|
|
|
|
HRESULT hr;
|
|
|
|
data.DeviceId.Data4[7] = i;
|
|
|
|
hr = DSPROPERTY_DescriptionW(&data, sizeof(data), NULL);
|
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
|
|
|
ERR("DescriptionW failed!\n");
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
ret = ppd->Callback(&data, ppd->Context);
|
|
|
|
HeapFree(GetProcessHeap(), 0, data.Module);
|
|
|
|
HeapFree(GetProcessHeap(), 0, data.Description);
|
|
|
|
if (!ret)
|
|
|
|
return S_OK;
|
2003-08-06 22:57:24 +00:00
|
|
|
}
|
2009-12-09 15:58:00 +00:00
|
|
|
return S_OK;
|
2003-04-29 22:49:52 +00:00
|
|
|
}
|
|
|
|
|
2009-12-09 15:58:01 +00:00
|
|
|
static BOOL DSPROPERTY_descWtoA(DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA *dataW,
|
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA *dataA)
|
|
|
|
{
|
|
|
|
DWORD modlen, desclen;
|
|
|
|
static char Interface[] = "Interface";
|
|
|
|
|
|
|
|
modlen = WideCharToMultiByte(CP_ACP, 0, dataW->Module, -1, NULL, 0, NULL, NULL);
|
|
|
|
desclen = WideCharToMultiByte(CP_ACP, 0, dataW->Description, -1, NULL, 0, NULL, NULL);
|
|
|
|
dataA->Type = dataW->Type;
|
|
|
|
dataA->DataFlow = dataW->DataFlow;
|
|
|
|
dataA->DeviceId = dataW->DeviceId;
|
|
|
|
dataA->WaveDeviceId = dataW->WaveDeviceId;
|
|
|
|
dataA->Interface = Interface;
|
|
|
|
dataA->Module = HeapAlloc(GetProcessHeap(), 0, modlen);
|
|
|
|
dataA->Description = HeapAlloc(GetProcessHeap(), 0, desclen);
|
|
|
|
if (!dataA->Module || !dataA->Description)
|
|
|
|
{
|
|
|
|
HeapFree(GetProcessHeap(), 0, dataA->Module);
|
|
|
|
HeapFree(GetProcessHeap(), 0, dataA->Description);
|
|
|
|
dataA->Module = dataA->Description = NULL;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, dataW->Module, -1, dataA->Module, modlen, NULL, NULL);
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, dataW->Description, -1, dataA->Description, desclen, NULL, NULL);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2009-12-09 15:58:02 +00:00
|
|
|
static void DSPROPERTY_descWto1(DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA *dataW,
|
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA *data1)
|
|
|
|
{
|
|
|
|
data1->DeviceId = dataW->DeviceId;
|
|
|
|
lstrcpynW(data1->ModuleW, dataW->Module, sizeof(data1->ModuleW)/sizeof(*data1->ModuleW));
|
|
|
|
lstrcpynW(data1->DescriptionW, dataW->Description, sizeof(data1->DescriptionW)/sizeof(*data1->DescriptionW));
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, data1->DescriptionW, -1, data1->DescriptionA, sizeof(data1->DescriptionA)-1, NULL, NULL);
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, data1->ModuleW, -1, data1->ModuleA, sizeof(data1->ModuleA)-1, NULL, NULL);
|
|
|
|
data1->DescriptionA[sizeof(data1->DescriptionA)-1] = 0;
|
|
|
|
data1->ModuleA[sizeof(data1->ModuleA)-1] = 0;
|
|
|
|
data1->Type = dataW->Type;
|
|
|
|
data1->DataFlow = dataW->DataFlow;
|
|
|
|
data1->WaveDeviceId = data1->Devnode = dataW->WaveDeviceId;
|
|
|
|
}
|
|
|
|
|
2009-12-09 15:58:01 +00:00
|
|
|
static BOOL CALLBACK DSPROPERTY_enumWtoA(DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA *descW, void *data)
|
|
|
|
{
|
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA descA;
|
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA *ppd = data;
|
|
|
|
BOOL ret;
|
|
|
|
|
|
|
|
ret = DSPROPERTY_descWtoA(descW, &descA);
|
|
|
|
if (!ret)
|
|
|
|
return FALSE;
|
|
|
|
ret = ppd->Callback(&descA, ppd->Context);
|
|
|
|
HeapFree(GetProcessHeap(), 0, descA.Module);
|
|
|
|
HeapFree(GetProcessHeap(), 0, descA.Description);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT DSPROPERTY_EnumerateA(
|
|
|
|
LPVOID pPropData,
|
|
|
|
ULONG cbPropData,
|
|
|
|
PULONG pcbReturned)
|
|
|
|
{
|
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA *ppd = pPropData;
|
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA data;
|
|
|
|
|
|
|
|
if (!ppd || !ppd->Callback)
|
|
|
|
{
|
|
|
|
WARN("Invalid ppd %p\n", ppd);
|
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
data.Callback = DSPROPERTY_enumWtoA;
|
|
|
|
data.Context = ppd;
|
|
|
|
|
|
|
|
return DSPROPERTY_EnumerateW(&data, cbPropData, pcbReturned);
|
|
|
|
}
|
|
|
|
|
2009-12-09 15:58:02 +00:00
|
|
|
static BOOL CALLBACK DSPROPERTY_enumWto1(DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA *descW, void *data)
|
|
|
|
{
|
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA desc1;
|
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA *ppd = data;
|
|
|
|
BOOL ret;
|
|
|
|
|
|
|
|
DSPROPERTY_descWto1(descW, &desc1);
|
|
|
|
ret = ppd->Callback(&desc1, ppd->Context);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT DSPROPERTY_Enumerate1(
|
|
|
|
LPVOID pPropData,
|
|
|
|
ULONG cbPropData,
|
|
|
|
PULONG pcbReturned)
|
|
|
|
{
|
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA *ppd = pPropData;
|
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA data;
|
|
|
|
|
|
|
|
if (!ppd || !ppd->Callback)
|
|
|
|
{
|
|
|
|
WARN("Invalid ppd %p\n", ppd);
|
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
data.Callback = DSPROPERTY_enumWto1;
|
|
|
|
data.Context = ppd;
|
|
|
|
|
|
|
|
return DSPROPERTY_EnumerateW(&data, cbPropData, pcbReturned);
|
|
|
|
}
|
|
|
|
|
2003-08-20 18:18:23 +00:00
|
|
|
static HRESULT WINAPI IKsPrivatePropertySetImpl_Get(
|
|
|
|
LPKSPROPERTYSET iface,
|
|
|
|
REFGUID guidPropSet,
|
|
|
|
ULONG dwPropID,
|
|
|
|
LPVOID pInstanceData,
|
|
|
|
ULONG cbInstanceData,
|
|
|
|
LPVOID pPropData,
|
|
|
|
ULONG cbPropData,
|
2005-03-14 10:03:54 +00:00
|
|
|
PULONG pcbReturned )
|
|
|
|
{
|
2004-09-09 20:17:07 +00:00
|
|
|
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface;
|
2006-11-12 13:40:35 +00:00
|
|
|
TRACE("(iface=%p,guidPropSet=%s,dwPropID=%d,pInstanceData=%p,cbInstanceData=%d,pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
|
2006-08-22 11:36:08 +00:00
|
|
|
This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData,pcbReturned);
|
2003-08-06 22:57:24 +00:00
|
|
|
|
|
|
|
if ( IsEqualGUID( &DSPROPSETID_DirectSoundDevice, guidPropSet) ) {
|
2006-08-22 11:36:08 +00:00
|
|
|
switch (dwPropID) {
|
|
|
|
case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A:
|
|
|
|
return DSPROPERTY_WaveDeviceMappingA(pPropData,cbPropData,pcbReturned);
|
|
|
|
case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1:
|
|
|
|
return DSPROPERTY_Description1(pPropData,cbPropData,pcbReturned);
|
|
|
|
case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1:
|
|
|
|
return DSPROPERTY_Enumerate1(pPropData,cbPropData,pcbReturned);
|
|
|
|
case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W:
|
|
|
|
return DSPROPERTY_WaveDeviceMappingW(pPropData,cbPropData,pcbReturned);
|
|
|
|
case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A:
|
|
|
|
return DSPROPERTY_DescriptionA(pPropData,cbPropData,pcbReturned);
|
|
|
|
case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W:
|
|
|
|
return DSPROPERTY_DescriptionW(pPropData,cbPropData,pcbReturned);
|
|
|
|
case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A:
|
|
|
|
return DSPROPERTY_EnumerateA(pPropData,cbPropData,pcbReturned);
|
|
|
|
case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W:
|
|
|
|
return DSPROPERTY_EnumerateW(pPropData,cbPropData,pcbReturned);
|
|
|
|
default:
|
2006-11-12 13:40:35 +00:00
|
|
|
FIXME("unsupported ID: %d\n",dwPropID);
|
2006-08-22 11:36:08 +00:00
|
|
|
break;
|
|
|
|
}
|
2003-08-06 22:57:24 +00:00
|
|
|
} else {
|
2006-08-22 11:36:08 +00:00
|
|
|
FIXME("unsupported property: %s\n",debugstr_guid(guidPropSet));
|
2003-08-06 22:57:24 +00:00
|
|
|
}
|
2003-04-29 22:49:52 +00:00
|
|
|
|
2003-08-06 22:57:24 +00:00
|
|
|
if (pcbReturned) {
|
2006-08-22 11:36:08 +00:00
|
|
|
*pcbReturned = 0;
|
2006-11-12 13:40:35 +00:00
|
|
|
FIXME("*pcbReturned=%d\n", *pcbReturned);
|
2003-08-06 22:57:24 +00:00
|
|
|
}
|
2002-06-13 19:15:06 +00:00
|
|
|
|
2003-08-06 22:57:24 +00:00
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
2002-06-13 19:15:06 +00:00
|
|
|
}
|
|
|
|
|
2003-08-20 18:18:23 +00:00
|
|
|
static HRESULT WINAPI IKsPrivatePropertySetImpl_Set(
|
|
|
|
LPKSPROPERTYSET iface,
|
|
|
|
REFGUID guidPropSet,
|
|
|
|
ULONG dwPropID,
|
|
|
|
LPVOID pInstanceData,
|
|
|
|
ULONG cbInstanceData,
|
|
|
|
LPVOID pPropData,
|
|
|
|
ULONG cbPropData )
|
|
|
|
{
|
2004-09-09 20:17:07 +00:00
|
|
|
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface;
|
2002-06-13 19:15:06 +00:00
|
|
|
|
2006-11-12 13:40:35 +00:00
|
|
|
FIXME("(%p,%s,%d,%p,%d,%p,%d), stub!\n",This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData);
|
2003-08-20 18:18:23 +00:00
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
2002-06-13 19:15:06 +00:00
|
|
|
}
|
|
|
|
|
2003-08-20 18:18:23 +00:00
|
|
|
static HRESULT WINAPI IKsPrivatePropertySetImpl_QuerySupport(
|
|
|
|
LPKSPROPERTYSET iface,
|
|
|
|
REFGUID guidPropSet,
|
|
|
|
ULONG dwPropID,
|
|
|
|
PULONG pTypeSupport )
|
|
|
|
{
|
2004-09-09 20:17:07 +00:00
|
|
|
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface;
|
2006-11-12 13:40:35 +00:00
|
|
|
TRACE("(%p,%s,%d,%p)\n",This,debugstr_guid(guidPropSet),dwPropID,pTypeSupport);
|
2003-08-06 22:57:24 +00:00
|
|
|
|
|
|
|
if ( IsEqualGUID( &DSPROPSETID_DirectSoundDevice, guidPropSet) ) {
|
|
|
|
switch (dwPropID) {
|
|
|
|
case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A:
|
|
|
|
*pTypeSupport = KSPROPERTY_SUPPORT_GET;
|
|
|
|
return S_OK;
|
|
|
|
case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1:
|
|
|
|
*pTypeSupport = KSPROPERTY_SUPPORT_GET;
|
|
|
|
return S_OK;
|
|
|
|
case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1:
|
|
|
|
*pTypeSupport = KSPROPERTY_SUPPORT_GET;
|
|
|
|
return S_OK;
|
|
|
|
case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W:
|
|
|
|
*pTypeSupport = KSPROPERTY_SUPPORT_GET;
|
|
|
|
return S_OK;
|
|
|
|
case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A:
|
|
|
|
*pTypeSupport = KSPROPERTY_SUPPORT_GET;
|
|
|
|
return S_OK;
|
|
|
|
case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W:
|
|
|
|
*pTypeSupport = KSPROPERTY_SUPPORT_GET;
|
|
|
|
return S_OK;
|
|
|
|
case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A:
|
|
|
|
*pTypeSupport = KSPROPERTY_SUPPORT_GET;
|
|
|
|
return S_OK;
|
|
|
|
case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W:
|
|
|
|
*pTypeSupport = KSPROPERTY_SUPPORT_GET;
|
|
|
|
return S_OK;
|
|
|
|
default:
|
2006-11-12 13:40:35 +00:00
|
|
|
FIXME("unsupported ID: %d\n",dwPropID);
|
2003-08-06 22:57:24 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
FIXME("unsupported property: %s\n",debugstr_guid(guidPropSet));
|
|
|
|
}
|
2002-06-13 19:15:06 +00:00
|
|
|
|
2003-08-06 22:57:24 +00:00
|
|
|
return E_PROP_ID_UNSUPPORTED;
|
2002-06-13 19:15:06 +00:00
|
|
|
}
|
|
|
|
|
2005-06-01 19:57:42 +00:00
|
|
|
static const IKsPropertySetVtbl ikspvt = {
|
2003-08-20 18:18:23 +00:00
|
|
|
IKsPrivatePropertySetImpl_QueryInterface,
|
|
|
|
IKsPrivatePropertySetImpl_AddRef,
|
|
|
|
IKsPrivatePropertySetImpl_Release,
|
|
|
|
IKsPrivatePropertySetImpl_Get,
|
|
|
|
IKsPrivatePropertySetImpl_Set,
|
|
|
|
IKsPrivatePropertySetImpl_QuerySupport
|
2002-06-13 19:15:06 +00:00
|
|
|
};
|
|
|
|
|
2006-01-03 16:32:50 +00:00
|
|
|
HRESULT IKsPrivatePropertySetImpl_Create(
|
2006-08-18 05:13:31 +00:00
|
|
|
REFIID riid,
|
2003-08-20 18:18:23 +00:00
|
|
|
IKsPrivatePropertySetImpl **piks)
|
2002-06-13 19:15:06 +00:00
|
|
|
{
|
2003-08-20 18:18:23 +00:00
|
|
|
IKsPrivatePropertySetImpl *iks;
|
2006-08-18 05:13:31 +00:00
|
|
|
TRACE("(%s, %p)\n", debugstr_guid(riid), piks);
|
|
|
|
|
|
|
|
if (!IsEqualIID(riid, &IID_IUnknown) &&
|
|
|
|
!IsEqualIID(riid, &IID_IKsPropertySet)) {
|
|
|
|
*piks = 0;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
2002-06-13 19:15:06 +00:00
|
|
|
|
2004-08-18 00:30:37 +00:00
|
|
|
iks = HeapAlloc(GetProcessHeap(),0,sizeof(*iks));
|
2005-06-04 09:38:14 +00:00
|
|
|
iks->ref = 1;
|
2003-08-20 18:18:23 +00:00
|
|
|
iks->lpVtbl = &ikspvt;
|
2002-06-13 19:15:06 +00:00
|
|
|
|
2003-08-20 18:18:23 +00:00
|
|
|
*piks = iks;
|
|
|
|
return S_OK;
|
2002-06-13 19:15:06 +00:00
|
|
|
}
|