Akihiro Sagawa : server: Prevent unloading a registry hive while the key is in use.

Alexandre Julliard julliard at winehq.org
Wed Feb 17 16:23:34 CST 2021


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

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Fri Feb 12 20:30:14 2021 +0900

server: Prevent unloading a registry hive while the key is in use.

Otherwise, RegUnLoadKey(HKEY_USERS, "S-1-5-21-0-0-0-1000") erases all
HKCU registry. The call is actually done by a certain installer.

Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 server/registry.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/server/registry.c b/server/registry.c
index 9b9295b1b68..74da4d1d9a4 100644
--- a/server/registry.c
+++ b/server/registry.c
@@ -2261,7 +2261,10 @@ DECL_HANDLER(unload_registry)
         get_req_path( &name, !req->parent );
         if ((key = open_key( parent, &name, access, req->attributes )))
         {
-            delete_key( key, 1 );     /* FIXME */
+            if (key->obj.handle_count)
+                set_error( STATUS_CANNOT_DELETE );
+            else
+                delete_key( key, 1 );     /* FIXME */
             release_object( key );
         }
         release_object( parent );




More information about the wine-cvs mailing list