Search code examples
c#.netwinapiregistryregistrykey

Does the registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ show all subkeys


If i open this registry, and read out all subkeys, its different then my registry editor shows.

The way i open the registry and read out all subkeys :

//Get all results of the specified registery
string registry_key = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
using (Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(registry_key))
{
     foreach (string subkey_name in key.GetSubKeyNames())
     {
         using (RegistryKey subkey = key.OpenSubKey(subkey_name))
         {
             Console.WriteLine(subkey.Name);
         }
     }   
}

This gives me the output from all subkeys in this registrykey.

As example i will take one out :

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FDCFD759-BA24-F0C8-FE83-43513EE6D443}

When i check my registry editor. And search this example it isnt in the given location, but it is in :

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{FDCFD759-BA24-F0C8-FE83-43513EE6D443}

So coming to the question .....

Does the registry editor show all subkeys?

If there are any questions about my question or comments, i'd love to hear!


Solution

  • It's called "Windows on Windows", and it's by design.

    Just like Program Files and Program Files (x86), the WOW6432Node key is special. When 32-bit processes try to read from HKEY_LOCAL_MACHINE\SOFTWARE\ they are instead directed into HKEY_LOCAL_MACHINE\SOFTWARE\WoW6432Node so they they don't try to accidentally do something that is only available for 64-bit processes.