From 8b0b70ab5081058f99b8ba505f6d9274b5aa4d05 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Mon, 14 Jun 2004 16:55:33 +0000 Subject: [PATCH] Fix PlaySound. --- dlls/winmm/playsound.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/winmm/playsound.c b/dlls/winmm/playsound.c index e73d4da6fb9..09e332aa7a4 100644 --- a/dlls/winmm/playsound.c +++ b/dlls/winmm/playsound.c @@ -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);