If you’re checking for Windows 9 in order to disable features, which is what the jump straight to ten was supposed to protect against (when running a 16-bit binary for 3.1/95 on 32-bit Windows 10, it lies and says it’s Windows 98), then you’re using at least the Windows 2000 SDK, which provided GetVersion, which includes the build and revision numbers in its return value, and the revision number was increased over 7000 times by updates to Windows 2000.
Ya, that is what I thought, but skipped because I couldn’t remember for sure. GetVersion didn’t even exist until win2k, so everyone already had their code that checked version numbers written and squared away. They never needed to go back and change it or read the new documentation.
I then looked at a manual for the Windows 1.03 SDK, and it, too, has a matching GetVersion function.
The only change to GetVersion over the entire history of Windows is that at some point it switched from returning a sixteen bit value with eight bits for the major version and eight bits for the minor version to a 32-bit value with bits split between major, build number and minor versions, and then later on, GetVersionEx was added to return those numbers as members of a struct instead. There has never been a version of Windows where string comparisons of the display name were appropriate or recommended by Microsoft.
If you’re checking for
Windows 9in order to disable features, which is what the jump straight to ten was supposed to protect against (when running a 16-bit binary for 3.1/95 on 32-bit Windows 10, it lies and says it’s Windows 98), then you’re using at least the Windows 2000 SDK, which providedGetVersion, which includes the build and revision numbers in its return value, and the revision number was increased over 7000 times by updates to Windows 2000.Ya, that is what I thought, but skipped because I couldn’t remember for sure. GetVersion didn’t even exist until win2k, so everyone already had their code that checked version numbers written and squared away. They never needed to go back and change it or read the new documentation.
I dug up a manual for the Windows 3.1 SDK, and it turns out that it had the same
GetVersionfunction with the same return value as the Windows 2000 SDK, and it’s just that the live MSDN docs pretend that Windows 2000 was the first version of Windows, so show that as the earliest version that every function that came from an older version of Windows. http://bitsavers.informatik.uni-stuttgart.de/pdf/microsoft/windows_3.1/Microsoft_Windows_3.1_SDK_1992/PC28914-0492_Windows_3.1_SDK_Getting_Started_199204.pdf page 31.I then looked at a manual for the Windows 1.03 SDK, and it, too, has a matching
GetVersionfunction.The only change to
GetVersionover the entire history of Windows is that at some point it switched from returning a sixteen bit value with eight bits for the major version and eight bits for the minor version to a 32-bit value with bits split between major, build number and minor versions, and then later on,GetVersionExwas added to return those numbers as members of a struct instead. There has never been a version of Windows where string comparisons of the display name were appropriate or recommended by Microsoft.