<
crystal160@gmail.com>wrote ...
Quote
i am working with these,
dwMajorVersion
dwMinorVersion
dwBuildNumber
dwPlatformId
wServicePackMajor
wServicePackMinor
1) So, dwMinorVersion (1) could only be Windows XP and dwMajorVersion
(6) could only be Windows Vista or Windows Server 2008?
2) So, if I had dwMinorVersion (1) and wServicePackMajor (1) that
could only be Windows XP SP1?
3) So, if I had dwMinorVersion (1) and wServicePackMajor (2) that
could only be Windows XP SP2?
4) Would dwMajorVersion (6) and wServicePackMajor (1) be possible?
Hi Crystal,
It sounds like a trick question :-). You're saying, in effect: "I want to
examine a subset of my OSVERSIONINFOEX struct, and extrapolate the value of
other OSVERSIONINFOEX fields based on this subset". That's always going to
be risky programming: basically, it's trying to conjure information out of
thin air.
I suspect that dwMajorVersion (6) and wServicePackMajor (1) will certainly
be possible and common, once Service Pack 1 for Vista has been released.
dwMinorVersion (1) and wServicePackMajor (1) could easily prove to be an
as-yet unnanounced version of Windows like Vista R2 SP1, or similar -
there's no gurantee it will always be limited to Windows XP SP1.
Likewise, dwMinorVersion (1) and wServicePackMajor (2) may end up equalling
both XP SP2 *and* Windows Server 2008 R2, SP2. We just don't know.
We already saw huge bugs in 3rd party applications for Windows 3.1, which
did:
if (MinorVersion < 10) {
Error("This program requires Windows 3.1");
}
Windows 95 required a special comptibility fix to let all these programs
run. The programs had no technical incompatibility with Windows 95; but they
refused to run because of their broken MinorVersion check. Meanwhile, users
blasted Microsoft for "breaking compatibility".
So, my question for you is: how are you getting these dwMajorVersion, etc
values? I'm assuming that you are calling GetVersionEx() or
VerifyVersionInfo(). If you call weither of thee functions you will get a
fully populated OSVERSIONINFOEX struct. This gives you all the information
you need to determine the exact version of Windows - even versions which
don't exist yet. So, what are you trying to achieve, by manipulating a
subset of this information? What resource are you trying to conserve, while
making you application more fragile and error prove in its version checking?
--
Andrew McLaren
amclar (at) optusnet dot com dot au
-