Registry read on 64 bit Vista
Couple of days ago i upgraded my desktop (actually changed it) from Vista Business 32 bit to 64 bit one. Except for the fact that it provides me more memory, i was happy to dive into the world of 64 bitness.
One thing that got me aware that I'm on a new platform was a simple registry read from my web app that I'm working on. The app itself reads an registry key on startup and gets the connection string from there. But somehow, the app was not able to take the key although the key was there.
After short research i find out that since Visual Studio process devenv.exe is 32 bit process and it runs under virtualization. This is how 64bit OS handles the compatibility with 32 bit applications. And to go one step further - it also virtualizes registry.
One good point about that was to separate the same registry values that can apply to 32 bit and 64 bit versions of the same app, which I respect and I think it makes sense.
So, for all the 32 bit application, the registry key that I was looking for was not:
"HKEY_LOCAL_MACHINE\Software\MyRegKey"
but instead of that, they were in a new node that separates 32 bit virtualized registry from native 64 bit one:
"HKEY_LOCAL_MACHINE\Software\Wow6432Node\MyRegKey"
Simple as that!