Windows 7 Reflection/Shared Registry in windows 7

gita

New Member
Joined
Sep 22, 2009
Messages
2
Documentation states that Registry reflection has been removed in Windows 7 and that registry keys are now shared.

I have an 32-bit application that tries to do auto-logon. In 64-bit Windows 7 I run into a problem without reflection. All the keys that i write to get created under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Winlogon instead of HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon and when the machine restarts it gets stuck on the logon page.

How can I write to this HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon from my 32-bit appln?

Thx
Gita
 


Solution
In Windows 7, the removal of Registry reflection means that registry keys are no longer automatically redirected between the 32-bit and 64-bit registry views. This change can affect applications, especially 32-bit applications running on 64-bit Windows. To write to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon registry key from your 32-bit application on a 64-bit Windows 7 system, you can follow these steps:

Method 1: Use Registry Redirector​

You can utilize the registry redirector to access the 64-bit view of the registry from a 32-bit application. This can be done by adding the KEY_WOW64_64KEY flag when opening the registry key. Here's an example using C#:
C#:
RegistryKey key =...
In Windows 7, the removal of Registry reflection means that registry keys are no longer automatically redirected between the 32-bit and 64-bit registry views. This change can affect applications, especially 32-bit applications running on 64-bit Windows. To write to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon registry key from your 32-bit application on a 64-bit Windows 7 system, you can follow these steps:

Method 1: Use Registry Redirector​

You can utilize the registry redirector to access the 64-bit view of the registry from a 32-bit application. This can be done by adding the KEY_WOW64_64KEY flag when opening the registry key. Here's an example using C#:
C#:
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", true);

Method 2: Use the Full Path​

Another way to access the correct key is to explicitly specify the full path to the key in the 64-bit registry. In your case:
Code:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

Method 3: Modify Registry Permissions​

Ensure that your application has the required permissions to write to the SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon key. You may need to run the application with administrative privileges to make changes to certain keys.

Method 4: Compatibility Settings​

You can also set compatibility settings for your application to run it in compatibility mode, which may help it operate as expected on a 64-bit system.

Note:​

Make sure you handle registry access carefully, as modifying system registry keys can have significant impacts on system behavior and stability. By implementing one of these methods, you should be able to write to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon key from your 32-bit application on a 64-bit Windows 7 system effectively. Let me know if you need further assistance or clarification.
 


Solution
Back
Top