RegistryKey.CreateSubKey wierdness on x64 systems

B

Bob S

I create a subkey using RegistryKey.CreateSubKey and set a value. This
happens at design-time so I was under the impression that the key would be
created in the 32bit registry.

However, the key and its values are found in the x64 registry also.
Moreover, if I rename/delete/create values in x64 registry using x64
regedit, they are reflected in the x86, and vice versa. How is this
possible? Why does this happen?

FYI, I am running x64 regedit by typing regedit in STart-->Run
and
I am running x86 regedit by typing c:\windows\syswow64\regedit.exe -m in
Start-->Run.

I would appreciate any information on this weird behavior.

Bob S
 
W

Willy Denoyette [MVP]

Bob S said:
I create a subkey using RegistryKey.CreateSubKey and set a value. This
happens at design-time so I was under the impression that the key would be
created in the 32bit registry.

However, the key and its values are found in the x64 registry also.
Moreover, if I rename/delete/create values in x64 registry using x64
regedit, they are reflected in the x86, and vice versa. How is this
possible? Why does this happen?

FYI, I am running x64 regedit by typing regedit in STart-->Run
and
I am running x86 regedit by typing c:\windows\syswow64\regedit.exe -m in
Start-->Run.

I would appreciate any information on this weird behavior.

Bob S

This is the result of the Registry Redirector which creates separate views
for portions of the registry for 32 and 64 bit applications, but basically
there is only one Registry.
More details about Registry Reflection can be found here:
http://msdn2.microsoft.com/en-us/library/ms724072.aspx

Applications should include a manifest in order to turn off File and
Registry Virtualization, how to achieve this and much more is described in
the following:
http://download.microsoft.com/downl...-932b-38acd478f46d/WindowsVistaUACDevReqs.doc

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top