From 5c8e83c40653b01e96b7cacd0de4dac3836207b9 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Wed, 3 Oct 2012 12:56:02 +0100 Subject: [PATCH] user32: If the value doesn't exist under the volatile key fallback to the permanent key. --- dlls/user32/sysparams.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index b27b50686ed..0fad03b0744 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -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; }