winmm: MCI Close all causes one notification per open driver.

This commit is contained in:
Jörg Höhle 2009-10-19 22:14:45 +02:00 committed by Alexandre Julliard
parent c4b5bd44c0
commit 6b22861bfd
2 changed files with 9 additions and 14 deletions

View File

@ -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;
}

View File

@ -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)