From 5f125b6c4a747b950aaab1a44f26c5019925fbcf 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 | 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 3340f33..e4064a0 100644 --- a/dlls/winmm/tests/mci.c +++ b/dlls/winmm/tests/mci.c @@ -151,6 +151,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"; @@ -171,7 +172,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); @@ -190,10 +191,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) -- 1.5.6.3