Question

Specifics: VC++ 7; Program works on XP, but crashes on Win7; developed using VS2003.NET (old I know but it's what I have to work with and it works fine thank you very much)

I've got a program that runs great on XP (32-bit). However, I've recently tested it with Win7 and all kinds of choas breaks loose. My strong suspicion is how my program deals with registry keys.

NOTE: The program does not create or destroy keys, only queries for keys and returns interesting values. ("Interesting" described below)

In the simplest form, the program reads data from a SCSI attached device, and saves the data to a file on the host PC. The program queries the registry for SCSI adapters and returns the adapter IDs which the program uses to access the device.

To me, it doesn't look like the registry structure has changed from XP to Win7 but not 100% sure. Any insight on that would be great :)

Also, I read at: http://www.techsupportalert.com/content/how-windows7-vista64-support-32bit-applications.htm that the way Win7 does things is like a reflection. Does this change how I should query for the key? If so, any information on how to structure the query would be great.

I think what I need to know is:

  • Is it as simple as changing the hKey (or lpValueName) in the RegQueryValueEx method?
  • Or does this mean I need to change some other aspect of the RegQueryValueEx method?
  • Or something else entirely?

Thank you in advance!

Was it helpful?

Solution

It's worth running your application through the Application Verifier on your own machine first. Of particular interest is the LuaPriv section which will highlight instances where your application is doing operations that don't play well in Vista or Win-7. This should catch any time where you might be consulting registry locations that differ from in XP.

One thing to be aware of is that if you are reading registry entries created by another application then it's possible that they might be in a different place, eg in the 32-bit or 64-bit views, or virtualised to the per-user location (this will typically happen if a process ran thinking it could write anywhere, but didn't have admin privileges, so Windows will sandbox the registry writes into the virtualised area).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top