Commit 70c77cdf authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

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: 's avatarAkihiro Sagawa <sagawa.aki@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent d6d99e59
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment