Module: wine Branch: master Commit: 6b271b6d3c4b8b155613d8b1456754dec953bcdb URL: http://source.winehq.org/git/wine.git/?a=commit;h=6b271b6d3c4b8b155613d8b145...
Author: Jörg Höhle hoehle@users.sourceforge.net Date: Wed Sep 1 21:03:43 2010 +0200
winmm: GetDeviceID only considers a single name per entry.
---
dlls/winmm/mci.c | 4 ---- dlls/winmm/tests/mci.c | 18 +++++++++++++++--- 2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/dlls/winmm/mci.c b/dlls/winmm/mci.c index b7799c8..6724d7f 100644 --- a/dlls/winmm/mci.c +++ b/dlls/winmm/mci.c @@ -127,10 +127,6 @@ static UINT MCI_GetDriverFromString(LPCWSTR lpstrName) ret = wmd->wDeviceID; break; } - if (wmd->lpstrDeviceType && strcmpiW(wmd->lpstrDeviceType, lpstrName) == 0) { - ret = wmd->wDeviceID; - break; - } } LeaveCriticalSection(&WINMM_cs);
diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c index 8adc46b..e951fbf 100644 --- a/dlls/winmm/tests/mci.c +++ b/dlls/winmm/tests/mci.c @@ -565,7 +565,7 @@ static void test_recordWAVE(HWND hwnd)
/* Only the alias is looked up. */ err = mciGetDeviceID("waveaudio"); - todo_wine ok(err==0,"mciGetDeviceID waveaudio returned %u, expected 0\n", err); + ok(err==0,"mciGetDeviceID waveaudio returned %u, expected 0\n", err);
test_notification(hwnd, "open new", MCI_NOTIFY_SUCCESSFUL); test_notification(hwnd, "open new no #2", 0); @@ -724,6 +724,15 @@ static void test_playWAVE(HWND hwnd) return; }
+ err = mciGetDeviceID("mysound"); + ok(err==1,"mciGetDeviceID mysound returned %u, expected 1\n", err); + + err = mciGetDeviceID("tempfile.wav"); + ok(err==0,"mciGetDeviceID tempfile.wav returned %u, expected 0\n", err); + + err = mciGetDeviceID("waveaudio"); + ok(err==0,"mciGetDeviceID waveaudio returned %u, expected 0\n", err); + err = mciSendString("status mysound length", buf, sizeof(buf), NULL); ok(!err,"mci status length returned %s\n", dbg_mcierr(err)); todo_wine ok(!strcmp(buf,"2000"), "mci status length gave %s, expected 2000, some tests will fail.\n", buf); @@ -852,10 +861,10 @@ static void test_asyncWAVE(HWND hwnd)
/* Only the alias is looked up. */ err = mciGetDeviceID("tempfile.wav"); - ok(err==0,"mciGetDeviceID element returned %u, expected 0\n", err); + ok(err==0,"mciGetDeviceID tempfile.wav returned %u, expected 0\n", err);
err = mciGetDeviceID("waveaudio"); - todo_wine ok(err==0,"mciGetDeviceID waveaudio returned %u, expected 0\n", err); + ok(err==0,"mciGetDeviceID waveaudio returned %u, expected 0\n", err);
err = mciSendString("status mysound mode", buf, sizeof(buf), hwnd); ok(!err,"mci status mode returned %s\n", dbg_mcierr(err)); @@ -1095,6 +1104,9 @@ static void test_AutoOpenWAVE(HWND hwnd) if(!err) ok(!strcmp(buf,"tempfile.wav"), "sysinfo name 1 open: %s\n", buf); test_notification(hwnd, "sysinfo name notify\n", MCI_NOTIFY_SUCCESSFUL);
+ err = mciGetDeviceID("tempfile.wav"); + ok(err==1,"mciGetDeviceID tempfile.wav returned %u, expected 1\n", err); + /* Save the full pathname to the file. */ err = mciSendString("info tempfile.wav file", path, sizeof(path), NULL); ok(!err,"mci info tempfile.wav file returned %s\n", dbg_mcierr(err));