mci: Fix some mciSendString quirks.

Really check in MCI open string commands if the name we have is a
device (and no longer rely on bad heuristics for it).
This commit is contained in:
Eric Pouech 2006-06-25 16:04:19 +02:00 committed by Alexandre Julliard
parent e9910fee66
commit 6f03b0c021
1 changed files with 4 additions and 3 deletions

View File

@ -1285,6 +1285,7 @@ DWORD WINAPI mciSendStringW(LPCWSTR lpstrCommand, LPWSTR lpstrRet,
/* Determine devType from open */ /* Determine devType from open */
if (!strcmpW(verb, wszOpen)) { if (!strcmpW(verb, wszOpen)) {
LPWSTR devType, tmp; LPWSTR devType, tmp;
WCHAR buf[128];
/* case dev == 'new' has to be handled */ /* case dev == 'new' has to be handled */
if (!strcmpW(dev, wszNew)) { if (!strcmpW(dev, wszNew)) {
@ -1310,8 +1311,9 @@ DWORD WINAPI mciSendStringW(LPCWSTR lpstrCommand, LPWSTR lpstrRet,
devType = str_dup_upper(devType); devType = str_dup_upper(devType);
dwFlags |= MCI_OPEN_ELEMENT; dwFlags |= MCI_OPEN_ELEMENT;
data[3] = (DWORD)dev; data[3] = (DWORD)dev;
} else if (strchrW(dev, '.') == NULL) { } else if (DRIVER_GetLibName(dev, wszMci, buf, sizeof(buf))) {
tmp = strchrW(dev,' '); /* this is the name of a mci driver's type */
tmp = strchrW(dev, ' ');
if (tmp) *tmp = '\0'; if (tmp) *tmp = '\0';
data[2] = (DWORD)dev; data[2] = (DWORD)dev;
devType = str_dup_upper(dev); devType = str_dup_upper(dev);
@ -1326,7 +1328,6 @@ DWORD WINAPI mciSendStringW(LPCWSTR lpstrCommand, LPWSTR lpstrRet,
if (tmp) *tmp = ' '; if (tmp) *tmp = ' ';
/* dwFlags and data[2] will be correctly set in ParseOpt loop */ /* dwFlags and data[2] will be correctly set in ParseOpt loop */
} else { } else {
WCHAR buf[32];
if ((dwRet = MCI_GetDevTypeFromFileName(dev, buf, sizeof(buf)))) if ((dwRet = MCI_GetDevTypeFromFileName(dev, buf, sizeof(buf))))
goto errCleanUp; goto errCleanUp;