From 71a0731eaff99b7eb7a52cc00b9432642ef542e5 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?J=C3=B6rg=20H=C3=B6hle?= Date: Mon, 19 Oct 2009 22:14:45 +0200 Subject: [PATCH] winmm: MCI Close all causes one notification per open driver. --- dlls/winmm/mci.c | 10 +--------- dlls/winmm/tests/mci.c | 11 ++++++----- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/dlls/winmm/mci.c b/dlls/winmm/mci.c index ac42bfb..29da12d 100644 --- a/dlls/winmm/mci.c +++ b/dlls/winmm/mci.c @@ -1764,11 +1764,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 @@ -1795,11 +1792,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 1ee466c..19e95a2 100755 --- a/dlls/winmm/tests/mci.c +++ b/dlls/winmm/tests/mci.c @@ -176,7 +176,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_notification1(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); @@ -195,10 +195,11 @@ 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)); + + err = mciSendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE, MCI_NOTIFY, hwnd); + 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) -- 1.5.6.3