1
votes

I try to access a specific registry key that i know exist. I use this way:

 RegistryKey rk = Registry.LocalMachine; 
 RegistryKey sk1 = rk.OpenSubKey(KeyName,false);

if i replace 'KeyName' with @"Software\Microsoft\Windows\CurrentVersion\Run", for example, it works fine.
if i try any other path that i copy pasted from regedit for exmple @"SOFTWARE\ATI Technologies\Install\South Bridge\ATI_AHCI_RAID" it return null.

I'm workiung on win7 64-bit with an x86 program

1

1 Answers

3
votes

In Windows 64-bit (Windows 2003+, XP and later 64-bit) there is a transparent registry redirection happening to provide separate logical views for 32-bit and 64-bit registry calls.

Read the link below for more information; it is important information to know.

The registry redirector isolates 32-bit and 64-bit applications by providing separate logical views of certain portions of the registry on WOW64. The registry redirector intercepts 32-bit and 64-bit registry calls to their respective logical registry views and maps them to the corresponding physical registry location. The redirection process is transparent to the application. Therefore, a 32-bit application can access registry data as if it were running on 32-bit Windows even if the data is stored in a different location on 64-bit Windows.

MSDN Registry Redirector