Vadim's Weblog

Never stop learning.

Archive for the ‘WoW64’ Category

WoW64 and the registry.

Posted by Vadim on January 25, 2009

Technorati Tags: ,,,

Have you ever had a case that one application cannot find a registry key while another one doesn’t have any problem accessing the same entry?  It happened to me. 

If you think it’s a security issue, I have to tell you that in case it’s not security fault. 

To be fair to you I need to give some more information which I withheld from you so far.

I ran both application on 64-bit OS.  The first application, that cannot read the specific registry key, is 32-bit app. and the second one is 64-bit app.

The both application are trying to access registry using the same statement.  Something like this:

LocalMachine.OpenSubKey(@"SOFTWARE\MyCompany");

When 64-bit application executes the line above, it will try to retrieve HKLM\SOFTWARE\MyCompany subkey.  However, when 32-bit application executes the same statement on 64-bit OS, it will retrieve HKLM\SOFTWARE\Wow6432Node\MyCompany.

All 32-bit applications are executed in WoW64 (Windows-on-Windows 64-bit) subsystem.

To fix this issue, I just copy MyCompany key under Wow6432Node key.

Posted in WoW64 | 2 Comments »