2 * Routines to report version information for stuff used by Wireshark
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
33 #include <zlib.h> /* to get the libz version number */
36 #ifdef HAVE_SYS_UTSNAME_H
37 #include <sys/utsname.h>
40 #include "version_info.h"
41 #include "capture-pcap-util.h"
42 #include <wsutil/unicode-utils.h>
50 #ifdef HAVE_OS_X_FRAMEWORKS
51 #include <CoreFoundation/CoreFoundation.h>
56 # include <sys/capability.h>
60 const char *wireshark_gitversion = " (" GITVERSION " from " GITBRANCH ")";
62 const char *wireshark_gitversion = "";
66 * If the string doesn't end with a newline, append one.
67 * Then word-wrap it to 80 columns.
70 end_string(GString *str)
76 if (point == 0 || str->str[point - 1] != '\n')
77 g_string_append(str, "\n");
83 * Break at or before this point.
86 while (q > p && *q != ' ')
96 * Get various library compile-time versions and append them to
97 * the specified GString.
99 * "additional_info" is called at the end to append any additional
100 * information; this is required in order to, for example, put the
101 * Portaudio information at the end of the string, as we currently
102 * don't use Portaudio in TShark.
105 get_compiled_version_info(GString *str, void (*prepend_info)(GString *),
106 void (*append_info)(GString *))
108 if (sizeof(str) == 4)
109 g_string_append(str, "(32-bit) ");
111 g_string_append(str, "(64-bit) ");
114 (*prepend_info)(str);
117 g_string_append(str, "with ");
118 g_string_append_printf(str,
119 #ifdef GLIB_MAJOR_VERSION
120 "GLib %d.%d.%d", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION,
123 "GLib (version unknown)");
127 g_string_append(str, ", ");
128 get_compiled_pcap_version(str);
131 g_string_append(str, ", ");
133 g_string_append(str, "with libz ");
135 g_string_append(str, ZLIB_VERSION);
136 #else /* ZLIB_VERSION */
137 g_string_append(str, "(version unknown)");
138 #endif /* ZLIB_VERSION */
139 #else /* HAVE_LIBZ */
140 g_string_append(str, "without libz");
141 #endif /* HAVE_LIBZ */
144 /* This is UN*X-only. */
146 g_string_append(str, ", ");
148 g_string_append(str, "with POSIX capabilities");
149 #ifdef _LINUX_CAPABILITY_VERSION
150 g_string_append(str, " (Linux)");
151 #endif /* _LINUX_CAPABILITY_VERSION */
152 #else /* HAVE_LIBCAP */
153 g_string_append(str, "without POSIX capabilities");
154 #endif /* HAVE_LIBCAP */
158 /* This is a Linux-specific library. */
160 g_string_append(str, ", ");
161 #if defined(HAVE_LIBNL1)
162 g_string_append(str, "with libnl 1");
163 #elif defined(HAVE_LIBNL2)
164 g_string_append(str, "with libnl 2");
165 #elif defined(HAVE_LIBNL3)
166 g_string_append(str, "with libnl 3");
168 g_string_append(str, "without libnl");
169 #endif /* libnl version */
170 #endif /* __linux__ */
172 /* Additional application-dependent information */
175 g_string_append(str, ".");
181 typedef void (WINAPI *nativesi_func_ptr)(LPSYSTEM_INFO);
185 * Handles the rather elaborate process of getting OS version information
186 * from OS X (we want the OS X version, not the Darwin version, the latter
187 * being easy to get with uname()).
189 #ifdef HAVE_OS_X_FRAMEWORKS
192 * Fetch a string, as a UTF-8 C string, from a dictionary, given a key.
195 get_string_from_dictionary(CFPropertyListRef dict, CFStringRef key)
197 CFStringRef cfstring;
199 cfstring = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)dict,
201 if (cfstring == NULL)
203 if (CFGetTypeID(cfstring) != CFStringGetTypeID()) {
204 /* It isn't a string. Punt. */
207 return CFString_to_C_string(cfstring);
211 * Get the OS X version information, and append it to the GString.
212 * Return TRUE if we succeed, FALSE if we fail.
215 get_os_x_version_info(GString *str)
217 static const UInt8 server_version_plist_path[] =
218 "/System/Library/CoreServices/ServerVersion.plist";
219 static const UInt8 system_version_plist_path[] =
220 "/System/Library/CoreServices/SystemVersion.plist";
221 CFURLRef version_plist_file_url;
222 CFReadStreamRef version_plist_stream;
223 CFDictionaryRef version_dict;
227 * On OS X, report the OS X version number as the OS, and put
228 * the Darwin information in parentheses.
230 * Alas, Gestalt() is deprecated in Mountain Lion, so the build
231 * fails if you treat deprecation warnings as fatal. I don't
232 * know of any replacement API, so we fall back on reading
233 * /System/Library/CoreServices/ServerVersion.plist if it
234 * exists, otherwise /System/Library/CoreServices/SystemVersion.plist,
235 * and using ProductUserVisibleVersion. We also get the build
236 * version from ProductBuildVersion and the product name from
239 version_plist_file_url = CFURLCreateFromFileSystemRepresentation(NULL,
240 server_version_plist_path, sizeof server_version_plist_path - 1,
242 if (version_plist_file_url == NULL)
244 version_plist_stream = CFReadStreamCreateWithFile(NULL,
245 version_plist_file_url);
246 CFRelease(version_plist_file_url);
247 if (version_plist_stream == NULL)
249 if (!CFReadStreamOpen(version_plist_stream)) {
250 CFRelease(version_plist_stream);
253 * Try SystemVersion.plist.
255 version_plist_file_url = CFURLCreateFromFileSystemRepresentation(NULL,
256 system_version_plist_path, sizeof system_version_plist_path - 1,
258 if (version_plist_file_url == NULL)
260 version_plist_stream = CFReadStreamCreateWithFile(NULL,
261 version_plist_file_url);
262 CFRelease(version_plist_file_url);
263 if (version_plist_stream == NULL)
265 if (!CFReadStreamOpen(version_plist_stream)) {
266 CFRelease(version_plist_stream);
270 #ifdef HAVE_CFPROPERTYLISTCREATEWITHSTREAM
271 version_dict = (CFDictionaryRef)CFPropertyListCreateWithStream(NULL,
272 version_plist_stream, 0, kCFPropertyListImmutable,
275 version_dict = (CFDictionaryRef)CFPropertyListCreateFromStream(NULL,
276 version_plist_stream, 0, kCFPropertyListImmutable,
279 if (version_dict == NULL) {
280 CFRelease(version_plist_stream);
283 if (CFGetTypeID(version_dict) != CFDictionaryGetTypeID()) {
284 /* This is *supposed* to be a dictionary. Punt. */
285 CFRelease(version_dict);
286 CFReadStreamClose(version_plist_stream);
287 CFRelease(version_plist_stream);
290 /* Get the product name string. */
291 string = get_string_from_dictionary(version_dict,
292 CFSTR("ProductName"));
293 if (string == NULL) {
294 CFRelease(version_dict);
295 CFReadStreamClose(version_plist_stream);
296 CFRelease(version_plist_stream);
299 g_string_append_printf(str, "%s", string);
302 /* Get the OS version string. */
303 string = get_string_from_dictionary(version_dict,
304 CFSTR("ProductUserVisibleVersion"));
305 if (string == NULL) {
306 CFRelease(version_dict);
307 CFReadStreamClose(version_plist_stream);
308 CFRelease(version_plist_stream);
311 g_string_append_printf(str, " %s", string);
314 /* Get the build string */
315 string = get_string_from_dictionary(version_dict,
316 CFSTR("ProductBuildVersion"));
317 if (string == NULL) {
318 CFRelease(version_dict);
319 CFReadStreamClose(version_plist_stream);
320 CFRelease(version_plist_stream);
323 g_string_append_printf(str, ", build %s", string);
325 CFRelease(version_dict);
326 CFReadStreamClose(version_plist_stream);
327 CFRelease(version_plist_stream);
333 * Get the OS version, and append it to the GString
335 void get_os_version_info(GString *str)
338 OSVERSIONINFOEX info;
339 SYSTEM_INFO system_info;
340 nativesi_func_ptr nativesi_func;
341 #elif defined(HAVE_SYS_UTSNAME_H)
349 * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getting_the_system_version.asp
351 * for more than you ever wanted to know about determining the
352 * flavor of Windows on which you're running. Implementing more
353 * of that is left as an exercise to the reader - who should
354 * check any copyright information about code samples on MSDN
355 * before cutting and pasting into Wireshark.
357 * They should also note that you need an OSVERSIONINFOEX structure
358 * to get some of that information, and that not only is that
359 * structure not supported on older versions of Windows, you might
360 * not even be able to compile code that *uses* that structure with
361 * older versions of the SDK.
364 memset(&info, '\0', sizeof info);
365 info.dwOSVersionInfoSize = sizeof info;
366 if (!GetVersionEx((OSVERSIONINFO *)&info)) {
368 * XXX - get the failure reason.
370 g_string_append(str, "unknown Windows version");
374 memset(&system_info, '\0', sizeof system_info);
375 /* Look for and use the GetNativeSystemInfo() function if available to get the correct processor
376 * architecture even when running 32-bit Wireshark in WOW64 (x86 emulation on 64-bit Windows) */
377 nativesi_func = (nativesi_func_ptr)GetProcAddress(GetModuleHandle(_T("kernel32.dll")), "GetNativeSystemInfo");
379 nativesi_func(&system_info);
381 GetSystemInfo(&system_info);
383 switch (info.dwPlatformId) {
385 case VER_PLATFORM_WIN32s:
387 g_string_append_printf(str, "Windows 3.1 with Win32s");
390 case VER_PLATFORM_WIN32_WINDOWS:
392 switch (info.dwMajorVersion) {
395 /* 3 cheers for Microsoft marketing! */
396 switch (info.dwMinorVersion) {
399 g_string_append_printf(str, "Windows 95");
403 g_string_append_printf(str, "Windows 98");
407 g_string_append_printf(str, "Windows Me");
411 g_string_append_printf(str, "Windows OT, unknown version %lu.%lu",
412 info.dwMajorVersion, info.dwMinorVersion);
418 g_string_append_printf(str, "Windows OT, unknown version %lu.%lu",
419 info.dwMajorVersion, info.dwMinorVersion);
424 case VER_PLATFORM_WIN32_NT:
426 switch (info.dwMajorVersion) {
430 g_string_append_printf(str, "Windows NT %lu.%lu",
431 info.dwMajorVersion, info.dwMinorVersion);
435 /* 3 cheers for Microsoft marketing! */
436 switch (info.dwMinorVersion) {
439 g_string_append_printf(str, "Windows 2000");
443 g_string_append_printf(str, "Windows XP");
447 if ((info.wProductType == VER_NT_WORKSTATION) &&
448 (system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)) {
449 g_string_append_printf(str, "Windows XP Professional x64 Edition");
451 g_string_append_printf(str, "Windows Server 2003");
452 if (system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
453 g_string_append_printf(str, " x64 Edition");
458 g_string_append_printf(str, "Windows NT, unknown version %lu.%lu",
459 info.dwMajorVersion, info.dwMinorVersion);
465 gboolean is_nt_workstation;
467 if (system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
468 g_string_append(str, "64-bit ");
469 else if (system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
470 g_string_append(str, "32-bit ");
471 #ifndef VER_NT_WORKSTATION
472 #define VER_NT_WORKSTATION 0x01
473 is_nt_workstation = ((info.wReserved[1] & 0xff) == VER_NT_WORKSTATION);
475 is_nt_workstation = (info.wProductType == VER_NT_WORKSTATION);
477 switch (info.dwMinorVersion) {
479 g_string_append_printf(str, is_nt_workstation ? "Windows Vista" : "Windows Server 2008");
482 g_string_append_printf(str, is_nt_workstation ? "Windows 7" : "Windows Server 2008 R2");
485 g_string_append_printf(str, is_nt_workstation ? "Windows 8" : "Windows Server 2012");
488 g_string_append_printf(str, is_nt_workstation ? "Windows 8.1" : "Windows Server 2012 R2");
491 g_string_append_printf(str, "Windows NT, unknown version %lu.%lu",
492 info.dwMajorVersion, info.dwMinorVersion);
498 g_string_append_printf(str, "Windows NT, unknown version %lu.%lu",
499 info.dwMajorVersion, info.dwMinorVersion);
501 } /* info.dwMajorVersion */
505 g_string_append_printf(str, "Unknown Windows platform %lu version %lu.%lu",
506 info.dwPlatformId, info.dwMajorVersion, info.dwMinorVersion);
509 if (info.szCSDVersion[0] != '\0')
510 g_string_append_printf(str, " %s", utf_16to8(info.szCSDVersion));
511 g_string_append_printf(str, ", build %lu", info.dwBuildNumber);
512 #elif defined(HAVE_SYS_UTSNAME_H)
514 * We have <sys/utsname.h>, so we assume we have "uname()".
516 if (uname(&name) < 0) {
517 g_string_append_printf(str, "unknown OS version (uname failed - %s)",
522 if (strcmp(name.sysname, "AIX") == 0) {
524 * Yay, IBM! Thanks for doing something different
525 * from most of the other UNIXes out there, and
526 * making "name.version" apparently be the major
527 * version number and "name.release" be the minor
530 g_string_append_printf(str, "%s %s.%s", name.sysname, name.version,
534 * XXX - get "version" on any other platforms?
536 * On Digital/Tru64 UNIX, it's something unknown.
537 * On Solaris, it's some kind of build information.
538 * On HP-UX, it appears to be some sort of subrevision
540 * On *BSD and Darwin/OS X, it's a long string giving
541 * a build date, config file name, etc., etc., etc..
543 #ifdef HAVE_OS_X_FRAMEWORKS
545 * On Mac OS X, report the Mac OS X version number as
546 * the OS version if we can, and put the Darwin information
549 if (get_os_x_version_info(str)) {
550 /* Success - append the Darwin information. */
551 g_string_append_printf(str, " (%s %s)", name.sysname, name.release);
553 /* Failure - just use the Darwin information. */
554 g_string_append_printf(str, "%s %s", name.sysname, name.release);
556 #else /* HAVE_OS_X_FRAMEWORKS */
558 * XXX - on Linux, are there any APIs to get the distribution
559 * name and version number? I think some distributions have
562 * At least on Linux Standard Base-compliant distributions,
563 * there's an "lsb_release" command. However:
565 * http://forums.fedoraforum.org/showthread.php?t=220885
567 * seems to suggest that if you don't have the redhat-lsb
568 * package installed, you don't have lsb_release, and that
569 * /etc/fedora-release has the release information on
572 * http://linux.die.net/man/1/lsb_release
574 * suggests that there's an /etc/distrib-release file, but
575 * it doesn't indicate whether "distrib" is literally
576 * "distrib" or is the name for the distribution, and
577 * also speaks of an /etc/debian_version file.
579 * "lsb_release" apparently parses /etc/lsb-release, which
580 * has shell-style assignments, assigning to, among other
581 * values, DISTRIB_ID (distributor/distribution name),
582 * DISTRIB_RELEASE (release number of the distribution),
583 * DISTRIB_DESCRIPTION (*might* be name followed by version,
584 * but the manpage for lsb_release seems to indicate that's
585 * not guaranteed), and DISTRIB_CODENAME (code name, e.g.
586 * "licentious" for the Ubuntu Licentious Lemur release).
587 * the lsb_release man page also speaks of the distrib-release
588 * file, but Debian doesn't have one, and Ubuntu 7's
589 * lsb_release command doesn't look for one.
591 * I've seen references to /etc/redhat-release as well.
593 * At least on my Ubuntu 7 system, /etc/debian_version
594 * doesn't contain anything interesting (just some Debian
599 * http://bugs.python.org/issue1322
601 * http://www.novell.com/coolsolutions/feature/11251.html
603 * http://linuxmafia.com/faq/Admin/release-files.html
605 * and the Lib/Platform.py file in recent Python 2.x
608 g_string_append_printf(str, "%s %s", name.sysname, name.release);
609 #endif /* HAVE_OS_X_FRAMEWORKS */
612 g_string_append(str, "an unknown OS");
618 * Get the CPU info, and append it to the GString
621 #if defined(_MSC_VER)
623 do_cpuid(int *CPUInfo, guint32 selector){
624 __cpuid(CPUInfo, selector);
626 #elif defined(__GNUC__)
627 #if defined(__x86_64__)
629 do_cpuid(guint32 *CPUInfo, int selector)
631 __asm__ __volatile__("cpuid"
638 #else /* (__i386__) */
639 /* would need a test if older proccesors have the cpuid instruction */
641 do_cpuid(guint32 *CPUInfo, int selector _U_){
645 #endif /* defined(__x86_64__)*/
646 #else /* Other compilers */
648 do_cpuid(guint32 *CPUInfo, int selector _U_){
654 * Get CPU info on platforms where the cpuid instruction can be used skip 32 bit versions for GCC
655 * http://www.intel.com/content/dam/www/public/us/en/documents/application-notes/processor-identification-cpuid-instruction-note.pdf
656 * the get_cpuid() routine will return 0 in CPUInfo[0] if cpuinfo isn't available.
659 static void get_cpu_info(GString *str _U_)
661 #if defined(_MSC_VER)
666 char CPUBrandString[0x40];
669 /* http://msdn.microsoft.com/en-us/library/hskdteyh(v=vs.100).aspx */
671 /* Calling __cpuid with 0x80000000 as the InfoType argument*/
672 /* gets the number of valid extended IDs.*/
673 do_cpuid(CPUInfo, 0x80000000);
676 if( nExIds<0x80000005)
678 memset(CPUBrandString, 0, sizeof(CPUBrandString));
680 /* Interpret CPU brand string.*/
681 do_cpuid(CPUInfo, 0x80000002);
682 memcpy(CPUBrandString, CPUInfo, sizeof(CPUInfo));
683 do_cpuid(CPUInfo, 0x80000003);
684 memcpy(CPUBrandString + 16, CPUInfo, sizeof(CPUInfo));
685 do_cpuid(CPUInfo, 0x80000004);
686 memcpy(CPUBrandString + 32, CPUInfo, sizeof(CPUInfo));
688 g_string_append_printf(str, "\n%s", CPUBrandString);
692 static void get_mem_info(GString *str _U_)
695 MEMORYSTATUSEX statex;
697 statex.dwLength = sizeof (statex);
699 if(GlobalMemoryStatusEx (&statex))
700 g_string_append_printf(str, ", with ""%" G_GINT64_MODIFIER "d" "MB of physical memory.\n", statex.ullTotalPhys/(1024*1024));
706 * Get various library run-time versions, and the OS version, and append
707 * them to the specified GString.
710 get_runtime_version_info(GString *str, void (*additional_info)(GString *))
716 g_string_append(str, "on ");
718 get_os_version_info(str);
722 if ((lang = getenv ("LANG")) != NULL)
723 g_string_append_printf(str, ", with locale %s", lang);
725 g_string_append(str, ", without locale");
729 g_string_append(str, ", ");
730 get_runtime_pcap_version(str);
733 #if defined(HAVE_LIBZ) && !defined(_WIN32)
734 g_string_append_printf(str, ", with libz %s", zlibVersion());
737 /* Additional application-dependent information */
739 (*additional_info)(str);
741 g_string_append(str, ".");
746 /* Get info about installed memory Windows only */
752 * See https://sourceforge.net/apps/mediawiki/predef/index.php?title=Compilers
753 * information on various defined strings.
755 * GCC's __VERSION__ is a nice text string for humans to
756 * read. The page at sourceforge.net largely describes
757 * numeric #defines that encode the version; if the compiler
758 * doesn't also offer a nice printable string, we try prettifying
759 * the number somehow.
761 #if defined(__GNUC__) && defined(__VERSION__)
763 * Clang and llvm-gcc also define __GNUC__ and __VERSION__;
764 * distinguish between them.
766 #if defined(__clang__)
767 g_string_append_printf(str, "\n\nBuilt using clang %s.\n", __VERSION__);
768 #elif defined(__llvm__)
769 g_string_append_printf(str, "\n\nBuilt using llvm-gcc %s.\n", __VERSION__);
770 #else /* boring old GCC */
771 g_string_append_printf(str, "\n\nBuilt using gcc %s.\n", __VERSION__);
773 #elif defined(__HP_aCC)
774 g_string_append_printf(str, "\n\nBuilt using HP aCC %d.\n", __HP_aCC);
775 #elif defined(__xlC__)
776 g_string_append_printf(str, "\n\nBuilt using IBM XL C %d.%d\n",
777 (__xlC__ >> 8) & 0xFF, __xlC__ & 0xFF);
779 if ((__IBMC__ % 10) != 0)
780 g_string_append_printf(str, " patch %d", __IBMC__ % 10);
781 #endif /* __IBMC__ */
782 g_string_append_printf(str, "\n");
783 #elif defined(__INTEL_COMPILER)
784 g_string_append_printf(str, "\n\nBuilt using Intel C %d.%d",
785 __INTEL_COMPILER / 100, (__INTEL_COMPILER / 10) % 10);
786 if ((__INTEL_COMPILER % 10) != 0)
787 g_string_append_printf(str, " patch %d", __INTEL_COMPILER % 10);
788 #ifdef __INTEL_COMPILER_BUILD_DATE
789 g_string_sprinta(str, ", compiler built %04d-%02d-%02d",
790 __INTEL_COMPILER_BUILD_DATE / 10000,
791 (__INTEL_COMPILER_BUILD_DATE / 100) % 100,
792 __INTEL_COMPILER_BUILD_DATE % 100);
793 #endif /* __INTEL_COMPILER_BUILD_DATE */
794 g_string_append_printf(str, "\n");
795 #elif defined(_MSC_FULL_VER)
796 # if _MSC_FULL_VER > 99999999
797 g_string_append_printf(str, "\n\nBuilt using Microsoft Visual C++ %d.%d",
798 (_MSC_FULL_VER / 10000000) - 6,
799 (_MSC_FULL_VER / 100000) % 100);
800 # if (_MSC_FULL_VER % 100000) != 0
801 g_string_append_printf(str, " build %d",
802 _MSC_FULL_VER % 100000);
805 g_string_append_printf(str, "\n\nBuilt using Microsoft Visual C++ %d.%d",
806 (_MSC_FULL_VER / 1000000) - 6,
807 (_MSC_FULL_VER / 10000) % 100);
808 # if (_MSC_FULL_VER % 10000) != 0
809 g_string_append_printf(str, " build %d",
810 _MSC_FULL_VER % 10000);
813 g_string_append_printf(str, "\n");
814 #elif defined(_MSC_VER)
815 /* _MSC_FULL_VER not defined, but _MSC_VER defined */
816 g_string_append_printf(str, "\n\nBuilt using Microsoft Visual C++ %d.%d\n",
817 (_MSC_VER / 100) - 6, _MSC_VER % 100);
818 #elif defined(__SUNPRO_C)
819 g_string_append_printf(str, "\n\nBuilt using Sun C %d.%d",
820 (__SUNPRO_C >> 8) & 0xF, (__SUNPRO_C >> 4) & 0xF);
821 if ((__SUNPRO_C & 0xF) != 0)
822 g_string_append_printf(str, " patch %d", __SUNPRO_C & 0xF);
823 g_string_append_printf(str, "\n");
830 * Get copyright information.
833 get_copyright_info(void)
836 "Copyright 1998-2014 Gerald Combs <gerald@wireshark.org> and contributors.\n"
837 "This is free software; see the source for copying conditions. There is NO\n"
838 "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
843 * Get the major OS version.
845 /* XXX - Should this return the minor version as well, e.g. 0x00050002? */
847 get_os_major_version()
850 info.dwOSVersionInfoSize = sizeof info;
851 if (GetVersionEx(&info)) {
852 return info.dwMajorVersion;
864 * indent-tabs-mode: t
867 * ex: set shiftwidth=8 tabstop=8 noexpandtab:
868 * :indentSize=8:tabSize=8:noTabs=false: