tags:

views:

205

answers:

1

When GetVersionEx returns successfully on Windows XP, the dwMajorVersion field of the structure it produces is supposed to have the value 5. Under what legitimate circumstances -- running under Windows XP -- might it have the value 7?

+2  A: 

Not under legitimate circumstances.

But: The Appverifier from Microsoft often changes those fields for the apps your testing to make sure your app works on future versions of Windows correctly.

Stefan
I do have AppVerifier installed, and it's configured to touch the process in question, so I bet this is the issue. It is possible we should check for specific functionality rather than call GetVersionEx (which is what Microsoft wants and why, I presume, AppVerifier screws with GetVersionEx), but it's not yet clear to me whether it's possible to do this in the case at hand.
Integer Poet
Yup. AppVerifier was it. I turned off HighVersionLie and GetVersionEx started making sense again. You rock.
Integer Poet
The reason AppVerifier messes with GetVersionEx is to prevent apps from checking the OS version wrong. A lot of apps get this wrong and then only work on e.g. XP but refuse to do the job on Vista.
Stefan
Right. I saw that in a hundred places on the web, once I knew what to look for. Ironically, Microsoft is trying to stop people from spuriously refusing to run on new systems, but this prevents our code from doing the right thing on OLD systems. We're not looking for new functionality, we're looking for differing functionality on differing systems. On XP, one set of functionality exists, and, on Vista, another exists, and, on Windows 7, no similar functionality exists. (Does this sound like a trivia puzzle? Welcome to my world.) I filed a bug about not being able to enable HighVersionLie.
Integer Poet