Maarten Lankhorst : dsound: Skip the sound checks on the primary module and change its driver module to "".
Alexandre Julliard
julliard at winehq.org
Mon Apr 21 07:46:15 CDT 2008
Module: wine
Branch: master
Commit: 6c4d9448a9d25b693693912bcb3ab0cf4274d7d3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6c4d9448a9d25b693693912bcb3ab0cf4274d7d3
Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date: Sat Apr 19 22:01:36 2008 -0700
dsound: Skip the sound checks on the primary module and change its driver module to "".
---
dlls/dsound/dsound_main.c | 9 ++++-----
dlls/dsound/tests/dsound.c | 10 ++++++++++
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c
index d7c50b8..31078cb 100644
--- a/dlls/dsound/dsound_main.c
+++ b/dlls/dsound/dsound_main.c
@@ -311,8 +311,8 @@ HRESULT WINAPI DirectSoundEnumerateA(
err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
if (err == DS_OK) {
TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n",
- "Primary Sound Driver",desc.szDrvname,lpContext);
- if (lpDSEnumCallback(NULL, "Primary Sound Driver", desc.szDrvname, lpContext) == FALSE)
+ "Primary Sound Driver","",lpContext);
+ if (lpDSEnumCallback(NULL, "Primary Sound Driver", "", lpContext) == FALSE)
return DS_OK;
}
}
@@ -367,6 +367,7 @@ HRESULT WINAPI DirectSoundEnumerateW(
devs = waveOutGetNumDevs();
if (devs > 0) {
if (GetDeviceID(&DSDEVID_DefaultPlayback, &guid) == DS_OK) {
+ static const WCHAR empty[] = { 0 };
for (wod = 0; wod < devs; ++wod) {
if (IsEqualGUID( &guid, &DSOUND_renderer_guids[wod] ) ) {
err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
@@ -375,9 +376,7 @@ HRESULT WINAPI DirectSoundEnumerateW(
"Primary Sound Driver",desc.szDrvname,lpContext);
MultiByteToWideChar( CP_ACP, 0, "Primary Sound Driver", -1,
wDesc, sizeof(wDesc)/sizeof(WCHAR) );
- MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1,
- wName, sizeof(wName)/sizeof(WCHAR) );
- if (lpDSEnumCallback(NULL, wDesc, wName, lpContext) == FALSE)
+ if (lpDSEnumCallback(NULL, wDesc, empty, lpContext) == FALSE)
return DS_OK;
}
}
diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c
index eaeb606..3a1bd18 100644
--- a/dlls/dsound/tests/dsound.c
+++ b/dlls/dsound/tests/dsound.c
@@ -1002,11 +1002,21 @@ EXIT:
return rc;
}
+static unsigned int number;
+
static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
LPCSTR lpcstrModule, LPVOID lpContext)
{
HRESULT rc;
trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule);
+
+ /* Don't test the primary device */
+ if (!number++)
+ {
+ ok (!lpcstrModule[0], "lpcstrModule(%s) != NULL\n", lpcstrModule);
+ return 1;
+ }
+
rc = test_dsound(lpGuid);
if (rc == DSERR_NODRIVER)
trace(" No Driver\n");
More information about the wine-cvs
mailing list