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

Alexandre Julliard julliard at winehq.org
Wed Oct 3 13:20:36 CDT 2012


Module: wine
Branch: master
Commit: 5c8e83c40653b01e96b7cacd0de4dac3836207b9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5c8e83c40653b01e96b7cacd0de4dac3836207b9

Author: Huw Davies <huw at codeweavers.com>
Date:   Wed Oct  3 12:56:02 2012 +0100

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

---

 dlls/user32/sysparams.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c
index b27b506..0fad03b 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 );
+        RegCloseKey( hKey );
+    }
+
+    if (!ret && RegOpenKeyW( HKEY_CURRENT_USER, lpRegKey, &hKey ) == ERROR_SUCCESS)
     {
-        ret = !RegQueryValueExW( hKey, lpValName, NULL, &type, lpBuf, &count);
+        ret = !RegQueryValueExW( hKey, lpValName, NULL, &type, lpBuf, &count );
         RegCloseKey( hKey );
     }
+
     return ret;
 }
 




More information about the wine-cvs mailing list