Hans Leidekker : msi: Get rid of a redundant get_registry_view call.

Alexandre Julliard julliard at winehq.org
Thu Apr 18 16:41:11 CDT 2019


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue Apr 16 11:25:29 2019 +0200

msi: Get rid of a redundant get_registry_view call.

Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msi/action.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index e2f91c3..5290806 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -2922,7 +2922,7 @@ static int is_key_empty(const MSICOMPONENT *comp, HKEY root, const WCHAR *path)
     HKEY key;
     LONG res;
 
-    key = open_key(comp, root, path, FALSE, get_registry_view(comp) | KEY_READ);
+    key = open_key(comp, root, path, FALSE, KEY_READ);
     if (!key) return 0;
 
     res = RegQueryInfoKeyW(key, 0, 0, 0, &subkeys, 0, 0, &values, 0, 0, 0, 0);
@@ -2934,12 +2934,10 @@ static int is_key_empty(const MSICOMPONENT *comp, HKEY root, const WCHAR *path)
 static void delete_key( const MSICOMPONENT *comp, HKEY root, const WCHAR *path )
 {
     LONG res = ERROR_SUCCESS;
-    REGSAM access = 0;
+    REGSAM access = get_registry_view( comp );
     WCHAR *subkey, *p;
     HKEY hkey;
 
-    access |= get_registry_view( comp );
-
     if (!(subkey = strdupW( path ))) return;
     do
     {
@@ -2947,7 +2945,7 @@ static void delete_key( const MSICOMPONENT *comp, HKEY root, const WCHAR *path )
         {
             *p = 0;
             if (!p[1]) continue; /* trailing backslash */
-            hkey = open_key( comp, root, subkey, FALSE, access | READ_CONTROL );
+            hkey = open_key( comp, root, subkey, FALSE, READ_CONTROL );
             if (!hkey) break;
             if (!is_key_empty(comp, hkey, p + 1))
             {




More information about the wine-cvs mailing list