Commit 6ad96214 authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard

- misc. tracing fixes

- handle IID_IDirectSound(8) as the default sound driver
parent 88240805
...@@ -747,8 +747,10 @@ HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID,LPDIRECTSOUND8 *ppDS,IUnknown ...@@ -747,8 +747,10 @@ HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID,LPDIRECTSOUND8 *ppDS,IUnknown
unsigned wod, wodn; unsigned wod, wodn;
HRESULT err = DSERR_INVALIDPARAM; HRESULT err = DSERR_INVALIDPARAM;
GUID devGuid; GUID devGuid;
TRACE("(%p,%p,%p)\n",lpcGUID,ippDS,pUnkOuter); BOOLEAN found = FALSE;
TRACE("(%s,%p,%p)\n",debugstr_guid(lpcGUID),ippDS,pUnkOuter);
if (ippDS == NULL) { if (ippDS == NULL) {
WARN("invalid parameter\n"); WARN("invalid parameter\n");
return DSERR_INVALIDPARAM; return DSERR_INVALIDPARAM;
...@@ -758,7 +760,10 @@ HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID,LPDIRECTSOUND8 *ppDS,IUnknown ...@@ -758,7 +760,10 @@ HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID,LPDIRECTSOUND8 *ppDS,IUnknown
setup_dsound_options(); setup_dsound_options();
/* Default device? */ /* Default device? */
if ( !lpcGUID || IsEqualGUID(lpcGUID, &GUID_NULL) ) if ( !lpcGUID ||
IsEqualGUID(lpcGUID, &GUID_NULL) ||
IsEqualGUID(lpcGUID, &IID_IDirectSound) ||
IsEqualGUID(lpcGUID, &IID_IDirectSound8))
lpcGUID = &DSDEVID_DefaultPlayback; lpcGUID = &DSDEVID_DefaultPlayback;
if (GetDeviceID(lpcGUID, &devGuid) != DS_OK) { if (GetDeviceID(lpcGUID, &devGuid) != DS_OK) {
...@@ -781,6 +786,8 @@ HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID,LPDIRECTSOUND8 *ppDS,IUnknown ...@@ -781,6 +786,8 @@ HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID,LPDIRECTSOUND8 *ppDS,IUnknown
wodn = waveOutGetNumDevs(); wodn = waveOutGetNumDevs();
if (!wodn) return DSERR_NODRIVER; if (!wodn) return DSERR_NODRIVER;
TRACE(" expecting GUID %s.\n", debugstr_guid(&devGuid));
for (wod=0; wod<wodn; wod++) { for (wod=0; wod<wodn; wod++) {
GUID guid; GUID guid;
err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)(&guid),0)); err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)(&guid),0));
...@@ -788,8 +795,10 @@ HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID,LPDIRECTSOUND8 *ppDS,IUnknown ...@@ -788,8 +795,10 @@ HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID,LPDIRECTSOUND8 *ppDS,IUnknown
WARN("waveOutMessage failed; err=%lx\n",err); WARN("waveOutMessage failed; err=%lx\n",err);
return err; return err;
} }
TRACE("got GUID %s for wod %d.\n", debugstr_guid(&guid), wod);
if (IsEqualGUID( &devGuid, &guid) ) { if (IsEqualGUID( &devGuid, &guid) ) {
err = DS_OK; err = DS_OK;
found = TRUE;
break; break;
} }
} }
...@@ -799,6 +808,11 @@ HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID,LPDIRECTSOUND8 *ppDS,IUnknown ...@@ -799,6 +808,11 @@ HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID,LPDIRECTSOUND8 *ppDS,IUnknown
return DSERR_INVALIDPARAM; return DSERR_INVALIDPARAM;
} }
if (found == FALSE) {
WARN("No device found matching given ID - trying with default one !\n");
wod = ds_default_playback;
}
/* DRV_QUERYDSOUNDIFACE is a "Wine extension" to get the DSound interface */ /* DRV_QUERYDSOUNDIFACE is a "Wine extension" to get the DSound interface */
waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0); waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0);
...@@ -994,14 +1008,14 @@ static IClassFactoryImpl DSOUND_CF = {&DSCF_Vtbl, 1 }; ...@@ -994,14 +1008,14 @@ static IClassFactoryImpl DSOUND_CF = {&DSCF_Vtbl, 1 };
*/ */
DWORD WINAPI DSOUND_DllGetClassObject(REFCLSID rclsid,REFIID riid,LPVOID *ppv) DWORD WINAPI DSOUND_DllGetClassObject(REFCLSID rclsid,REFIID riid,LPVOID *ppv)
{ {
TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if ( IsEqualCLSID( &IID_IClassFactory, riid ) ) { if ( IsEqualCLSID( &IID_IClassFactory, riid ) ) {
*ppv = (LPVOID)&DSOUND_CF; *ppv = (LPVOID)&DSOUND_CF;
IClassFactory_AddRef((IClassFactory*)*ppv); IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK; return S_OK;
} }
FIXME("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); FIXME("(%s,%s,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
return CLASS_E_CLASSNOTAVAILABLE; return CLASS_E_CLASSNOTAVAILABLE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment