server: Specify the access rights when creating a registry object.

Dmitry Timoshkov dmitry at baikal.ru
Thu Jan 12 03:31:11 CST 2012


While investigating how to fix the file section access tests in kernel32 I've
found that some places in Wine deliberately create objects with access rights
set to 0, that leads to creation of potentially not accessible objects.

---
 server/registry.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/registry.c b/server/registry.c
index a144c26..7767bd9 100644
--- a/server/registry.c
+++ b/server/registry.c
@@ -1988,7 +1988,7 @@ DECL_HANDLER(delete_key)
 /* flush a registry key */
 DECL_HANDLER(flush_key)
 {
-    struct key *key = get_hkey_obj( req->hkey, 0 );
+    struct key *key = get_hkey_obj( req->hkey, KEY_QUERY_VALUE | KEY_SET_VALUE );
     if (key)
     {
         /* we don't need to do anything here with the current implementation */
@@ -2125,7 +2125,7 @@ DECL_HANDLER(unload_registry)
         return;
     }
 
-    if ((key = get_hkey_obj( req->hkey, 0 )))
+    if ((key = get_hkey_obj( req->hkey, DELETE )))
     {
         delete_key( key, 1 );     /* FIXME */
         release_object( key );
@@ -2143,7 +2143,7 @@ DECL_HANDLER(save_registry)
         return;
     }
 
-    if ((key = get_hkey_obj( req->hkey, 0 )))
+    if ((key = get_hkey_obj( req->hkey, KEY_QUERY_VALUE )))
     {
         save_registry( key, req->file );
         release_object( key );
-- 
1.7.7.4




More information about the wine-patches mailing list