[PATCH 0/4] MR218: advapi32: Implement RegRenameKey()
Alexandre Julliard (@julliard)
wine at gitlab.winehq.org
Fri Jun 10 06:24:33 CDT 2022
Alexandre Julliard (@julliard) commented about server/registry.c:
> + name.len = (get_req_data_size() / sizeof(WCHAR)) * sizeof(WCHAR);
> +
> + if (!name.len)
> + {
> + set_error( STATUS_INVALID_PARAMETER );
> + }
> + else if (!key->parent || (subkey = find_subkey( key->parent, &name, &index )))
> + {
> + set_error( STATUS_CANNOT_DELETE );
> + }
> + else if ((ptr = memdup( name.str, name.len )))
> + {
> + free( key->name );
> + key->name = ptr;
> + key->namelen = name.len;
> + }
The key needs to be properly sorted into the parent's subkey array.
You'd also need to check if the name contains a backslash, handle renaming Wow6432Node, set the dirty flag, send notifications, etc.
Basically you have to replicate most of what create_key() does.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/218#note_1823
More information about the wine-devel
mailing list