0

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!

redhotspike
  • 1,056
  • 5
  • 17
  • 39
  • 1
    Don't you have more info then 'it crashes'? You should be able (at least with a debug build on the Win7 box) to get a better picture on where and how it is behaving differently. Specifcally which API calls fails. – rene Aug 06 '12 at 18:04
  • Ah. I'd left that part off....As of right now, I'm only allow to TEST on the Windows 7 box.... >:| part of my dilemma, but I'm working to get developer privaledges on it. Red tape *sigh* As such, I have no real debug priveledges... And due to how our admins handle things, I am unable to run the debug build on the machine-nich, huh? – redhotspike Aug 06 '12 at 18:06
  • As for the "crashing" when the user clicks on the SCSI device in program, windows complains that an error has occured and wants to know if I would like to report it...lol if only I could actually get it to report to me! lol. Anyways...the program simply closes. ...And I usually have to log of then back on to get the program to open again... – redhotspike Aug 06 '12 at 18:09
  • 1
    Maybe have a look at this: http://stackoverflow.com/questions/1547211/how-to-create-minidump-for-my-process-when-it-crashes – rene Aug 06 '12 at 18:12
  • @rene I like that - MiniDumpWriteDump method looks like it'll be a very useful tool to know. Thank you. I am still looking to find out more about the registries though. – redhotspike Aug 06 '12 at 18:22
  • Also try using Procdump - I'm not sure if you would be able to use it if you don't have the privileges, but may be worth trying: http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx – the_mandrill Aug 06 '12 at 20:48

1 Answers1

0

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).

the_mandrill
  • 29,792
  • 6
  • 64
  • 93