diff options
author | Guy Harris <guy@alum.mit.edu> | 2005-10-04 03:15:12 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2005-10-04 03:15:12 +0000 |
commit | ead795c0e73d18b6f11d3aaa8cdcb1688c4c837b (patch) | |
tree | ce1b0c5ac8c86ba55cd4229a18e0bcf56d31c3a1 /version_info.c | |
parent | f34436d51776784700117ab356913f93c27d0757 (diff) |
Cope with NT 6.0, and with the x86-64 version of XP being NT 5.2 rather
than NT 5.1.
svn path=/trunk/; revision=16100
Diffstat (limited to 'version_info.c')
-rw-r--r-- | version_info.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/version_info.c b/version_info.c index 11a069113c..b80f43db5b 100644 --- a/version_info.c +++ b/version_info.c @@ -220,6 +220,17 @@ get_runtime_version_info(GString *str) g_string_append(str, "on "); #if defined(_WIN32) + /* + * See + * + * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getting_the_system_version.asp + * + * for more than you ever wanted to know about determining the + * flavor of Windows on which you're running. Implementing more + * of that is left as an exercise to the reader - who should + * check any copyright information about code samples on MSDN + * before cutting and pasting into Ethereal. + */ info.dwOSVersionInfoSize = sizeof info; if (!GetVersionEx(&info)) { /* @@ -292,7 +303,14 @@ get_runtime_version_info(GString *str) break; case 2: - g_string_sprintfa(str, "Windows Server 2003"); + /* + * The 64-bit version of XP is, I guess, + * built on the NT 5.2 code base. + */ + if (info.wProductType == VER_NT_WORKSTATION) + g_string_sprintfa(str, "Windows XP"); + else + g_string_sprintfa(str, "Windows Server 2003"); break; default: @@ -302,6 +320,13 @@ get_runtime_version_info(GString *str) } break; + case 6: + if (info.wProductType == VER_NT_WORKSTATION) + g_string_sprintfa(str, "Windows Vista"); + else + g_string_sprintfa(str, "Windows Server \"Longhorn\""); + break; + default: g_string_sprintfa(str, "Windows NT, unknown version %lu.%lu", info.dwMajorVersion, info.dwMinorVersion); |