Fix PlaySound.

This commit is contained in:
Mike McCormack 2004-06-14 16:55:33 +00:00 committed by Alexandre Julliard
parent f28da5a844
commit 8b0b70ab50

View File

@ -68,6 +68,7 @@ static HMMIO get_mmioFromProfile(UINT uFlags, LPCWSTR lpszName)
'S','c','h','e','m','e','s','\\',
'A','p','p','s',0};
static const WCHAR wszDotDefault[] = {'.','D','e','f','a','u','l','t',0};
static const WCHAR wszDotCurrent[] = {'.','C','u','r','r','e','n','t',0};
static const WCHAR wszNull[] = {0};
TRACE("searching in SystemSound list for %s\n", debugstr_w(lpszName));
@ -101,7 +102,7 @@ static HMMIO get_mmioFromProfile(UINT uFlags, LPCWSTR lpszName)
if (*ptr == '.') *ptr = 0;
if (*ptr == '\\')
{
err = RegOpenKeyW(hRegSnd, str, &hRegApp);
err = RegOpenKeyW(hRegSnd, ptr+1, &hRegApp);
break;
}
}
@ -116,9 +117,15 @@ static HMMIO get_mmioFromProfile(UINT uFlags, LPCWSTR lpszName)
err = RegOpenKeyW(hRegApp, lpszName, &hScheme);
RegCloseKey(hRegApp);
if (err != 0) goto none;
/* what's the difference between .Current and .Default ? */
err = RegOpenKeyW(hScheme, wszDotDefault, &hSnd);
RegCloseKey(hScheme);
if (err != 0) goto none;
if (err != 0)
{
err = RegOpenKeyW(hScheme, wszDotCurrent, &hSnd);
RegCloseKey(hScheme);
if (err != 0)
goto none;
}
count = sizeof(str)/sizeof(str[0]);
err = RegQueryValueExW(hSnd, NULL, 0, &type, (LPBYTE)str, &count);
RegCloseKey(hSnd);