Save enumerated GUIDs in a global array so they persist after
enumeration. White space cleanup. Add tests for opening default devices.
This commit is contained in:
parent
400b34493c
commit
02a8ab2fee
|
@ -80,6 +80,7 @@ static ICOM_VTABLE(IDirectSoundCaptureBuffer8) dscbvt;
|
|||
static ICOM_VTABLE(IDirectSoundFullDuplex) dsfdvt;
|
||||
|
||||
static IDirectSoundCaptureImpl* dsound_capture = NULL;
|
||||
static GUID capture_guids[MAXWAVEDRIVERS];
|
||||
|
||||
static const char * captureStateString[] = {
|
||||
"STATE_STOPPED",
|
||||
|
@ -216,11 +217,11 @@ DirectSoundCaptureEnumerateA(
|
|||
for (wid = 0; wid < devs; ++wid) {
|
||||
err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0));
|
||||
if (err == DS_OK) {
|
||||
err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)&guid,0));
|
||||
err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)&capture_guids[wid],0));
|
||||
if (err == DS_OK) {
|
||||
TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n",
|
||||
debugstr_guid(&guid),desc.szDesc,desc.szDrvName,lpContext);
|
||||
if (lpDSEnumCallback(&guid, desc.szDesc, desc.szDrvName, lpContext) == FALSE)
|
||||
debugstr_guid(&capture_guids[wid]),desc.szDesc,desc.szDrvName,lpContext);
|
||||
if (lpDSEnumCallback(&capture_guids[wid], desc.szDesc, desc.szDrvName, lpContext) == FALSE)
|
||||
return DS_OK;
|
||||
}
|
||||
}
|
||||
|
@ -289,15 +290,15 @@ DirectSoundCaptureEnumerateW(
|
|||
for (wid = 0; wid < devs; ++wid) {
|
||||
err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0));
|
||||
if (err == DS_OK) {
|
||||
err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)&guid,0));
|
||||
err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)&capture_guids[wid],0));
|
||||
if (err == DS_OK) {
|
||||
TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n",
|
||||
debugstr_guid(&DSDEVID_DefaultCapture),desc.szDesc,desc.szDrvName,lpContext);
|
||||
debugstr_guid(&capture_guids[wid]),desc.szDesc,desc.szDrvName,lpContext);
|
||||
MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1,
|
||||
wDesc, sizeof(wDesc)/sizeof(WCHAR) );
|
||||
MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1,
|
||||
wName, sizeof(wName)/sizeof(WCHAR) );
|
||||
if (lpDSEnumCallback((LPGUID)&DSDEVID_DefaultCapture, wDesc, wName, lpContext) == FALSE)
|
||||
if (lpDSEnumCallback((LPGUID)&capture_guids[wid], wDesc, wName, lpContext) == FALSE)
|
||||
return DS_OK;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,6 +86,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound);
|
|||
#define DS_SND_QUEUE_MIN 12 /* min number of fragments to prebuffer */
|
||||
|
||||
IDirectSoundImpl* dsound = NULL;
|
||||
static GUID device_guids[MAXWAVEDRIVERS];
|
||||
|
||||
HRESULT mmErr(UINT err)
|
||||
{
|
||||
|
@ -222,7 +223,7 @@ void setup_dsound_options(void)
|
|||
if (ds_snd_queue_min != DS_SND_QUEUE_MIN)
|
||||
WARN("ds_snd_queue_min = %d (default=%d)\n",ds_snd_queue_min ,DS_SND_QUEUE_MIN);
|
||||
if (ds_hw_accel != DS_HW_ACCEL_FULL)
|
||||
WARN("ds_hw_accel = %s (default=Full)\n",
|
||||
WARN("ds_hw_accel = %s (default=Full)\n",
|
||||
ds_hw_accel==DS_HW_ACCEL_FULL ? "Full" :
|
||||
ds_hw_accel==DS_HW_ACCEL_STANDARD ? "Standard" :
|
||||
ds_hw_accel==DS_HW_ACCEL_BASIC ? "Basic" :
|
||||
|
@ -234,7 +235,18 @@ void setup_dsound_options(void)
|
|||
WARN("ds_default_capture = %d (default=0)\n",ds_default_playback);
|
||||
}
|
||||
|
||||
|
||||
const char * get_device_id(LPCGUID pGuid)
|
||||
{
|
||||
if (IsEqualGUID(&DSDEVID_DefaultPlayback, pGuid))
|
||||
return "DSDEVID_DefaultPlayback";
|
||||
else if (IsEqualGUID(&DSDEVID_DefaultVoicePlayback, pGuid))
|
||||
return "DSDEVID_DefaultVoicePlayback";
|
||||
else if (IsEqualGUID(&DSDEVID_DefaultCapture, pGuid))
|
||||
return "DSDEVID_DefaultCapture";
|
||||
else if (IsEqualGUID(&DSDEVID_DefaultVoiceCapture, pGuid))
|
||||
return "DSDEVID_DefaultVoiceCapture";
|
||||
return debugstr_guid(pGuid);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
* GetDeviceID [DSOUND.9]
|
||||
|
@ -251,14 +263,14 @@ void setup_dsound_options(void)
|
|||
*
|
||||
* NOTES
|
||||
* pGuidSrc is a valid device GUID or DSDEVID_DefaultPlayback,
|
||||
* DSDEVID_DefaultCapture, DSDEVID_DefaultVoicePlayback, or
|
||||
* DSDEVID_DefaultCapture, DSDEVID_DefaultVoicePlayback, or
|
||||
* DSDEVID_DefaultVoiceCapture.
|
||||
* Returns pGuidSrc if pGuidSrc is a valid device or the device
|
||||
* GUID for the specified constants.
|
||||
*/
|
||||
HRESULT WINAPI GetDeviceID(LPCGUID pGuidSrc, LPGUID pGuidDest)
|
||||
{
|
||||
TRACE("(%p,%p)\n",pGuidSrc,pGuidDest);
|
||||
TRACE("(%s,%p)\n", get_device_id(pGuidSrc),pGuidDest);
|
||||
|
||||
if ( pGuidSrc == NULL) {
|
||||
WARN("invalid parameter: pGuidSrc == NULL\n");
|
||||
|
@ -276,6 +288,7 @@ HRESULT WINAPI GetDeviceID(LPCGUID pGuidSrc, LPGUID pGuidDest)
|
|||
int err = mmErr(waveOutMessage((HWAVEOUT)ds_default_playback,DRV_QUERYDSOUNDGUID,(DWORD)&guid,0));
|
||||
if (err == DS_OK) {
|
||||
memcpy(pGuidDest, &guid, sizeof(GUID));
|
||||
TRACE("returns %s\n", get_device_id(pGuidDest));
|
||||
return DS_OK;
|
||||
}
|
||||
}
|
||||
|
@ -286,11 +299,13 @@ HRESULT WINAPI GetDeviceID(LPCGUID pGuidSrc, LPGUID pGuidDest)
|
|||
int err = mmErr(waveInMessage((HWAVEIN)ds_default_capture,DRV_QUERYDSOUNDGUID,(DWORD)&guid,0));
|
||||
if (err == DS_OK) {
|
||||
memcpy(pGuidDest, &guid, sizeof(GUID));
|
||||
TRACE("returns %s\n", get_device_id(pGuidDest));
|
||||
return DS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(pGuidDest, pGuidSrc, sizeof(GUID));
|
||||
TRACE("returns %s\n", get_device_id(pGuidDest));
|
||||
|
||||
return DS_OK;
|
||||
}
|
||||
|
@ -350,11 +365,11 @@ HRESULT WINAPI DirectSoundEnumerateA(
|
|||
for (wod = 0; wod < devs; ++wod) {
|
||||
err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0));
|
||||
if (err == DS_OK) {
|
||||
err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)&guid,0));
|
||||
err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)&device_guids[wod],0));
|
||||
if (err == DS_OK) {
|
||||
TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n",
|
||||
debugstr_guid(&guid),desc.szDesc,desc.szDrvName,lpContext);
|
||||
if (lpDSEnumCallback(&guid, desc.szDesc, desc.szDrvName, lpContext) == FALSE)
|
||||
debugstr_guid(&device_guids[wod]),desc.szDesc,desc.szDrvName,lpContext);
|
||||
if (lpDSEnumCallback(&device_guids[wod], desc.szDesc, desc.szDrvName, lpContext) == FALSE)
|
||||
return DS_OK;
|
||||
}
|
||||
}
|
||||
|
@ -422,15 +437,15 @@ HRESULT WINAPI DirectSoundEnumerateW(
|
|||
for (wod = 0; wod < devs; ++wod) {
|
||||
err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0));
|
||||
if (err == DS_OK) {
|
||||
err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)&guid,0));
|
||||
err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)&device_guids[wod],0));
|
||||
if (err == DS_OK) {
|
||||
TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n",
|
||||
debugstr_guid(&guid),desc.szDesc,desc.szDrvName,lpContext);
|
||||
debugstr_guid(&device_guids[wod]),desc.szDesc,desc.szDrvName,lpContext);
|
||||
MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1,
|
||||
wDesc, sizeof(wDesc)/sizeof(WCHAR) );
|
||||
MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1,
|
||||
wName, sizeof(wName)/sizeof(WCHAR) );
|
||||
if (lpDSEnumCallback(&guid, wDesc, wName, lpContext) == FALSE)
|
||||
if (lpDSEnumCallback(&device_guids[wod], wDesc, wName, lpContext) == FALSE)
|
||||
return DS_OK;
|
||||
}
|
||||
}
|
||||
|
@ -523,7 +538,7 @@ DSPCF_AddRef(LPCLASSFACTORY iface) {
|
|||
return ++(This->ref);
|
||||
}
|
||||
|
||||
static ULONG WINAPI
|
||||
static ULONG WINAPI
|
||||
DSPCF_Release(LPCLASSFACTORY iface) {
|
||||
ICOM_THIS(IClassFactoryImpl,iface);
|
||||
/* static class, won't be freed */
|
||||
|
@ -531,7 +546,7 @@ DSPCF_Release(LPCLASSFACTORY iface) {
|
|||
return --(This->ref);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
static HRESULT WINAPI
|
||||
DSPCF_CreateInstance(
|
||||
LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj
|
||||
) {
|
||||
|
@ -553,7 +568,7 @@ DSPCF_CreateInstance(
|
|||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
static HRESULT WINAPI
|
||||
DSPCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
|
||||
ICOM_THIS(IClassFactoryImpl,iface);
|
||||
FIXME("(%p)->(%d),stub!\n",This,dolock);
|
||||
|
@ -610,7 +625,7 @@ DWORD WINAPI DSOUND_DllGetClassObject(REFCLSID rclsid,REFIID riid,LPVOID *ppv)
|
|||
debugstr_guid(rclsid), debugstr_guid(riid), ppv);
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
|
||||
if ( IsEqualCLSID( &CLSID_DirectSoundCapture, rclsid ) ||
|
||||
IsEqualCLSID( &CLSID_DirectSoundCapture8, rclsid ) ) {
|
||||
if ( IsEqualCLSID( &IID_IClassFactory, riid ) ) {
|
||||
|
@ -622,7 +637,7 @@ DWORD WINAPI DSOUND_DllGetClassObject(REFCLSID rclsid,REFIID riid,LPVOID *ppv)
|
|||
debugstr_guid(rclsid), debugstr_guid(riid), ppv);
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
|
||||
if ( IsEqualCLSID( &CLSID_DirectSoundFullDuplex, rclsid ) ) {
|
||||
if ( IsEqualCLSID( &IID_IClassFactory, riid ) ) {
|
||||
*ppv = (LPVOID)&DSOUND_FULLDUPLEX_CF;
|
||||
|
@ -633,7 +648,7 @@ DWORD WINAPI DSOUND_DllGetClassObject(REFCLSID rclsid,REFIID riid,LPVOID *ppv)
|
|||
debugstr_guid(rclsid), debugstr_guid(riid), ppv);
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
|
||||
if ( IsEqualCLSID( &CLSID_DirectSoundPrivate, rclsid ) ) {
|
||||
if ( IsEqualCLSID( &IID_IClassFactory, riid ) ) {
|
||||
*ppv = (LPVOID)&DSOUND_PRIVATE_CF;
|
||||
|
@ -651,7 +666,7 @@ DWORD WINAPI DSOUND_DllGetClassObject(REFCLSID rclsid,REFIID riid,LPVOID *ppv)
|
|||
|
||||
|
||||
/*******************************************************************************
|
||||
* DllCanUnloadNow [DSOUND.4]
|
||||
* DllCanUnloadNow [DSOUND.4]
|
||||
* Determines whether the DLL is in use.
|
||||
*
|
||||
* RETURNS
|
||||
|
|
|
@ -491,3 +491,4 @@ extern IDirectSoundImpl* dsound;
|
|||
|
||||
extern HRESULT mmErr(UINT err);
|
||||
extern void setup_dsound_options(void);
|
||||
extern const char * get_device_id(LPCGUID pGuid);
|
||||
|
|
|
@ -50,6 +50,7 @@ static void dsound_dsound_tests()
|
|||
IDirectSound * ds;
|
||||
IDirectSound8 * ds8;
|
||||
|
||||
/* try the COM class factory method of creation */
|
||||
rc=CoCreateInstance(&CLSID_DirectSound, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSound, (void**)&dso);
|
||||
ok(rc==S_OK,"CoCreateInstance failed: %s\n",DXGetErrorString9(rc));
|
||||
if (dso) {
|
||||
|
@ -101,8 +102,99 @@ static void dsound_dsound_tests()
|
|||
ok(ref==0,"IDirectSound_Release has %d references, should have 0\n",ref);
|
||||
}
|
||||
|
||||
/* try with no device specified */
|
||||
rc=DirectSoundCreate(NULL,&dso,NULL);
|
||||
ok(rc==S_OK,"DirectSoundCreate failed: %s\n",DXGetErrorString9(rc));
|
||||
ok(rc==S_OK,"DirectSoundCreate(NULL) failed: %s\n",DXGetErrorString9(rc));
|
||||
if (dso) {
|
||||
/* Try to Query for objects */
|
||||
rc=IDirectSound_QueryInterface(dso,&IID_IUnknown,(LPVOID*)&unknown);
|
||||
ok(rc==DS_OK,"IDirectSound_QueryInterface(IID_IUnknown) failed: %s\n",DXGetErrorString9(rc));
|
||||
if (rc==DS_OK)
|
||||
IDirectSound_Release(unknown);
|
||||
|
||||
rc=IDirectSound_QueryInterface(dso,&IID_IDirectSound,(LPVOID*)&ds);
|
||||
ok(rc==DS_OK,"IDirectSound_QueryInterface(IID_IDirectSound) failed: %s\n",DXGetErrorString9(rc));
|
||||
if (rc==DS_OK)
|
||||
IDirectSound_Release(ds);
|
||||
|
||||
rc=IDirectSound_QueryInterface(dso,&IID_IDirectSound8,(LPVOID*)&ds8);
|
||||
ok(rc==E_NOINTERFACE,"IDirectSound_QueryInterface(IID_IDirectSound8) should have failed: %s\n",DXGetErrorString9(rc));
|
||||
if (rc==DS_OK)
|
||||
IDirectSound8_Release(ds8);
|
||||
|
||||
/* DSOUND: Error: Invalid caps buffer */
|
||||
rc=IDirectSound_GetCaps(dso,0);
|
||||
ok(rc==DSERR_INVALIDPARAM,"GetCaps should have failed: %s\n",DXGetErrorString9(rc));
|
||||
|
||||
ZeroMemory(&dscaps, sizeof(dscaps));
|
||||
|
||||
/* DSOUND: Error: Invalid caps buffer */
|
||||
rc=IDirectSound_GetCaps(dso,&dscaps);
|
||||
ok(rc==DSERR_INVALIDPARAM,"GetCaps should have failed: %s\n",DXGetErrorString9(rc));
|
||||
|
||||
dscaps.dwSize=sizeof(dscaps);
|
||||
|
||||
/* DSOUND: Running on a certified driver */
|
||||
rc=IDirectSound_GetCaps(dso,&dscaps);
|
||||
ok(rc==DS_OK,"GetCaps failed: %s\n",DXGetErrorString9(rc));
|
||||
if (rc==DS_OK) {
|
||||
trace(" DirectSound Caps: flags=0x%08lx secondary min=%ld max=%ld\n",
|
||||
dscaps.dwFlags,dscaps.dwMinSecondarySampleRate,
|
||||
dscaps.dwMaxSecondarySampleRate);
|
||||
}
|
||||
|
||||
ref=IDirectSound_Release(dso);
|
||||
ok(ref==0,"IDirectSound_Release has %d references, should have 0\n",ref);
|
||||
}
|
||||
|
||||
/* try with default playback device specified */
|
||||
rc=DirectSoundCreate(&DSDEVID_DefaultPlayback,&dso,NULL);
|
||||
ok(rc==S_OK,"DirectSoundCreate(DSDEVID_DefaultPlayback) failed: %s\n",DXGetErrorString9(rc));
|
||||
if (dso) {
|
||||
/* Try to Query for objects */
|
||||
rc=IDirectSound_QueryInterface(dso,&IID_IUnknown,(LPVOID*)&unknown);
|
||||
ok(rc==DS_OK,"IDirectSound_QueryInterface(IID_IUnknown) failed: %s\n",DXGetErrorString9(rc));
|
||||
if (rc==DS_OK)
|
||||
IDirectSound_Release(unknown);
|
||||
|
||||
rc=IDirectSound_QueryInterface(dso,&IID_IDirectSound,(LPVOID*)&ds);
|
||||
ok(rc==DS_OK,"IDirectSound_QueryInterface(IID_IDirectSound) failed: %s\n",DXGetErrorString9(rc));
|
||||
if (rc==DS_OK)
|
||||
IDirectSound_Release(ds);
|
||||
|
||||
rc=IDirectSound_QueryInterface(dso,&IID_IDirectSound8,(LPVOID*)&ds8);
|
||||
ok(rc==E_NOINTERFACE,"IDirectSound_QueryInterface(IID_IDirectSound8) should have failed: %s\n",DXGetErrorString9(rc));
|
||||
if (rc==DS_OK)
|
||||
IDirectSound8_Release(ds8);
|
||||
|
||||
/* DSOUND: Error: Invalid caps buffer */
|
||||
rc=IDirectSound_GetCaps(dso,0);
|
||||
ok(rc==DSERR_INVALIDPARAM,"GetCaps should have failed: %s\n",DXGetErrorString9(rc));
|
||||
|
||||
ZeroMemory(&dscaps, sizeof(dscaps));
|
||||
|
||||
/* DSOUND: Error: Invalid caps buffer */
|
||||
rc=IDirectSound_GetCaps(dso,&dscaps);
|
||||
ok(rc==DSERR_INVALIDPARAM,"GetCaps should have failed: %s\n",DXGetErrorString9(rc));
|
||||
|
||||
dscaps.dwSize=sizeof(dscaps);
|
||||
|
||||
/* DSOUND: Running on a certified driver */
|
||||
rc=IDirectSound_GetCaps(dso,&dscaps);
|
||||
ok(rc==DS_OK,"GetCaps failed: %s\n",DXGetErrorString9(rc));
|
||||
if (rc==DS_OK) {
|
||||
trace(" DirectSound Caps: flags=0x%08lx secondary min=%ld max=%ld\n",
|
||||
dscaps.dwFlags,dscaps.dwMinSecondarySampleRate,
|
||||
dscaps.dwMaxSecondarySampleRate);
|
||||
}
|
||||
|
||||
ref=IDirectSound_Release(dso);
|
||||
ok(ref==0,"IDirectSound_Release has %d references, should have 0\n",ref);
|
||||
}
|
||||
|
||||
/* try with default voice playback device specified */
|
||||
rc=DirectSoundCreate(&DSDEVID_DefaultVoicePlayback,&dso,NULL);
|
||||
ok(rc==S_OK,"DirectSoundCreate(DSDEVID_DefaultVoicePlayback) failed: %s\n",DXGetErrorString9(rc));
|
||||
if (dso) {
|
||||
/* Try to Query for objects */
|
||||
rc=IDirectSound_QueryInterface(dso,&IID_IUnknown,(LPVOID*)&unknown);
|
||||
|
@ -156,6 +248,7 @@ static void dsound_dsound8_tests()
|
|||
IDirectSound * ds;
|
||||
IDirectSound8 * ds8;
|
||||
|
||||
/* try the COM class factory method of creation */
|
||||
rc=CoCreateInstance(&CLSID_DirectSound8, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSound8, (void**)&dso);
|
||||
ok(rc==S_OK,"CoCreateInstance failed: %s\n",DXGetErrorString9(rc));
|
||||
if (dso) {
|
||||
|
@ -207,6 +300,7 @@ static void dsound_dsound8_tests()
|
|||
ok(ref==0,"IDirectSound8_Release has %d references, should have 0\n",ref);
|
||||
}
|
||||
|
||||
/* try with no device specified */
|
||||
rc=DirectSoundCreate8(NULL,&dso,NULL);
|
||||
ok(rc==S_OK,"DirectSoundCreate8 failed: %s\n",DXGetErrorString9(rc));
|
||||
if (dso) {
|
||||
|
@ -250,6 +344,96 @@ static void dsound_dsound8_tests()
|
|||
ref=IDirectSound8_Release(dso);
|
||||
ok(ref==0,"IDirectSound_Release has %d references, should have 0\n",ref);
|
||||
}
|
||||
|
||||
/* try with default playback device specified */
|
||||
rc=DirectSoundCreate8(&DSDEVID_DefaultPlayback,&dso,NULL);
|
||||
ok(rc==S_OK,"DirectSoundCreate8 failed: %s\n",DXGetErrorString9(rc));
|
||||
if (dso) {
|
||||
/* Try to Query for objects */
|
||||
rc=IDirectSound8_QueryInterface(dso,&IID_IUnknown,(LPVOID*)&unknown);
|
||||
ok(rc==DS_OK,"IDirectSound8_QueryInterface(IID_IUnknown) failed: %s\n",DXGetErrorString9(rc));
|
||||
if (rc==DS_OK)
|
||||
IDirectSound8_Release(unknown);
|
||||
|
||||
rc=IDirectSound8_QueryInterface(dso,&IID_IDirectSound,(LPVOID*)&ds);
|
||||
ok(rc==DS_OK,"IDirectSound8_QueryInterface(IID_IDirectSound) failed: %s\n",DXGetErrorString9(rc));
|
||||
if (rc==DS_OK)
|
||||
IDirectSound_Release(ds);
|
||||
|
||||
rc=IDirectSound8_QueryInterface(dso,&IID_IDirectSound8,(LPVOID*)&ds8);
|
||||
ok(rc==DS_OK,"IDirectSound8_QueryInterface(IID_IDirectSound8) should have failed: %s\n",DXGetErrorString9(rc));
|
||||
if (rc==DS_OK)
|
||||
IDirectSound8_Release(ds8);
|
||||
|
||||
/* DSOUND: Error: Invalid caps buffer */
|
||||
rc=IDirectSound8_GetCaps(dso,0);
|
||||
ok(rc==DSERR_INVALIDPARAM,"GetCaps should have failed: %s\n",DXGetErrorString9(rc));
|
||||
|
||||
ZeroMemory(&dscaps, sizeof(dscaps));
|
||||
|
||||
/* DSOUND: Error: Invalid caps buffer */
|
||||
rc=IDirectSound8_GetCaps(dso,&dscaps);
|
||||
ok(rc==DSERR_INVALIDPARAM,"GetCaps should have failed: %s\n",DXGetErrorString9(rc));
|
||||
|
||||
dscaps.dwSize=sizeof(dscaps);
|
||||
|
||||
/* DSOUND: Running on a certified driver */
|
||||
rc=IDirectSound8_GetCaps(dso,&dscaps);
|
||||
ok(rc==DS_OK,"GetCaps failed: %s\n",DXGetErrorString9(rc));
|
||||
if (rc==DS_OK) {
|
||||
trace(" DirectSound Caps: flags=0x%08lx secondary min=%ld max=%ld\n",
|
||||
dscaps.dwFlags,dscaps.dwMinSecondarySampleRate,
|
||||
dscaps.dwMaxSecondarySampleRate);
|
||||
}
|
||||
|
||||
ref=IDirectSound8_Release(dso);
|
||||
ok(ref==0,"IDirectSound_Release has %d references, should have 0\n",ref);
|
||||
}
|
||||
|
||||
/* try with default voice playback device specified */
|
||||
rc=DirectSoundCreate8(&DSDEVID_DefaultVoicePlayback,&dso,NULL);
|
||||
ok(rc==S_OK,"DirectSoundCreate8 failed: %s\n",DXGetErrorString9(rc));
|
||||
if (dso) {
|
||||
/* Try to Query for objects */
|
||||
rc=IDirectSound8_QueryInterface(dso,&IID_IUnknown,(LPVOID*)&unknown);
|
||||
ok(rc==DS_OK,"IDirectSound8_QueryInterface(IID_IUnknown) failed: %s\n",DXGetErrorString9(rc));
|
||||
if (rc==DS_OK)
|
||||
IDirectSound8_Release(unknown);
|
||||
|
||||
rc=IDirectSound8_QueryInterface(dso,&IID_IDirectSound,(LPVOID*)&ds);
|
||||
ok(rc==DS_OK,"IDirectSound8_QueryInterface(IID_IDirectSound) failed: %s\n",DXGetErrorString9(rc));
|
||||
if (rc==DS_OK)
|
||||
IDirectSound_Release(ds);
|
||||
|
||||
rc=IDirectSound8_QueryInterface(dso,&IID_IDirectSound8,(LPVOID*)&ds8);
|
||||
ok(rc==DS_OK,"IDirectSound8_QueryInterface(IID_IDirectSound8) should have failed: %s\n",DXGetErrorString9(rc));
|
||||
if (rc==DS_OK)
|
||||
IDirectSound8_Release(ds8);
|
||||
|
||||
/* DSOUND: Error: Invalid caps buffer */
|
||||
rc=IDirectSound8_GetCaps(dso,0);
|
||||
ok(rc==DSERR_INVALIDPARAM,"GetCaps should have failed: %s\n",DXGetErrorString9(rc));
|
||||
|
||||
ZeroMemory(&dscaps, sizeof(dscaps));
|
||||
|
||||
/* DSOUND: Error: Invalid caps buffer */
|
||||
rc=IDirectSound8_GetCaps(dso,&dscaps);
|
||||
ok(rc==DSERR_INVALIDPARAM,"GetCaps should have failed: %s\n",DXGetErrorString9(rc));
|
||||
|
||||
dscaps.dwSize=sizeof(dscaps);
|
||||
|
||||
/* DSOUND: Running on a certified driver */
|
||||
rc=IDirectSound8_GetCaps(dso,&dscaps);
|
||||
ok(rc==DS_OK,"GetCaps failed: %s\n",DXGetErrorString9(rc));
|
||||
if (rc==DS_OK) {
|
||||
trace(" DirectSound Caps: flags=0x%08lx secondary min=%ld max=%ld\n",
|
||||
dscaps.dwFlags,dscaps.dwMinSecondarySampleRate,
|
||||
dscaps.dwMaxSecondarySampleRate);
|
||||
}
|
||||
|
||||
ref=IDirectSound8_Release(dso);
|
||||
ok(ref==0,"IDirectSound_Release has %d references, should have 0\n",ref);
|
||||
}
|
||||
}
|
||||
|
||||
static HRESULT test_dsound(LPGUID lpGuid)
|
||||
|
|
Loading…
Reference in New Issue