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.