Module: wine Branch: master Commit: 6b22861bfd15cb1f712234ba613f109edee92196 URL: http://source.winehq.org/git/wine.git/?a=commit;h=6b22861bfd15cb1f712234ba61...
Author: Jörg Höhle hoehle@users.sourceforge.net Date: Mon Oct 19 22:14:45 2009 +0200
winmm: MCI Close all causes one notification per open driver.
---
dlls/winmm/mci.c | 10 +--------- dlls/winmm/tests/mci.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/dlls/winmm/mci.c b/dlls/winmm/mci.c index c6f3701..82b1de1 100644 --- a/dlls/winmm/mci.c +++ b/dlls/winmm/mci.c @@ -1676,11 +1676,8 @@ static DWORD MCI_Close(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms
TRACE("(%04x, %08X, %p)\n", wDevID, dwParam, lpParms);
+ /* Every device must handle MCI_NOTIFY on its own. */ if (wDevID == MCI_ALL_DEVICE_ID) { - /* FIXME: shall I notify once after all is done, or for - * each of the open drivers ? if the latest, which notif - * to return when only one fails ? - */ while (MciDrivers) { /* Retrieve the device ID under lock, but send the message without, * the driver might be calling some winmm functions from another @@ -1707,11 +1704,6 @@ static DWORD MCI_Close(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms
MCI_UnLoadMciDriver(wmd);
- if (dwParam & MCI_NOTIFY) - mciDriverNotify(lpParms ? (HWND)lpParms->dwCallback : 0, - wDevID, - dwRet ? MCI_NOTIFY_FAILURE : MCI_NOTIFY_SUCCESSFUL); - return dwRet; }
diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c index f5bdba0..05da6cd 100644 --- a/dlls/winmm/tests/mci.c +++ b/dlls/winmm/tests/mci.c @@ -152,6 +152,7 @@ static void test_notification1(HWND hwnd, const char* command, WPARAM type) static void test_openCloseWAVE(HWND hwnd) { MCIERROR err; + MCI_GENERIC_PARMS parm; const char command_open[] = "open new type waveaudio alias mysound"; const char command_close_my[] = "close mysound notify"; const char command_close_all[] = "close all notify"; @@ -179,7 +180,7 @@ static void test_openCloseWAVE(HWND hwnd) ok(!err,"mci %s returned error: %d\n", command_close_my, err); test_notification(hwnd, command_close_my, MCI_NOTIFY_SUCCESSFUL); Sleep(5); - todo_wine test_notification1(hwnd, command_close_my, 0); + test_notification(hwnd, command_close_my, 0);
err = mciSendString(command_close_all, NULL, 0, NULL); todo_wine ok(!err,"mci %s (without buffer) returned error: %d\n", command_close_all, err); @@ -198,10 +199,12 @@ static void test_openCloseWAVE(HWND hwnd) todo_wine ok(buf[0] == '0' && buf[1] == 0, "mci %s, expected output buffer '0', got: '%s'\n", command_sysinfo, buf);
err = mciSendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE, MCI_NOTIFY, 0); - todo_wine ok(err == MCIERR_INVALID_DEVICE_ID || - broken(!err), /* Win9x and WinMe */ - "mciSendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE, MCI_NOTIFY, 0) returned %s instead of MCIERR_INVALID_DEVICE_ID\n", - dbg_mcierr(err)); + ok(!err,"mciSendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE, MCI_NOTIFY, 0) returned %s\n", dbg_mcierr(err)); + + parm.dwCallback = (DWORD_PTR)hwnd; + err = mciSendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE, MCI_NOTIFY, (DWORD_PTR)&parm); + ok(!err,"mciSendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE, MCI_NOTIFY, hwnd) returned %s\n", dbg_mcierr(err)); + test_notification(hwnd, command_close_all, 0); /* None left */ }
static void test_recordWAVE(HWND hwnd)