From: Paul Gofman pgofman@codeweavers.com
--- server/registry.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/server/registry.c b/server/registry.c index aab18fc6061..507793e5ed3 100644 --- a/server/registry.c +++ b/server/registry.c @@ -99,6 +99,7 @@ struct key #define KEY_SYMLINK 0x0008 /* key is a symbolic link */ #define KEY_WOWREFLECT 0x0010 /* key is a Wow64 shared and reflected key (used for Software\Classes) */ #define KEY_PREDEF 0x0020 /* key is marked as predefined */ +#define KEY_WOWSHARE 0x0040 /* key is Wow64 shared */
#define OBJ_KEY_WOW64 0x100000 /* magic flag added to attributes for WoW64 redirection */
@@ -604,7 +605,7 @@ static int key_link_name( struct object *obj, struct object_name *name, struct o for (i = ++parent_key->last_subkey; i > index; i--) parent_key->subkeys[i] = parent_key->subkeys[i - 1]; parent_key->subkeys[index] = (struct key *)grab_object( key ); - if (is_wow6432node( name->name, name->len ) && + if (!(parent_key->flags & KEY_WOWSHARE) && is_wow6432node( name->name, name->len ) && !is_wow6432node( parent_key->obj.name->name, parent_key->obj.name->len )) parent_key->wow6432node = key; name->parent = parent; @@ -1886,13 +1887,14 @@ void init_registry(void) 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\', 'P','e','r','f','l','i','b','\', '0','0','9'}; + static const WCHAR software[] = {'S','o','f','t','w','a','r','e',}; static const struct unicode_str root_name = { REGISTRY, sizeof(REGISTRY) }; static const struct unicode_str HKLM_name = { HKLM, sizeof(HKLM) }; static const struct unicode_str HKU_name = { HKU_default, sizeof(HKU_default) }; static const struct unicode_str perflib_name = { perflib, sizeof(perflib) };
WCHAR *current_user_path; - struct unicode_str current_user_str; + struct unicode_str current_user_str, name; struct key *key, *hklm, *hkcu; unsigned int i; char *p; @@ -1944,8 +1946,6 @@ void init_registry(void) /* set the shared flag on Software\Classes\Wow6432Node for all platforms */ for (i = 1; i < supported_machines_count; i++) { - struct unicode_str name; - switch (supported_machines[i]) { case IMAGE_FILE_MACHINE_I386: name.str = classes_i386; name.len = sizeof(classes_i386); break; @@ -1957,7 +1957,15 @@ void init_registry(void) key->flags |= KEY_WOWREFLECT; release_object( key ); } - /* FIXME: handle HKCU too */ + } + + name.str = software; + name.len = sizeof(software); + if ((key = create_key_recursive( hkcu, &name, current_time ))) + { + key->flags |= KEY_WOWSHARE; + key->wow6432node = NULL; + release_object( key ); }
if ((key = create_key_recursive( hklm, &perflib_name, current_time )))