2003-08-07 00:57:48 +02:00
|
|
|
/*
|
2004-08-23 19:50:31 +02:00
|
|
|
* Unit tests for CLSID_DirectSoundPrivate property set functions
|
|
|
|
* (used by dxdiag)
|
2003-08-07 00:57:48 +02:00
|
|
|
*
|
|
|
|
* Copyright (c) 2003 Robert Reif
|
|
|
|
*
|
|
|
|
* 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 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2003-08-07 00:57:48 +02:00
|
|
|
*/
|
|
|
|
|
2005-09-07 15:28:25 +02:00
|
|
|
#define COBJMACROS
|
2003-08-07 00:57:48 +02:00
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
#include "wine/test.h"
|
|
|
|
#include "dsound.h"
|
|
|
|
#include "dsconf.h"
|
|
|
|
|
2004-09-08 21:07:57 +02:00
|
|
|
#include "dsound_test.h"
|
|
|
|
|
2004-07-22 21:40:44 +02:00
|
|
|
#ifndef DSBCAPS_CTRLDEFAULT
|
2004-08-23 19:50:31 +02:00
|
|
|
#define DSBCAPS_CTRLDEFAULT \
|
|
|
|
DSBCAPS_CTRLFREQUENCY|DSBCAPS_CTRLPAN|DSBCAPS_CTRLVOLUME
|
2004-07-22 21:40:44 +02:00
|
|
|
#endif
|
2003-08-20 20:18:39 +02:00
|
|
|
|
2007-01-08 00:20:14 +01:00
|
|
|
#include "initguid.h"
|
|
|
|
|
2007-01-09 00:39:23 +01:00
|
|
|
DEFINE_GUID(DSPROPSETID_VoiceManager,
|
2004-08-23 19:50:31 +02:00
|
|
|
0x62A69BAE,0xDF9D,0x11D1,0x99,0xA6,0x00,0xC0,0x4F,0xC9,0x9D,0x46);
|
2007-01-09 00:39:23 +01:00
|
|
|
DEFINE_GUID(DSPROPSETID_EAX20_ListenerProperties,
|
2004-08-23 19:50:31 +02:00
|
|
|
0x306a6a8,0xb224,0x11d2,0x99,0xe5,0x0,0x0,0xe8,0xd8,0xc7,0x22);
|
2007-01-09 00:39:23 +01:00
|
|
|
DEFINE_GUID(DSPROPSETID_EAX20_BufferProperties,
|
2004-08-23 19:50:31 +02:00
|
|
|
0x306a6a7,0xb224,0x11d2,0x99,0xe5,0x0,0x0,0xe8,0xd8,0xc7,0x22);
|
2007-01-09 00:39:23 +01:00
|
|
|
DEFINE_GUID(DSPROPSETID_I3DL2_ListenerProperties,
|
2004-08-23 19:50:31 +02:00
|
|
|
0xDA0F0520,0x300A,0x11D3,0x8A,0x2B,0x00,0x60,0x97,0x0D,0xB0,0x11);
|
2007-01-09 00:39:23 +01:00
|
|
|
DEFINE_GUID(DSPROPSETID_I3DL2_BufferProperties,
|
2004-08-23 19:50:31 +02:00
|
|
|
0xDA0F0521,0x300A,0x11D3,0x8A,0x2B,0x00,0x60,0x97,0x0D,0xB0,0x11);
|
2007-01-09 00:39:23 +01:00
|
|
|
DEFINE_GUID(DSPROPSETID_ZOOMFX_BufferProperties,
|
2004-08-23 19:50:31 +02:00
|
|
|
0xCD5368E0,0x3450,0x11D3,0x8B,0x6E,0x00,0x10,0x5A,0x9B,0x7B,0xBC);
|
2003-08-20 20:18:39 +02:00
|
|
|
|
2007-01-15 15:00:39 +01:00
|
|
|
static HRESULT (WINAPI *pDirectSoundEnumerateA)(LPDSENUMCALLBACKA,LPVOID)=NULL;
|
|
|
|
static HRESULT (WINAPI *pDllGetClassObject)(REFCLSID,REFIID,LPVOID*)=NULL;
|
|
|
|
static HRESULT (WINAPI *pDirectSoundCreate)(LPCGUID,LPDIRECTSOUND*,
|
|
|
|
LPUNKNOWN)=NULL;
|
2005-02-23 13:43:38 +01:00
|
|
|
static HRESULT (WINAPI *pDirectSoundCreate8)(LPCGUID,LPDIRECTSOUND8*,
|
|
|
|
LPUNKNOWN)=NULL;
|
|
|
|
static HRESULT (WINAPI *pDirectSoundCaptureCreate)(LPCGUID,
|
|
|
|
LPDIRECTSOUNDCAPTURE*,LPUNKNOWN)=NULL;
|
|
|
|
static HRESULT (WINAPI *pDirectSoundCaptureCreate8)(LPCGUID,
|
|
|
|
LPDIRECTSOUNDCAPTURE8*,LPUNKNOWN)=NULL;
|
|
|
|
static HRESULT (WINAPI *pDirectSoundFullDuplexCreate)(LPCGUID,LPCGUID,
|
|
|
|
LPCDSCBUFFERDESC,LPCDSBUFFERDESC,HWND,DWORD,LPDIRECTSOUNDFULLDUPLEX*,
|
|
|
|
LPDIRECTSOUNDCAPTUREBUFFER8*,LPDIRECTSOUNDBUFFER8*,LPUNKNOWN)=NULL;
|
|
|
|
|
2006-12-10 16:51:26 +01:00
|
|
|
static BOOL CALLBACK callback(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA data,
|
2004-08-23 19:50:31 +02:00
|
|
|
LPVOID context)
|
2003-08-07 00:57:48 +02:00
|
|
|
{
|
2005-03-14 11:04:07 +01:00
|
|
|
trace(" found device:\n");
|
|
|
|
trace(" Type: %s\n",
|
|
|
|
data->Type == DIRECTSOUNDDEVICE_TYPE_EMULATED ? "Emulated" :
|
|
|
|
data->Type == DIRECTSOUNDDEVICE_TYPE_VXD ? "VxD" :
|
|
|
|
data->Type == DIRECTSOUNDDEVICE_TYPE_WDM ? "WDM" : "Unknown");
|
|
|
|
trace(" DataFlow: %s\n",
|
|
|
|
data->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER ? "Render" :
|
|
|
|
data->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE ?
|
|
|
|
"Capture" : "Unknown");
|
2006-10-15 12:27:34 +02:00
|
|
|
trace(" DeviceId: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\n",
|
2005-03-14 11:04:07 +01:00
|
|
|
data->DeviceId.Data1,data->DeviceId.Data2,data->DeviceId.Data3,
|
|
|
|
data->DeviceId.Data4[0],data->DeviceId.Data4[1],
|
|
|
|
data->DeviceId.Data4[2],data->DeviceId.Data4[3],
|
|
|
|
data->DeviceId.Data4[4],data->DeviceId.Data4[5],
|
|
|
|
data->DeviceId.Data4[6],data->DeviceId.Data4[7]);
|
|
|
|
trace(" Description: %s\n", data->Description);
|
|
|
|
trace(" Module: %s\n", data->Module);
|
|
|
|
trace(" Interface: %s\n", data->Interface);
|
2006-10-10 01:07:36 +02:00
|
|
|
trace(" WaveDeviceId: %d\n", data->WaveDeviceId);
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2006-12-10 16:51:26 +01:00
|
|
|
static BOOL CALLBACK callback1(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA data,
|
2005-03-14 11:04:07 +01:00
|
|
|
LPVOID context)
|
|
|
|
{
|
|
|
|
char descriptionA[0x100];
|
|
|
|
char moduleA[MAX_PATH];
|
|
|
|
|
|
|
|
trace(" found device:\n");
|
|
|
|
trace(" Type: %s\n",
|
|
|
|
data->Type == DIRECTSOUNDDEVICE_TYPE_EMULATED ? "Emulated" :
|
|
|
|
data->Type == DIRECTSOUNDDEVICE_TYPE_VXD ? "VxD" :
|
|
|
|
data->Type == DIRECTSOUNDDEVICE_TYPE_WDM ? "WDM" : "Unknown");
|
|
|
|
trace(" DataFlow: %s\n",
|
|
|
|
data->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER ? "Render" :
|
|
|
|
data->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE ?
|
|
|
|
"Capture" : "Unknown");
|
2006-10-15 12:27:34 +02:00
|
|
|
trace(" DeviceId: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\n",
|
2005-03-14 11:04:07 +01:00
|
|
|
data->DeviceId.Data1,data->DeviceId.Data2,data->DeviceId.Data3,
|
|
|
|
data->DeviceId.Data4[0],data->DeviceId.Data4[1],
|
|
|
|
data->DeviceId.Data4[2],data->DeviceId.Data4[3],
|
|
|
|
data->DeviceId.Data4[4],data->DeviceId.Data4[5],
|
|
|
|
data->DeviceId.Data4[6],data->DeviceId.Data4[7]);
|
|
|
|
trace(" DescriptionA: %s\n", data->DescriptionA);
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, data->DescriptionW, -1, descriptionA, sizeof(descriptionA), NULL, NULL);
|
|
|
|
trace(" DescriptionW: %s\n", descriptionA);
|
|
|
|
trace(" ModuleA: %s\n", data->ModuleA);
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, data->ModuleW, -1, moduleA, sizeof(moduleA), NULL, NULL);
|
|
|
|
trace(" ModuleW: %s\n", moduleA);
|
2006-10-10 01:07:36 +02:00
|
|
|
trace(" WaveDeviceId: %d\n", data->WaveDeviceId);
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2006-12-10 16:51:26 +01:00
|
|
|
static BOOL CALLBACK callbackA(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA data,
|
2005-03-14 11:04:07 +01:00
|
|
|
LPVOID context)
|
|
|
|
{
|
|
|
|
trace(" found device:\n");
|
|
|
|
trace(" Type: %s\n",
|
|
|
|
data->Type == DIRECTSOUNDDEVICE_TYPE_EMULATED ? "Emulated" :
|
|
|
|
data->Type == DIRECTSOUNDDEVICE_TYPE_VXD ? "VxD" :
|
|
|
|
data->Type == DIRECTSOUNDDEVICE_TYPE_WDM ? "WDM" : "Unknown");
|
|
|
|
trace(" DataFlow: %s\n",
|
|
|
|
data->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER ? "Render" :
|
|
|
|
data->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE ?
|
|
|
|
"Capture" : "Unknown");
|
2006-10-15 12:27:34 +02:00
|
|
|
trace(" DeviceId: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\n",
|
2005-03-14 11:04:07 +01:00
|
|
|
data->DeviceId.Data1,data->DeviceId.Data2,data->DeviceId.Data3,
|
|
|
|
data->DeviceId.Data4[0],data->DeviceId.Data4[1],
|
|
|
|
data->DeviceId.Data4[2],data->DeviceId.Data4[3],
|
|
|
|
data->DeviceId.Data4[4],data->DeviceId.Data4[5],
|
|
|
|
data->DeviceId.Data4[6],data->DeviceId.Data4[7]);
|
|
|
|
trace(" Description: %s\n", data->Description);
|
|
|
|
trace(" Module: %s\n", data->Module);
|
|
|
|
trace(" Interface: %s\n", data->Interface);
|
2006-10-10 01:07:36 +02:00
|
|
|
trace(" WaveDeviceId: %d\n", data->WaveDeviceId);
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2006-12-10 16:51:26 +01:00
|
|
|
static BOOL CALLBACK callbackW(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA data,
|
2005-03-14 11:04:07 +01:00
|
|
|
LPVOID context)
|
|
|
|
{
|
|
|
|
char descriptionA[0x100];
|
|
|
|
char moduleA[MAX_PATH];
|
|
|
|
char interfaceA[MAX_PATH];
|
|
|
|
|
2004-08-23 19:50:31 +02:00
|
|
|
trace("found device:\n");
|
|
|
|
trace("\tType: %s\n",
|
|
|
|
data->Type == DIRECTSOUNDDEVICE_TYPE_EMULATED ? "Emulated" :
|
|
|
|
data->Type == DIRECTSOUNDDEVICE_TYPE_VXD ? "VxD" :
|
|
|
|
data->Type == DIRECTSOUNDDEVICE_TYPE_WDM ? "WDM" : "Unknown");
|
|
|
|
trace("\tDataFlow: %s\n",
|
|
|
|
data->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER ? "Render" :
|
|
|
|
data->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE ?
|
|
|
|
"Capture" : "Unknown");
|
2006-10-15 12:27:34 +02:00
|
|
|
trace("\tDeviceId: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\n",
|
2004-08-23 19:50:31 +02:00
|
|
|
data->DeviceId.Data1,data->DeviceId.Data2,data->DeviceId.Data3,
|
|
|
|
data->DeviceId.Data4[0],data->DeviceId.Data4[1],
|
|
|
|
data->DeviceId.Data4[2],data->DeviceId.Data4[3],
|
|
|
|
data->DeviceId.Data4[4],data->DeviceId.Data4[5],
|
|
|
|
data->DeviceId.Data4[6],data->DeviceId.Data4[7]);
|
2005-03-14 11:04:07 +01:00
|
|
|
WideCharToMultiByte(CP_ACP, 0, data->Description, -1, descriptionA, sizeof(descriptionA), NULL, NULL);
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, data->Module, -1, moduleA, sizeof(moduleA), NULL, NULL);
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, data->Interface, -1, interfaceA, sizeof(interfaceA), NULL, NULL);
|
|
|
|
trace("\tDescription: %s\n", descriptionA);
|
|
|
|
trace("\tModule: %s\n", moduleA);
|
|
|
|
trace("\tInterface: %s\n", interfaceA);
|
2006-10-10 01:07:36 +02:00
|
|
|
trace("\tWaveDeviceId: %d\n", data->WaveDeviceId);
|
2004-08-23 19:50:31 +02:00
|
|
|
|
|
|
|
return TRUE;
|
2003-08-07 00:57:48 +02:00
|
|
|
}
|
|
|
|
|
2005-06-20 16:18:03 +02:00
|
|
|
static void propset_private_tests(void)
|
2003-08-07 00:57:48 +02:00
|
|
|
{
|
2004-08-23 19:50:31 +02:00
|
|
|
HRESULT rc;
|
|
|
|
IClassFactory * pcf;
|
|
|
|
IKsPropertySet * pps;
|
|
|
|
ULONG support;
|
|
|
|
|
|
|
|
/* try direct sound first */
|
2005-03-14 11:04:07 +01:00
|
|
|
/* DSOUND: Error: Invalid interface buffer */
|
2008-12-08 09:23:12 +01:00
|
|
|
rc = (pDllGetClassObject)(&CLSID_DirectSound, &IID_IClassFactory, NULL);
|
2004-08-23 19:50:31 +02:00
|
|
|
ok(rc==DSERR_INVALIDPARAM,"DllGetClassObject(CLSID_DirectSound, "
|
|
|
|
"IID_IClassFactory) should have returned DSERR_INVALIDPARAM, "
|
2008-07-08 17:49:20 +02:00
|
|
|
"returned: %08x\n",rc);
|
2004-08-23 19:50:31 +02:00
|
|
|
|
2007-01-15 15:00:39 +01:00
|
|
|
rc = (pDllGetClassObject)(&CLSID_DirectSound, &IID_IDirectSound, (void **)(&pcf));
|
2006-08-18 07:14:12 +02:00
|
|
|
ok(rc==E_NOINTERFACE,"DllGetClassObject(CLSID_DirectSound, "
|
|
|
|
"IID_IDirectSound) should have returned E_NOINTERFACE, "
|
2008-07-08 17:49:20 +02:00
|
|
|
"returned: %08x\n",rc);
|
2006-08-18 07:14:12 +02:00
|
|
|
|
2007-01-15 15:00:39 +01:00
|
|
|
rc = (pDllGetClassObject)(&CLSID_DirectSound, &IID_IUnknown, (void **)(&pcf));
|
2006-08-18 07:14:12 +02:00
|
|
|
ok(rc==DS_OK,"DllGetClassObject(CLSID_DirectSound, "
|
2008-07-08 17:49:20 +02:00
|
|
|
"IID_IUnknown) failed: %08x\n",rc);
|
2006-08-18 07:14:12 +02:00
|
|
|
|
2007-01-15 15:00:39 +01:00
|
|
|
rc = (pDllGetClassObject)(&CLSID_DirectSound, &IID_IClassFactory, (void **)(&pcf));
|
2004-08-23 19:50:31 +02:00
|
|
|
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSound, IID_IClassFactory) "
|
2008-07-08 17:49:20 +02:00
|
|
|
"failed: %08x\n",rc);
|
2004-08-23 19:50:31 +02:00
|
|
|
if (pcf==0)
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2004-08-23 19:50:31 +02:00
|
|
|
|
|
|
|
/* direct sound doesn't have an IKsPropertySet */
|
2005-03-14 11:04:07 +01:00
|
|
|
/* DSOUND: Error: Invalid interface buffer */
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
|
2008-12-08 09:23:12 +01:00
|
|
|
NULL);
|
2004-08-23 19:50:31 +02:00
|
|
|
ok(rc==DSERR_INVALIDPARAM, "CreateInstance(IID_IKsPropertySet) should have "
|
2008-07-08 17:49:20 +02:00
|
|
|
"returned DSERR_INVALIDPARAM, returned: %08x\n",rc);
|
2004-08-23 19:50:31 +02:00
|
|
|
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
|
2004-08-23 19:50:31 +02:00
|
|
|
(void **)(&pps));
|
|
|
|
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
|
2008-07-08 17:49:20 +02:00
|
|
|
"returned E_NOINTERFACE, returned: %08x\n",rc);
|
2004-08-23 19:50:31 +02:00
|
|
|
|
|
|
|
/* and the direct sound 8 version */
|
2005-02-23 13:43:38 +01:00
|
|
|
if (pDirectSoundCreate8) {
|
2007-01-15 15:00:39 +01:00
|
|
|
rc = (pDllGetClassObject)(&CLSID_DirectSound8, &IID_IClassFactory, (void **)(&pcf));
|
2005-02-23 13:43:38 +01:00
|
|
|
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSound8, IID_IClassFactory) "
|
2008-07-08 17:49:20 +02:00
|
|
|
"failed: %08x\n",rc);
|
2005-02-23 13:43:38 +01:00
|
|
|
if (pcf==0)
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2005-02-23 13:43:38 +01:00
|
|
|
|
|
|
|
/* direct sound 8 doesn't have an IKsPropertySet */
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
|
2005-02-23 13:43:38 +01:00
|
|
|
(void **)(&pps));
|
|
|
|
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
|
2008-07-08 17:49:20 +02:00
|
|
|
"returned E_NOINTERFACE, returned: %08x\n",rc);
|
2005-02-23 13:43:38 +01:00
|
|
|
}
|
2004-08-23 19:50:31 +02:00
|
|
|
|
|
|
|
/* try direct sound capture next */
|
2005-02-23 13:43:38 +01:00
|
|
|
if (pDirectSoundCaptureCreate) {
|
2007-01-15 15:00:39 +01:00
|
|
|
rc = (pDllGetClassObject)(&CLSID_DirectSoundCapture, &IID_IClassFactory,
|
2005-02-23 13:43:38 +01:00
|
|
|
(void **)(&pcf));
|
|
|
|
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundCapture, IID_IClassFactory) "
|
2008-07-08 17:49:20 +02:00
|
|
|
"failed: %08x\n",rc);
|
2005-02-23 13:43:38 +01:00
|
|
|
if (pcf==0)
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2005-02-23 13:43:38 +01:00
|
|
|
|
|
|
|
/* direct sound capture doesn't have an IKsPropertySet */
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
|
2005-02-23 13:43:38 +01:00
|
|
|
(void **)(&pps));
|
|
|
|
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
|
2008-07-08 17:49:20 +02:00
|
|
|
"returned E_NOINTERFACE,returned: %08x\n",rc);
|
2005-02-23 13:43:38 +01:00
|
|
|
}
|
2004-08-23 19:50:31 +02:00
|
|
|
|
|
|
|
/* and the direct sound capture 8 version */
|
2005-02-23 13:43:38 +01:00
|
|
|
if (pDirectSoundCaptureCreate8) {
|
2007-01-15 15:00:39 +01:00
|
|
|
rc = (pDllGetClassObject)(&CLSID_DirectSoundCapture8, &IID_IClassFactory,
|
2005-02-23 13:43:38 +01:00
|
|
|
(void **)(&pcf));
|
|
|
|
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundCapture8, "
|
2008-07-08 17:49:20 +02:00
|
|
|
"IID_IClassFactory) failed: %08x\n",rc);
|
2005-02-23 13:43:38 +01:00
|
|
|
if (pcf==0)
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2005-02-23 13:43:38 +01:00
|
|
|
|
|
|
|
/* direct sound capture 8 doesn't have an IKsPropertySet */
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
|
2005-02-23 13:43:38 +01:00
|
|
|
(void **)(&pps));
|
|
|
|
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
|
2008-07-08 17:49:20 +02:00
|
|
|
"returned E_NOINTERFACE, returned: %08x\n",rc);
|
2005-02-23 13:43:38 +01:00
|
|
|
}
|
2004-08-23 19:50:31 +02:00
|
|
|
|
|
|
|
/* try direct sound full duplex next */
|
2005-02-23 13:43:38 +01:00
|
|
|
if (pDirectSoundFullDuplexCreate) {
|
2007-01-15 15:00:39 +01:00
|
|
|
rc = (pDllGetClassObject)(&CLSID_DirectSoundFullDuplex, &IID_IClassFactory,
|
2005-02-23 13:43:38 +01:00
|
|
|
(void **)(&pcf));
|
|
|
|
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundFullDuplex, "
|
2008-07-08 17:49:20 +02:00
|
|
|
"IID_IClassFactory) failed: %08x\n",rc);
|
2005-02-23 13:43:38 +01:00
|
|
|
if (pcf==0)
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2005-02-23 13:43:38 +01:00
|
|
|
|
|
|
|
/* direct sound full duplex doesn't have an IKsPropertySet */
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
|
2005-02-23 13:43:38 +01:00
|
|
|
(void **)(&pps));
|
|
|
|
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
|
2008-07-08 17:49:20 +02:00
|
|
|
"returned NOINTERFACE, returned: %08x\n",rc);
|
2005-02-23 13:43:38 +01:00
|
|
|
}
|
2004-08-23 19:50:31 +02:00
|
|
|
|
|
|
|
/* try direct sound private last */
|
2007-01-15 15:00:39 +01:00
|
|
|
rc = (pDllGetClassObject)(&CLSID_DirectSoundPrivate, &IID_IClassFactory,
|
2004-08-23 19:50:31 +02:00
|
|
|
(void **)(&pcf));
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
/* some early versions of Direct Sound do not have this */
|
2007-11-12 19:32:13 +01:00
|
|
|
if (rc==CLASS_E_CLASSNOTAVAILABLE)
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2004-08-23 19:50:31 +02:00
|
|
|
|
|
|
|
/* direct sound private does have an IKsPropertySet */
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
|
2004-08-23 19:50:31 +02:00
|
|
|
(void **)(&pps));
|
2008-07-08 17:49:20 +02:00
|
|
|
ok(rc==DS_OK, "CreateInstance(IID_IKsPropertySet) failed: %08x\n",
|
|
|
|
rc);
|
2004-08-23 19:50:31 +02:00
|
|
|
if (rc!=DS_OK)
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2004-08-23 19:50:31 +02:00
|
|
|
|
2005-03-14 11:04:07 +01:00
|
|
|
/* test generic DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION */
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
|
2004-08-23 19:50:31 +02:00
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION,
|
|
|
|
&support);
|
2005-03-14 11:04:07 +01:00
|
|
|
ok(rc==DS_OK||rc==E_INVALIDARG,
|
|
|
|
"QuerySupport(DSPROPSETID_DirectSoundDevice, "
|
2008-07-08 17:49:20 +02:00
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION) failed: %08x\n",
|
|
|
|
rc);
|
2005-02-23 13:43:38 +01:00
|
|
|
if (rc!=DS_OK) {
|
|
|
|
if (rc==E_INVALIDARG)
|
|
|
|
trace(" Not Supported\n");
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2005-02-23 13:43:38 +01:00
|
|
|
}
|
2004-08-23 19:50:31 +02:00
|
|
|
|
|
|
|
ok(support & KSPROPERTY_SUPPORT_GET,
|
|
|
|
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION: "
|
2006-10-10 01:07:36 +02:00
|
|
|
"support = 0x%x\n",support);
|
2004-08-23 19:50:31 +02:00
|
|
|
ok(!(support & KSPROPERTY_SUPPORT_SET),
|
|
|
|
"Shouldn't be able to set DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION: "
|
2006-10-10 01:07:36 +02:00
|
|
|
"support = 0x%x\n",support);
|
2004-08-23 19:50:31 +02:00
|
|
|
|
2005-03-14 11:04:07 +01:00
|
|
|
/* test DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1 */
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
|
2005-03-14 11:04:07 +01:00
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1,
|
|
|
|
&support);
|
|
|
|
ok(rc==DS_OK||rc==E_INVALIDARG,
|
|
|
|
"QuerySupport(DSPROPSETID_DirectSoundDevice, "
|
2008-07-08 17:49:20 +02:00
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1) failed: %08x\n",
|
|
|
|
rc);
|
2005-03-14 11:04:07 +01:00
|
|
|
if (rc!=DS_OK) {
|
|
|
|
if (rc==E_INVALIDARG)
|
|
|
|
trace(" Not Supported\n");
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2005-03-14 11:04:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ok(support & KSPROPERTY_SUPPORT_GET,
|
|
|
|
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1: "
|
2006-10-10 01:07:36 +02:00
|
|
|
"support = 0x%x\n",support);
|
2005-03-14 11:04:07 +01:00
|
|
|
ok(!(support & KSPROPERTY_SUPPORT_SET),
|
|
|
|
"Shouldn't be able to set DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1: "
|
2006-10-10 01:07:36 +02:00
|
|
|
"support = 0x%x\n",support);
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
/* test DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A */
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
|
2005-03-14 11:04:07 +01:00
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A,
|
|
|
|
&support);
|
|
|
|
ok(rc==DS_OK||rc==E_INVALIDARG,
|
|
|
|
"QuerySupport(DSPROPSETID_DirectSoundDevice, "
|
2008-07-08 17:49:20 +02:00
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A) failed: %08x\n",
|
|
|
|
rc);
|
2005-03-14 11:04:07 +01:00
|
|
|
if (rc!=DS_OK) {
|
|
|
|
if (rc==E_INVALIDARG)
|
|
|
|
trace(" Not Supported\n");
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2005-03-14 11:04:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ok(support & KSPROPERTY_SUPPORT_GET,
|
|
|
|
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A: "
|
2006-10-10 01:07:36 +02:00
|
|
|
"support = 0x%x\n",support);
|
2005-03-14 11:04:07 +01:00
|
|
|
ok(!(support & KSPROPERTY_SUPPORT_SET),
|
|
|
|
"Shouldn't be able to set DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A: "
|
2006-10-10 01:07:36 +02:00
|
|
|
"support = 0x%x\n",support);
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
/* test DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W */
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
|
2005-03-14 11:04:07 +01:00
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W,
|
|
|
|
&support);
|
|
|
|
ok(rc==DS_OK||rc==E_INVALIDARG,
|
|
|
|
"QuerySupport(DSPROPSETID_DirectSoundDevice, "
|
2008-07-08 17:49:20 +02:00
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W) failed: %08x\n",
|
|
|
|
rc);
|
2005-03-14 11:04:07 +01:00
|
|
|
if (rc!=DS_OK) {
|
|
|
|
if (rc==E_INVALIDARG)
|
|
|
|
trace(" Not Supported\n");
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2005-03-14 11:04:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ok(support & KSPROPERTY_SUPPORT_GET,
|
|
|
|
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W: "
|
2006-10-10 01:07:36 +02:00
|
|
|
"support = 0x%x\n",support);
|
2005-03-14 11:04:07 +01:00
|
|
|
ok(!(support & KSPROPERTY_SUPPORT_SET),
|
|
|
|
"Shouldn't be able to set DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W: "
|
2006-10-10 01:07:36 +02:00
|
|
|
"support = 0x%x\n",support);
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
/* test generic DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING */
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
|
2004-08-23 19:50:31 +02:00
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING, &support);
|
|
|
|
ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
|
2008-07-08 17:49:20 +02:00
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING) failed: %08x\n",
|
|
|
|
rc);
|
2004-08-23 19:50:31 +02:00
|
|
|
if (rc!=DS_OK)
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2004-08-23 19:50:31 +02:00
|
|
|
|
|
|
|
ok(support & KSPROPERTY_SUPPORT_GET,
|
|
|
|
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING: "
|
2006-10-10 01:07:36 +02:00
|
|
|
"support = 0x%x\n",support);
|
2004-08-23 19:50:31 +02:00
|
|
|
ok(!(support & KSPROPERTY_SUPPORT_SET), "Shouldn't be able to set "
|
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING: support = "
|
2006-10-10 01:07:36 +02:00
|
|
|
"0x%x\n",support);
|
2004-08-23 19:50:31 +02:00
|
|
|
|
2005-03-14 11:04:07 +01:00
|
|
|
/* test DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A */
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
|
2005-03-14 11:04:07 +01:00
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A, &support);
|
|
|
|
ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
|
2008-07-08 17:49:20 +02:00
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A) failed: %08x\n",
|
|
|
|
rc);
|
2005-03-14 11:04:07 +01:00
|
|
|
if (rc!=DS_OK)
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
ok(support & KSPROPERTY_SUPPORT_GET,
|
|
|
|
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A: "
|
2006-10-10 01:07:36 +02:00
|
|
|
"support = 0x%x\n",support);
|
2005-03-14 11:04:07 +01:00
|
|
|
ok(!(support & KSPROPERTY_SUPPORT_SET), "Shouldn't be able to set "
|
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A: support = "
|
2006-10-10 01:07:36 +02:00
|
|
|
"0x%x\n",support);
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
/* test DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W */
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
|
2005-03-14 11:04:07 +01:00
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W, &support);
|
|
|
|
ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
|
2008-07-08 17:49:20 +02:00
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W) failed: %08x\n",
|
|
|
|
rc);
|
2005-03-14 11:04:07 +01:00
|
|
|
if (rc!=DS_OK)
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
ok(support & KSPROPERTY_SUPPORT_GET,
|
|
|
|
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W: "
|
2006-10-10 01:07:36 +02:00
|
|
|
"support = 0x%x\n",support);
|
2005-03-14 11:04:07 +01:00
|
|
|
ok(!(support & KSPROPERTY_SUPPORT_SET), "Shouldn't be able to set "
|
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W: support = "
|
2006-10-10 01:07:36 +02:00
|
|
|
"0x%x\n",support);
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
/* test generic DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE */
|
|
|
|
trace("*** Testing DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE ***\n");
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
|
2004-08-23 19:50:31 +02:00
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE,
|
|
|
|
&support);
|
|
|
|
ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
|
2008-07-08 17:49:20 +02:00
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE) failed: %08x\n",
|
|
|
|
rc);
|
2004-08-23 19:50:31 +02:00
|
|
|
if (rc!=DS_OK)
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2004-08-23 19:50:31 +02:00
|
|
|
|
|
|
|
ok(support & KSPROPERTY_SUPPORT_GET,
|
|
|
|
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE: "
|
2006-10-10 01:07:36 +02:00
|
|
|
"support = 0x%x\n",support);
|
2004-08-23 19:50:31 +02:00
|
|
|
ok(!(support & KSPROPERTY_SUPPORT_SET),"Shouldn't be able to set "
|
2006-10-10 01:07:36 +02:00
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE: support = 0x%x\n",support);
|
2004-08-23 19:50:31 +02:00
|
|
|
|
|
|
|
if (support & KSPROPERTY_SUPPORT_GET) {
|
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA data;
|
|
|
|
ULONG bytes;
|
|
|
|
|
|
|
|
data.Callback = callback;
|
|
|
|
data.Context = 0;
|
|
|
|
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IKsPropertySet_Get(pps, &DSPROPSETID_DirectSoundDevice,
|
2004-08-23 19:50:31 +02:00
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE,
|
|
|
|
NULL, 0, &data, sizeof(data), &bytes);
|
2006-10-10 01:07:36 +02:00
|
|
|
ok(rc==DS_OK, "Couldn't enumerate: 0x%x\n",rc);
|
2007-01-15 15:00:39 +01:00
|
|
|
}
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
/* test DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1 */
|
|
|
|
trace("*** Testing DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1 ***\n");
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
|
2005-03-14 11:04:07 +01:00
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1,
|
|
|
|
&support);
|
|
|
|
ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
|
2008-07-08 17:49:20 +02:00
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1) failed: %08x\n",
|
|
|
|
rc);
|
2005-03-14 11:04:07 +01:00
|
|
|
if (rc!=DS_OK)
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
ok(support & KSPROPERTY_SUPPORT_GET,
|
|
|
|
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1: "
|
2006-10-10 01:07:36 +02:00
|
|
|
"support = 0x%x\n",support);
|
2005-03-14 11:04:07 +01:00
|
|
|
ok(!(support & KSPROPERTY_SUPPORT_SET),"Shouldn't be able to set "
|
2006-10-10 01:07:36 +02:00
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1: support = 0x%x\n",support);
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
if (support & KSPROPERTY_SUPPORT_GET) {
|
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA data;
|
|
|
|
ULONG bytes;
|
|
|
|
|
|
|
|
data.Callback = callback1;
|
|
|
|
data.Context = 0;
|
|
|
|
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IKsPropertySet_Get(pps, &DSPROPSETID_DirectSoundDevice,
|
2005-03-14 11:04:07 +01:00
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1,
|
|
|
|
NULL, 0, &data, sizeof(data), &bytes);
|
2006-10-10 01:07:36 +02:00
|
|
|
ok(rc==DS_OK, "Couldn't enumerate: 0x%x\n",rc);
|
2005-03-14 11:04:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* test DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A */
|
|
|
|
trace("*** Testing DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A ***\n");
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
|
2005-03-14 11:04:07 +01:00
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A,
|
|
|
|
&support);
|
|
|
|
ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
|
2008-07-08 17:49:20 +02:00
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A) failed: %08x\n",
|
|
|
|
rc);
|
2005-03-14 11:04:07 +01:00
|
|
|
if (rc!=DS_OK)
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
ok(support & KSPROPERTY_SUPPORT_GET,
|
|
|
|
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A: "
|
2006-10-10 01:07:36 +02:00
|
|
|
"support = 0x%x\n",support);
|
2005-03-14 11:04:07 +01:00
|
|
|
ok(!(support & KSPROPERTY_SUPPORT_SET),"Shouldn't be able to set "
|
2006-10-10 01:07:36 +02:00
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A: support = 0x%x\n",support);
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
if (support & KSPROPERTY_SUPPORT_GET) {
|
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA data;
|
|
|
|
ULONG bytes;
|
|
|
|
|
|
|
|
data.Callback = callbackA;
|
|
|
|
data.Context = 0;
|
|
|
|
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IKsPropertySet_Get(pps, &DSPROPSETID_DirectSoundDevice,
|
2005-03-14 11:04:07 +01:00
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A,
|
|
|
|
NULL, 0, &data, sizeof(data), &bytes);
|
2006-10-10 01:07:36 +02:00
|
|
|
ok(rc==DS_OK, "Couldn't enumerate: 0x%x\n",rc);
|
2005-03-14 11:04:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* test DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W */
|
|
|
|
trace("*** Testing DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W ***\n");
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
|
2005-03-14 11:04:07 +01:00
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W,
|
|
|
|
&support);
|
|
|
|
ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
|
2008-07-08 17:49:20 +02:00
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W) failed: %08x\n",
|
|
|
|
rc);
|
2005-03-14 11:04:07 +01:00
|
|
|
if (rc!=DS_OK)
|
2007-01-15 15:00:39 +01:00
|
|
|
return;
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
ok(support & KSPROPERTY_SUPPORT_GET,
|
|
|
|
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W: "
|
2006-10-10 01:07:36 +02:00
|
|
|
"support = 0x%x\n",support);
|
2005-03-14 11:04:07 +01:00
|
|
|
ok(!(support & KSPROPERTY_SUPPORT_SET),"Shouldn't be able to set "
|
2006-10-10 01:07:36 +02:00
|
|
|
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W: support = 0x%x\n",support);
|
2005-03-14 11:04:07 +01:00
|
|
|
|
|
|
|
if (support & KSPROPERTY_SUPPORT_GET) {
|
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA data;
|
|
|
|
ULONG bytes;
|
|
|
|
|
|
|
|
data.Callback = callbackW;
|
|
|
|
data.Context = 0;
|
|
|
|
|
2005-09-07 15:28:25 +02:00
|
|
|
rc = IKsPropertySet_Get(pps, &DSPROPSETID_DirectSoundDevice,
|
2005-03-14 11:04:07 +01:00
|
|
|
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W,
|
|
|
|
NULL, 0, &data, sizeof(data), &bytes);
|
2006-10-10 01:07:36 +02:00
|
|
|
ok(rc==DS_OK, "Couldn't enumerate: 0x%x\n",rc);
|
2004-08-23 19:50:31 +02:00
|
|
|
}
|
2003-08-07 00:57:48 +02:00
|
|
|
}
|
|
|
|
|
2003-08-20 20:18:39 +02:00
|
|
|
static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
|
|
|
|
LPCSTR lpcstrModule, LPVOID lpContext)
|
|
|
|
{
|
|
|
|
HRESULT rc;
|
|
|
|
LPDIRECTSOUND dso=NULL;
|
|
|
|
LPDIRECTSOUNDBUFFER primary=NULL,secondary=NULL;
|
|
|
|
DSBUFFERDESC bufdesc;
|
|
|
|
WAVEFORMATEX wfx;
|
|
|
|
int ref;
|
2004-08-23 19:50:31 +02:00
|
|
|
|
|
|
|
trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule);
|
|
|
|
|
2007-01-15 15:00:39 +01:00
|
|
|
rc=pDirectSoundCreate(lpGuid,&dso,NULL);
|
2005-02-23 13:43:38 +01:00
|
|
|
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
|
2008-07-08 17:49:20 +02:00
|
|
|
"DirectSoundCreate() failed: %08x\n",rc);
|
2004-10-19 23:10:41 +02:00
|
|
|
if (rc!=DS_OK) {
|
|
|
|
if (rc==DSERR_NODRIVER)
|
|
|
|
trace(" No Driver\n");
|
2004-10-21 21:51:10 +02:00
|
|
|
else if (rc == DSERR_ALLOCATED)
|
|
|
|
trace(" Already In Use\n");
|
2005-02-23 13:43:38 +01:00
|
|
|
else if (rc == E_FAIL)
|
|
|
|
trace(" No Device\n");
|
2003-08-20 20:18:39 +02:00
|
|
|
goto EXIT;
|
2004-10-19 23:10:41 +02:00
|
|
|
}
|
2003-08-20 20:18:39 +02:00
|
|
|
|
|
|
|
/* We must call SetCooperativeLevel before calling CreateSoundBuffer */
|
|
|
|
/* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */
|
|
|
|
rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
|
2008-07-08 17:49:20 +02:00
|
|
|
ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08x\n",
|
|
|
|
rc);
|
2003-08-20 20:18:39 +02:00
|
|
|
if (rc!=DS_OK)
|
|
|
|
goto EXIT;
|
2004-08-23 19:50:31 +02:00
|
|
|
|
2003-08-20 20:18:39 +02:00
|
|
|
/* Testing 3D buffers */
|
|
|
|
primary=NULL;
|
|
|
|
ZeroMemory(&bufdesc, sizeof(bufdesc));
|
|
|
|
bufdesc.dwSize=sizeof(bufdesc);
|
|
|
|
bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_LOCHARDWARE|DSBCAPS_CTRL3D;
|
|
|
|
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
|
2008-10-23 07:18:09 +02:00
|
|
|
ok((rc==DS_OK&&primary!=NULL)
|
|
|
|
|| broken(rc==DSERR_INVALIDPARAM),
|
|
|
|
"IDirectSound_CreateSoundBuffer() failed to "
|
2008-07-08 17:49:20 +02:00
|
|
|
"create a hardware 3D primary buffer: %08x\n",rc);
|
2008-10-23 07:18:09 +02:00
|
|
|
if(rc==DSERR_INVALIDPARAM) {
|
|
|
|
skip("broken driver\n");
|
|
|
|
goto EXIT;
|
|
|
|
}
|
2003-08-20 20:18:39 +02:00
|
|
|
if (rc==DS_OK&&primary!=NULL) {
|
2004-08-23 19:50:31 +02:00
|
|
|
ZeroMemory(&wfx, sizeof(wfx));
|
|
|
|
wfx.wFormatTag=WAVE_FORMAT_PCM;
|
|
|
|
wfx.nChannels=1;
|
|
|
|
wfx.wBitsPerSample=16;
|
|
|
|
wfx.nSamplesPerSec=44100;
|
|
|
|
wfx.nBlockAlign=wfx.nChannels*wfx.wBitsPerSample/8;
|
|
|
|
wfx.nAvgBytesPerSec=wfx.nSamplesPerSec*wfx.nBlockAlign;
|
2003-08-20 20:18:39 +02:00
|
|
|
ZeroMemory(&bufdesc, sizeof(bufdesc));
|
|
|
|
bufdesc.dwSize=sizeof(bufdesc);
|
|
|
|
bufdesc.dwFlags=DSBCAPS_CTRLDEFAULT|DSBCAPS_GETCURRENTPOSITION2;
|
|
|
|
bufdesc.dwBufferBytes=wfx.nAvgBytesPerSec;
|
|
|
|
bufdesc.lpwfxFormat=&wfx;
|
2006-10-10 01:07:36 +02:00
|
|
|
trace(" Testing a secondary buffer at %dx%dx%d\n",
|
2003-08-20 20:18:39 +02:00
|
|
|
wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels);
|
|
|
|
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
|
2004-08-23 19:50:31 +02:00
|
|
|
ok(rc==DS_OK&&secondary!=NULL,"IDirectSound_CreateSoundBuffer() "
|
2008-07-08 17:49:20 +02:00
|
|
|
"failed to create a secondary buffer: %08x\n",rc);
|
2003-08-20 20:18:39 +02:00
|
|
|
if (rc==DS_OK&&secondary!=NULL) {
|
2004-08-23 19:50:31 +02:00
|
|
|
IKsPropertySet * pPropertySet=NULL;
|
|
|
|
rc=IDirectSoundBuffer_QueryInterface(secondary,
|
|
|
|
&IID_IKsPropertySet,
|
|
|
|
(void **)&pPropertySet);
|
|
|
|
/* it's not an error for this to fail */
|
|
|
|
if(rc==DS_OK) {
|
|
|
|
ULONG ulTypeSupport;
|
|
|
|
trace(" Supports property sets\n");
|
|
|
|
/* it's not an error for these to fail */
|
|
|
|
rc=IKsPropertySet_QuerySupport(pPropertySet,
|
|
|
|
&DSPROPSETID_VoiceManager,
|
|
|
|
0,&ulTypeSupport);
|
|
|
|
if((rc==DS_OK)&&(ulTypeSupport&(KSPROPERTY_SUPPORT_GET|
|
|
|
|
KSPROPERTY_SUPPORT_SET)))
|
|
|
|
trace(" DSPROPSETID_VoiceManager supported\n");
|
|
|
|
else
|
|
|
|
trace(" DSPROPSETID_VoiceManager not supported\n");
|
|
|
|
rc=IKsPropertySet_QuerySupport(pPropertySet,
|
|
|
|
&DSPROPSETID_EAX20_ListenerProperties,0,&ulTypeSupport);
|
|
|
|
if((rc==DS_OK)&&(ulTypeSupport&(KSPROPERTY_SUPPORT_GET|
|
|
|
|
KSPROPERTY_SUPPORT_SET)))
|
|
|
|
trace(" DSPROPSETID_EAX20_ListenerProperties "
|
|
|
|
"supported\n");
|
|
|
|
else
|
|
|
|
trace(" DSPROPSETID_EAX20_ListenerProperties not "
|
|
|
|
"supported\n");
|
|
|
|
rc=IKsPropertySet_QuerySupport(pPropertySet,
|
|
|
|
&DSPROPSETID_EAX20_BufferProperties,0,&ulTypeSupport);
|
|
|
|
if((rc==DS_OK)&&(ulTypeSupport&(KSPROPERTY_SUPPORT_GET|
|
|
|
|
KSPROPERTY_SUPPORT_SET)))
|
|
|
|
trace(" DSPROPSETID_EAX20_BufferProperties supported\n");
|
|
|
|
else
|
|
|
|
trace(" DSPROPSETID_EAX20_BufferProperties not "
|
|
|
|
"supported\n");
|
|
|
|
rc=IKsPropertySet_QuerySupport(pPropertySet,
|
|
|
|
&DSPROPSETID_I3DL2_ListenerProperties,0,&ulTypeSupport);
|
|
|
|
if((rc==DS_OK)&&(ulTypeSupport&(KSPROPERTY_SUPPORT_GET|
|
|
|
|
KSPROPERTY_SUPPORT_SET)))
|
|
|
|
trace(" DSPROPSETID_I3DL2_ListenerProperties "
|
|
|
|
"supported\n");
|
|
|
|
else
|
|
|
|
trace(" DSPROPSETID_I3DL2_ListenerProperties not "
|
|
|
|
"supported\n");
|
|
|
|
rc=IKsPropertySet_QuerySupport(pPropertySet,
|
|
|
|
&DSPROPSETID_I3DL2_BufferProperties,0,&ulTypeSupport);
|
|
|
|
if((rc==DS_OK)&&(ulTypeSupport&(KSPROPERTY_SUPPORT_GET|
|
|
|
|
KSPROPERTY_SUPPORT_SET)))
|
|
|
|
trace(" DSPROPSETID_I3DL2_BufferProperties supported\n");
|
|
|
|
else
|
|
|
|
trace(" DSPROPSETID_I3DL2_BufferProperties not "
|
|
|
|
"supported\n");
|
|
|
|
rc=IKsPropertySet_QuerySupport(pPropertySet,
|
|
|
|
&DSPROPSETID_ZOOMFX_BufferProperties,0,&ulTypeSupport);
|
|
|
|
if((rc==DS_OK)&&(ulTypeSupport&(KSPROPERTY_SUPPORT_GET|
|
|
|
|
KSPROPERTY_SUPPORT_SET)))
|
|
|
|
trace(" DSPROPSETID_ZOOMFX_BufferProperties "
|
|
|
|
"supported\n");
|
|
|
|
else
|
|
|
|
trace(" DSPROPSETID_ZOOMFX_BufferProperties not "
|
|
|
|
"supported\n");
|
|
|
|
ref=IKsPropertySet_Release(pPropertySet);
|
|
|
|
/* try a few common ones */
|
|
|
|
ok(ref==0,"IKsPropertySet_Release() secondary has %d "
|
|
|
|
"references, should have 0\n",ref);
|
|
|
|
} else
|
|
|
|
trace(" Doesn't support property sets\n");
|
|
|
|
|
2003-08-20 20:18:39 +02:00
|
|
|
ref=IDirectSoundBuffer_Release(secondary);
|
2004-08-23 19:50:31 +02:00
|
|
|
ok(ref==0,"IDirectSoundBuffer_Release() secondary has %d "
|
|
|
|
"references, should have 0\n",ref);
|
2003-08-20 20:18:39 +02:00
|
|
|
}
|
2004-08-23 19:50:31 +02:00
|
|
|
|
2003-08-20 20:18:39 +02:00
|
|
|
ref=IDirectSoundBuffer_Release(primary);
|
2004-08-23 19:50:31 +02:00
|
|
|
ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
|
|
|
|
"should have 0\n",ref);
|
2003-08-20 20:18:39 +02:00
|
|
|
}
|
2004-08-23 19:50:31 +02:00
|
|
|
|
2003-08-20 20:18:39 +02:00
|
|
|
EXIT:
|
|
|
|
if (dso!=NULL) {
|
|
|
|
ref=IDirectSound_Release(dso);
|
2004-08-23 19:50:31 +02:00
|
|
|
ok(ref==0,"IDirectSound_Release() has %d references, should have 0\n",
|
|
|
|
ref);
|
2003-08-20 20:18:39 +02:00
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
2004-08-23 19:50:31 +02:00
|
|
|
|
2005-06-20 16:18:03 +02:00
|
|
|
static void propset_buffer_tests(void)
|
2003-08-20 20:18:39 +02:00
|
|
|
{
|
|
|
|
HRESULT rc;
|
2007-01-15 15:00:39 +01:00
|
|
|
rc=pDirectSoundEnumerateA(&dsenum_callback,NULL);
|
2008-07-08 17:49:20 +02:00
|
|
|
ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc);
|
2003-08-20 20:18:39 +02:00
|
|
|
}
|
|
|
|
|
2003-08-07 00:57:48 +02:00
|
|
|
START_TEST(propset)
|
|
|
|
{
|
2005-02-23 13:43:38 +01:00
|
|
|
HMODULE hDsound;
|
|
|
|
|
2005-01-09 17:34:00 +01:00
|
|
|
CoInitialize(NULL);
|
|
|
|
|
2007-01-15 15:00:39 +01:00
|
|
|
hDsound = LoadLibrary("dsound.dll");
|
|
|
|
if (hDsound)
|
|
|
|
{
|
|
|
|
|
|
|
|
pDirectSoundEnumerateA = (void*)GetProcAddress(hDsound,
|
|
|
|
"DirectSoundEnumerateA");
|
|
|
|
pDllGetClassObject = (void *)GetProcAddress(hDsound,
|
|
|
|
"DllGetClassObject");
|
|
|
|
pDirectSoundCreate = (void*)GetProcAddress(hDsound,
|
|
|
|
"DirectSoundCreate");
|
|
|
|
pDirectSoundCreate8 = (void*)GetProcAddress(hDsound,
|
|
|
|
"DirectSoundCreate8");
|
|
|
|
pDirectSoundCaptureCreate=(void*)GetProcAddress(hDsound,
|
|
|
|
"DirectSoundCaptureCreate");
|
|
|
|
pDirectSoundCaptureCreate8=(void*)GetProcAddress(hDsound,
|
|
|
|
"DirectSoundCaptureCreate8");
|
|
|
|
pDirectSoundFullDuplexCreate=(void*)GetProcAddress(hDsound,
|
|
|
|
"DirectSoundFullDuplexCreate");
|
|
|
|
|
|
|
|
propset_private_tests();
|
|
|
|
propset_buffer_tests();
|
|
|
|
|
|
|
|
FreeLibrary(hDsound);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
skip("dsound.dll not found!\n");
|
2005-01-09 17:34:00 +01:00
|
|
|
|
|
|
|
CoUninitialize();
|
2003-08-07 00:57:48 +02:00
|
|
|
}
|