Alexandre Julliard (@julliard) commented about server/registry.c:
+}
+static obj_handle_t load_app_registry( struct key *key, const char *filename, unsigned int access, unsigned int attributes ) +{
- static const WCHAR applicationhive_fullpath[] = {'\', 'R', 'E', 'G', 'I', 'S', 'T', 'R', 'Y', '\', 'A', '\'};
- WCHAR *key_fullpath;
- obj_handle_t handle = 0;
- data_size_t key_fullpath_size;
- /* check if we are loading in \REGISTRY\A */
- key_fullpath = key_get_full_name( &key->obj, &key_fullpath_size );
- if (key_fullpath_size < sizeof(applicationhive_fullpath) ||
memcmp( key_fullpath, applicationhive_fullpath, sizeof(applicationhive_fullpath) ))
- {
set_error( STATUS_PRIVILEGE_NOT_HELD );
- }
You should store a pointer to the A root key and compare with the parent pointer instead of comparing names.