Commit 8b0b70ab authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Fix PlaySound.

parent f28da5a8
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment