user32: If the value doesn't exist under the volatile key fallback to the permanent key.

This commit is contained in:
Huw Davies 2012-10-03 12:56:02 +01:00 committed by Alexandre Julliard
parent fb5dbd608f
commit 5c8e83c406
1 changed files with 10 additions and 3 deletions

View File

@ -622,12 +622,19 @@ static BOOL SYSPARAMS_LoadRaw( LPCWSTR lpRegKey, LPCWSTR lpValName, LPBYTE lpBuf
HKEY hKey;
memset( lpBuf, 0, count );
if ((RegOpenKeyW( get_volatile_regkey(), lpRegKey, &hKey ) == ERROR_SUCCESS) ||
(RegOpenKeyW( HKEY_CURRENT_USER, lpRegKey, &hKey ) == ERROR_SUCCESS))
if (RegOpenKeyW( get_volatile_regkey(), lpRegKey, &hKey ) == ERROR_SUCCESS)
{
ret = !RegQueryValueExW( hKey, lpValName, NULL, &type, lpBuf, &count);
ret = !RegQueryValueExW( hKey, lpValName, NULL, &type, lpBuf, &count );
RegCloseKey( hKey );
}
if (!ret && RegOpenKeyW( HKEY_CURRENT_USER, lpRegKey, &hKey ) == ERROR_SUCCESS)
{
ret = !RegQueryValueExW( hKey, lpValName, NULL, &type, lpBuf, &count );
RegCloseKey( hKey );
}
return ret;
}