0

I have an application built in C++ Builder 2010. Some config values are stored in the registry and being a 32 bit application some values are saved under Wow6432Node key.

This has worked like clockworks no matter if I run the application on WinXP, Win7, Win8... 32 or 64 bit. The application is built by a Windows 7 64 bit build agent under TeamCity.

Then all of a sudden it just stopped working. No changes to the code loading registry keys had been done. After digging around I got it to work by forcing Access of the Registry object to be KEY_WOW64_32KEY.

But that seems quite cumbersome to have to do everywhere. First try to read and if it doesn't find a value try to check in the wow key. I have looked over all code changes since it last worked and nothing touches the registry loading and I have tried reverting .cbproj files if some strange setting got enabled by mistake but to no good.

Also, building locally on a dev machine which is also a Win 7 64 bit machine it works fine.

What on earth could have happened? It's like magic :)

inquam
  • 12,664
  • 15
  • 61
  • 101

1 Answers1

0

KEY_WOW64_32KEY only applies when a 64-bit process needs to access a 32-bit key, or when a 32-bit process needs to access the 32-bit Registry of a remote 64-bit machine. That makes me wonder if your project is being compiled for 64-bit and not for 32-bit like you are expecting. When you run the app, check in Task Manager if it is actually a 32-bit or 64-bit process.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • Well, since C++ Builder 2010 doesn't support building 64-bit applications I'm pretty certain that it's 32-bit. (checked it to be sure and yes... it was 32-bit). The exact same code has worked for a very long time before just deciding to stop working :P – inquam Mar 27 '14 at 06:46
  • Then there is likely an external factor at play. Maybe something outside of the app is intercepting the app's Registry access and redirecting it. What you describe should not be possible within your app if there have been no code changes. – Remy Lebeau Mar 27 '14 at 17:19