2 * Routines to report version information for stuff used by Wireshark
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
35 #include <zlib.h> /* to get the libz version number */
38 #ifdef HAVE_SYS_UTSNAME_H
39 #include <sys/utsname.h>
42 #include "version_info.h"
43 #include "capture-pcap-util.h"
44 #include <wsutil/unicode-utils.h>
46 #include "svnversion.h"
52 #ifdef HAVE_OS_X_FRAMEWORKS
53 #include <CoreFoundation/CoreFoundation.h>
58 # include <sys/capability.h>
62 const char *wireshark_svnversion = " (" SVNVERSION " from " SVNPATH ")";
64 const char *wireshark_svnversion = "";
68 * If the string doesn't end with a newline, append one.
69 * Then word-wrap it to 80 columns.
72 end_string(GString *str)
78 if (point == 0 || str->str[point - 1] != '\n')
79 g_string_append(str, "\n");
85 * Break at or before this point.
88 while (q > p && *q != ' ')
98 * Get various library compile-time versions and append them to
99 * the specified GString.
101 * "additional_info" is called at the end to append any additional
102 * information; this is required in order to, for example, put the
103 * Portaudio information at the end of the string, as we currently
104 * don't use Portaudio in TShark.
107 get_compiled_version_info(GString *str, void (*prepend_info)(GString *),
108 void (*append_info)(GString *))
110 if (sizeof(str) == 4)
111 g_string_append(str, "(32-bit) ");
113 g_string_append(str, "(64-bit) ");
116 (*prepend_info)(str);
119 g_string_append(str, "with ");
120 g_string_append_printf(str,
121 #ifdef GLIB_MAJOR_VERSION
122 "GLib %d.%d.%d", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION,
125 "GLib (version unknown)");
129 g_string_append(str, ", ");
130 get_compiled_pcap_version(str);
133 g_string_append(str, ", ");
135 g_string_append(str, "with libz ");
137 g_string_append(str, ZLIB_VERSION);
138 #else /* ZLIB_VERSION */
139 g_string_append(str, "(version unknown)");
140 #endif /* ZLIB_VERSION */
141 #else /* HAVE_LIBZ */
142 g_string_append(str, "without libz");
143 #endif /* HAVE_LIBZ */
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 */
157 g_string_append(str, ", ");
158 #if defined(HAVE_LIBNL1)
159 g_string_append(str, "with libnl 1");
160 #elif defined(HAVE_LIBNL2)
161 g_string_append(str, "with libnl 2");
162 #elif defined(HAVE_LIBNL3)
163 g_string_append(str, "with libnl 3");
165 g_string_append(str, "without libnl");
168 /* Additional application-dependent information */
171 g_string_append(str, ".");
177 typedef void (WINAPI *nativesi_func_ptr)(LPSYSTEM_INFO);
181 * Handles the rather elaborate process of getting OS version information
182 * from OS X (we want the OS X version, not the Darwin version, the latter
183 * being easy to get with uname()).
185 #ifdef HAVE_OS_X_FRAMEWORKS
188 * Fetch a string, as a UTF-8 C string, from a dictionary, given a key.
191 get_string_from_dictionary(CFPropertyListRef dict, CFStringRef key)
193 CFStringRef cfstring;
195 cfstring = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)dict,
197 if (cfstring == NULL)
199 if (CFGetTypeID(cfstring) != CFStringGetTypeID()) {
200 /* It isn't a string. Punt. */
203 return CFString_to_C_string(cfstring);
207 * Get the OS X version information, and append it to the GString.
208 * Return TRUE if we succeed, FALSE if we fail.
211 get_os_x_version_info(GString *str)
213 static const UInt8 server_version_plist_path[] =
214 "/System/Library/CoreServices/ServerVersion.plist";
215 static const UInt8 system_version_plist_path[] =
216 "/System/Library/CoreServices/SystemVersion.plist";
217 CFURLRef version_plist_file_url;
218 CFReadStreamRef version_plist_stream;
219 CFDictionaryRef version_dict;
223 * On OS X, report the OS X version number as the OS, and put
224 * the Darwin information in parentheses.
226 * Alas, Gestalt() is deprecated in Mountain Lion, so the build
227 * fails if you treat deprecation warnings as fatal. I don't
228 * know of any replacement API, so we fall back on reading
229 * /System/Library/CoreServices/ServerVersion.plist if it
230 * exists, otherwise /System/Library/CoreServices/SystemVersion.plist,
231 * and using ProductUserVisibleVersion. We also get the build
232 * version from ProductBuildVersion and the product name from
235 version_plist_file_url = CFURLCreateFromFileSystemRepresentation(NULL,
236 server_version_plist_path, sizeof server_version_plist_path - 1,
238 if (version_plist_file_url == NULL)
240 version_plist_stream = CFReadStreamCreateWithFile(NULL,
241 version_plist_file_url);
242 CFRelease(version_plist_file_url);
243 if (version_plist_stream == NULL)
245 if (!CFReadStreamOpen(version_plist_stream)) {
246 CFRelease(version_plist_stream);
249 * Try SystemVersion.plist.
251 version_plist_file_url = CFURLCreateFromFileSystemRepresentation(NULL,
252 system_version_plist_path, sizeof system_version_plist_path - 1,
254 if (version_plist_file_url == NULL)
256 version_plist_stream = CFReadStreamCreateWithFile(NULL,
257 version_plist_file_url);
258 CFRelease(version_plist_file_url);
259 if (version_plist_stream == NULL)
261 if (!CFReadStreamOpen(version_plist_stream)) {
262 CFRelease(version_plist_stream);
266 #ifdef HAVE_CFPROPERTYLISTCREATEWITHSTREAM
267 version_dict = (CFDictionaryRef)CFPropertyListCreateWithStream(NULL,
268 version_plist_stream, 0, kCFPropertyListImmutable,
271 version_dict = (CFDictionaryRef)CFPropertyListCreateFromStream(NULL,
272 version_plist_stream, 0, kCFPropertyListImmutable,
275 if (version_dict == NULL) {
276 CFRelease(version_plist_stream);
279 if (CFGetTypeID(version_dict) != CFDictionaryGetTypeID()) {
280 /* This is *supposed* to be a dictionary. Punt. */
281 CFRelease(version_dict);
282 CFReadStreamClose(version_plist_stream);
283 CFRelease(version_plist_stream);
286 /* Get the product name string. */
287 string = get_string_from_dictionary(version_dict,
288 CFSTR("ProductName"));
289 if (string == NULL) {
290 CFRelease(version_dict);
291 CFReadStreamClose(version_plist_stream);
292 CFRelease(version_plist_stream);
295 g_string_append_printf(str, "%s", string);
298 /* Get the OS version string. */
299 string = get_string_from_dictionary(version_dict,
300 CFSTR("ProductUserVisibleVersion"));
301 if (string == NULL) {
302 CFRelease(version_dict);
303 CFReadStreamClose(version_plist_stream);
304 CFRelease(version_plist_stream);
307 g_string_append_printf(str, " %s", string);
310 /* Get the build string */
311 string = get_string_from_dictionary(version_dict,
312 CFSTR("ProductBuildVersion"));
313 if (string == NULL) {
314 CFRelease(version_dict);
315 CFReadStreamClose(version_plist_stream);
316 CFRelease(version_plist_stream);
319 g_string_append_printf(str, ", build %s", string);
321 CFRelease(version_dict);
322 CFReadStreamClose(version_plist_stream);
323 CFRelease(version_plist_stream);
329 * Get the OS version, and append it to the GString
331 void get_os_version_info(GString *str)
334 OSVERSIONINFOEX info;
335 SYSTEM_INFO system_info;
336 nativesi_func_ptr nativesi_func;
337 #elif defined(HAVE_SYS_UTSNAME_H)
345 * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getting_the_system_version.asp
347 * for more than you ever wanted to know about determining the
348 * flavor of Windows on which you're running. Implementing more
349 * of that is left as an exercise to the reader - who should
350 * check any copyright information about code samples on MSDN
351 * before cutting and pasting into Wireshark.
353 * They should also note that you need an OSVERSIONINFOEX structure
354 * to get some of that information, and that not only is that
355 * structure not supported on older versions of Windows, you might
356 * not even be able to compile code that *uses* that structure with
357 * older versions of the SDK.
360 memset(&info, '\0', sizeof info);
361 info.dwOSVersionInfoSize = sizeof info;
362 if (!GetVersionEx((OSVERSIONINFO *)&info)) {
364 * XXX - get the failure reason.
366 g_string_append(str, "unknown Windows version");
370 memset(&system_info, '\0', sizeof system_info);
371 /* Look for and use the GetNativeSystemInfo() function if available to get the correct processor
372 * architecture even when running 32-bit Wireshark in WOW64 (x86 emulation on 64-bit Windows) */
373 nativesi_func = (nativesi_func_ptr)GetProcAddress(GetModuleHandle(_T("kernel32.dll")), "GetNativeSystemInfo");
375 nativesi_func(&system_info);
377 GetSystemInfo(&system_info);
379 switch (info.dwPlatformId) {
381 case VER_PLATFORM_WIN32s:
383 g_string_append_printf(str, "Windows 3.1 with Win32s");
386 case VER_PLATFORM_WIN32_WINDOWS:
388 switch (info.dwMajorVersion) {
391 /* 3 cheers for Microsoft marketing! */
392 switch (info.dwMinorVersion) {
395 g_string_append_printf(str, "Windows 95");
399 g_string_append_printf(str, "Windows 98");
403 g_string_append_printf(str, "Windows Me");
407 g_string_append_printf(str, "Windows OT, unknown version %lu.%lu",
408 info.dwMajorVersion, info.dwMinorVersion);
414 g_string_append_printf(str, "Windows OT, unknown version %lu.%lu",
415 info.dwMajorVersion, info.dwMinorVersion);
420 case VER_PLATFORM_WIN32_NT:
422 switch (info.dwMajorVersion) {
426 g_string_append_printf(str, "Windows NT %lu.%lu",
427 info.dwMajorVersion, info.dwMinorVersion);
431 /* 3 cheers for Microsoft marketing! */
432 switch (info.dwMinorVersion) {
435 g_string_append_printf(str, "Windows 2000");
439 g_string_append_printf(str, "Windows XP");
443 if ((info.wProductType == VER_NT_WORKSTATION) &&
444 (system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)) {
445 g_string_append_printf(str, "Windows XP Professional x64 Edition");
447 g_string_append_printf(str, "Windows Server 2003");
448 if (system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
449 g_string_append_printf(str, " x64 Edition");
454 g_string_append_printf(str, "Windows NT, unknown version %lu.%lu",
455 info.dwMajorVersion, info.dwMinorVersion);
461 gboolean is_nt_workstation;
463 if (system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
464 g_string_append(str, "64-bit ");
465 else if (system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
466 g_string_append(str, "32-bit ");
467 #ifndef VER_NT_WORKSTATION
468 #define VER_NT_WORKSTATION 0x01
469 is_nt_workstation = ((info.wReserved[1] & 0xff) == VER_NT_WORKSTATION);
471 is_nt_workstation = (info.wProductType == VER_NT_WORKSTATION);
473 switch (info.dwMinorVersion) {
475 g_string_append_printf(str, is_nt_workstation ? "Windows Vista" : "Windows Server 2008");
478 g_string_append_printf(str, is_nt_workstation ? "Windows 7" : "Windows Server 2008 R2");
481 g_string_append_printf(str, is_nt_workstation ? "Windows 8" : "Windows Server 2012");
484 g_string_append_printf(str, is_nt_workstation ? "Windows 8.1" : "Windows Server 2012 R2");
487 g_string_append_printf(str, "Windows NT, unknown version %lu.%lu",
488 info.dwMajorVersion, info.dwMinorVersion);
494 g_string_append_printf(str, "Windows NT, unknown version %lu.%lu",
495 info.dwMajorVersion, info.dwMinorVersion);
497 } /* info.dwMajorVersion */
501 g_string_append_printf(str, "Unknown Windows platform %lu version %lu.%lu",
502 info.dwPlatformId, info.dwMajorVersion, info.dwMinorVersion);
505 if (info.szCSDVersion[0] != '\0')
506 g_string_append_printf(str, " %s", utf_16to8(info.szCSDVersion));
507 g_string_append_printf(str, ", build %lu", info.dwBuildNumber);
508 #elif defined(HAVE_SYS_UTSNAME_H)
510 * We have <sys/utsname.h>, so we assume we have "uname()".
512 if (uname(&name) < 0) {
513 g_string_append_printf(str, "unknown OS version (uname failed - %s)",
518 if (strcmp(name.sysname, "AIX") == 0) {
520 * Yay, IBM! Thanks for doing something different
521 * from most of the other UNIXes out there, and
522 * making "name.version" apparently be the major
523 * version number and "name.release" be the minor
526 g_string_append_printf(str, "%s %s.%s", name.sysname, name.version,
530 * XXX - get "version" on any other platforms?
532 * On Digital/Tru64 UNIX, it's something unknown.
533 * On Solaris, it's some kind of build information.
534 * On HP-UX, it appears to be some sort of subrevision
536 * On *BSD and Darwin/OS X, it's a long string giving
537 * a build date, config file name, etc., etc., etc..
539 #ifdef HAVE_OS_X_FRAMEWORKS
541 * On Mac OS X, report the Mac OS X version number as
542 * the OS version if we can, and put the Darwin information
545 if (get_os_x_version_info(str)) {
546 /* Success - append the Darwin information. */
547 g_string_append_printf(str, " (%s %s)", name.sysname, name.release);
549 /* Failure - just use the Darwin information. */
550 g_string_append_printf(str, "%s %s", name.sysname, name.release);
552 #else /* HAVE_OS_X_FRAMEWORKS */
554 * XXX - on Linux, are there any APIs to get the distribution
555 * name and version number? I think some distributions have
558 * At least on Linux Standard Base-compliant distributions,
559 * there's an "lsb_release" command. However:
561 * http://forums.fedoraforum.org/showthread.php?t=220885
563 * seems to suggest that if you don't have the redhat-lsb
564 * package installed, you don't have lsb_release, and that
565 * /etc/fedora-release has the release information on
568 * http://linux.die.net/man/1/lsb_release
570 * suggests that there's an /etc/distrib-release file, but
571 * it doesn't indicate whether "distrib" is literally
572 * "distrib" or is the name for the distribution, and
573 * also speaks of an /etc/debian_version file.
575 * "lsb_release" apparently parses /etc/lsb-release, which
576 * has shell-style assignments, assigning to, among other
577 * values, DISTRIB_ID (distributor/distribution name),
578 * DISTRIB_RELEASE (release number of the distribution),
579 * DISTRIB_DESCRIPTION (*might* be name followed by version,
580 * but the manpage for lsb_release seems to indicate that's
581 * not guaranteed), and DISTRIB_CODENAME (code name, e.g.
582 * "licentious" for the Ubuntu Licentious Lemur release).
583 * the lsb_release man page also speaks of the distrib-release
584 * file, but Debian doesn't have one, and Ubuntu 7's
585 * lsb_release command doesn't look for one.
587 * I've seen references to /etc/redhat-release as well.
589 * At least on my Ubuntu 7 system, /etc/debian_version
590 * doesn't contain anything interesting (just some Debian
595 * http://bugs.python.org/issue1322
597 * http://www.novell.com/coolsolutions/feature/11251.html
599 * http://linuxmafia.com/faq/Admin/release-files.html
601 * and the Lib/Platform.py file in recent Python 2.x
604 g_string_append_printf(str, "%s %s", name.sysname, name.release);
605 #endif /* HAVE_OS_X_FRAMEWORKS */
608 g_string_append(str, "an unknown OS");
614 * Get the CPU info, and append it to the GString
617 #if defined(_MSC_VER)
619 do_cpuid(int *CPUInfo, guint32 selector){
620 __cpuid(CPUInfo, selector);
622 #elif defined(__GNUC__)
623 #if defined(__x86_64__)
625 do_cpuid(guint32 *CPUInfo, int selector)
627 __asm__ __volatile__("cpuid"
634 #else /* (__i386__) */
635 /* would need a test if older proccesors have the cpuid instruction */
637 do_cpuid(guint32 *CPUInfo, int selector _U_){
641 #endif /* defined(__x86_64__)*/
642 #else /* Other compilers */
644 do_cpuid(guint32 *CPUInfo, int selector _U_){
650 * Get CPU info on platforms where the cpuid instruction can be used skip 32 bit versions for GCC
651 * http://www.intel.com/content/dam/www/public/us/en/documents/application-notes/processor-identification-cpuid-instruction-note.pdf
652 * the get_cpuid() routine will return 0 in CPUInfo[0] if cpuinfo isn't available.
655 static void get_cpu_info(GString *str _U_)
657 #if defined(_MSC_VER)
662 char CPUBrandString[0x40];
665 /* http://msdn.microsoft.com/en-us/library/hskdteyh(v=vs.100).aspx */
667 /* Calling __cpuid with 0x80000000 as the InfoType argument*/
668 /* gets the number of valid extended IDs.*/
669 do_cpuid(CPUInfo, 0x80000000);
672 if( nExIds<0x80000005)
674 memset(CPUBrandString, 0, sizeof(CPUBrandString));
676 /* Interpret CPU brand string.*/
677 do_cpuid(CPUInfo, 0x80000002);
678 memcpy(CPUBrandString, CPUInfo, sizeof(CPUInfo));
679 do_cpuid(CPUInfo, 0x80000003);
680 memcpy(CPUBrandString + 16, CPUInfo, sizeof(CPUInfo));
681 do_cpuid(CPUInfo, 0x80000004);
682 memcpy(CPUBrandString + 32, CPUInfo, sizeof(CPUInfo));
684 g_string_append_printf(str, "\n%s", CPUBrandString);
688 static void get_mem_info(GString *str _U_)
691 MEMORYSTATUSEX statex;
693 statex.dwLength = sizeof (statex);
695 if(GlobalMemoryStatusEx (&statex))
696 g_string_append_printf(str, ", with ""%" G_GINT64_MODIFIER "d" "MB of physical memory.\n", statex.ullTotalPhys/(1024*1024));
702 * Get various library run-time versions, and the OS version, and append
703 * them to the specified GString.
706 get_runtime_version_info(GString *str, void (*additional_info)(GString *))
712 g_string_append(str, "on ");
714 get_os_version_info(str);
718 if ((lang = getenv ("LANG")) != NULL)
719 g_string_append_printf(str, ", with locale %s", lang);
721 g_string_append(str, ", without locale");
725 g_string_append(str, ", ");
726 get_runtime_pcap_version(str);
729 #if defined(HAVE_LIBZ) && !defined(_WIN32)
730 g_string_append_printf(str, ", with libz %s", zlibVersion());
733 /* Additional application-dependent information */
735 (*additional_info)(str);
737 g_string_append(str, ".");
742 /* Get info about installed memory Windows only */
748 * See https://sourceforge.net/apps/mediawiki/predef/index.php?title=Compilers
749 * information on various defined strings.
751 * GCC's __VERSION__ is a nice text string for humans to
752 * read. The page at sourceforge.net largely describes
753 * numeric #defines that encode the version; if the compiler
754 * doesn't also offer a nice printable string, we try prettifying
755 * the number somehow.
757 #if defined(__GNUC__) && defined(__VERSION__)
759 * Clang and llvm-gcc also define __GNUC__ and __VERSION__;
760 * distinguish between them.
762 #if defined(__clang__)
763 g_string_append_printf(str, "\n\nBuilt using clang %s.\n", __VERSION__);
764 #elif defined(__llvm__)
765 g_string_append_printf(str, "\n\nBuilt using llvm-gcc %s.\n", __VERSION__);
766 #else /* boring old GCC */
767 g_string_append_printf(str, "\n\nBuilt using gcc %s.\n", __VERSION__);
769 #elif defined(__HP_aCC)
770 g_string_append_printf(str, "\n\nBuilt using HP aCC %d.\n", __HP_aCC);
771 #elif defined(__xlC__)
772 g_string_append_printf(str, "\n\nBuilt using IBM XL C %d.%d\n",
773 (__xlC__ >> 8) & 0xFF, __xlC__ & 0xFF);
775 if ((__IBMC__ % 10) != 0)
776 g_string_append_printf(str, " patch %d", __IBMC__ % 10);
777 #endif /* __IBMC__ */
778 g_string_append_printf(str, "\n");
779 #elif defined(__INTEL_COMPILER)
780 g_string_append_printf(str, "\n\nBuilt using Intel C %d.%d",
781 __INTEL_COMPILER / 100, (__INTEL_COMPILER / 10) % 10);
782 if ((__INTEL_COMPILER % 10) != 0)
783 g_string_append_printf(str, " patch %d", __INTEL_COMPILER % 10);
784 #ifdef __INTEL_COMPILER_BUILD_DATE
785 g_string_sprinta(str, ", compiler built %04d-%02d-%02d",
786 __INTEL_COMPILER_BUILD_DATE / 10000,
787 (__INTEL_COMPILER_BUILD_DATE / 100) % 100,
788 __INTEL_COMPILER_BUILD_DATE % 100);
789 #endif /* __INTEL_COMPILER_BUILD_DATE */
790 g_string_append_printf(str, "\n");
791 #elif defined(_MSC_FULL_VER)
792 # if _MSC_FULL_VER > 99999999
793 g_string_append_printf(str, "\n\nBuilt using Microsoft Visual C++ %d.%d",
794 (_MSC_FULL_VER / 10000000) - 6,
795 (_MSC_FULL_VER / 100000) % 100);
796 # if (_MSC_FULL_VER % 100000) != 0
797 g_string_append_printf(str, " build %d",
798 _MSC_FULL_VER % 100000);
801 g_string_append_printf(str, "\n\nBuilt using Microsoft Visual C++ %d.%d",
802 (_MSC_FULL_VER / 1000000) - 6,
803 (_MSC_FULL_VER / 10000) % 100);
804 # if (_MSC_FULL_VER % 10000) != 0
805 g_string_append_printf(str, " build %d",
806 _MSC_FULL_VER % 10000);
809 g_string_append_printf(str, "\n");
810 #elif defined(_MSC_VER)
811 /* _MSC_FULL_VER not defined, but _MSC_VER defined */
812 g_string_append_printf(str, "\n\nBuilt using Microsoft Visual C++ %d.%d\n",
813 (_MSC_VER / 100) - 6, _MSC_VER % 100);
814 #elif defined(__SUNPRO_C)
815 g_string_append_printf(str, "\n\nBuilt using Sun C %d.%d",
816 (__SUNPRO_C >> 8) & 0xF, (__SUNPRO_C >> 4) & 0xF);
817 if ((__SUNPRO_C & 0xF) != 0)
818 g_string_append_printf(str, " patch %d", __SUNPRO_C & 0xF);
819 g_string_append_printf(str, "\n");
826 * Get copyright information.
829 get_copyright_info(void)
832 "Copyright 1998-2013 Gerald Combs <gerald@wireshark.org> and contributors.\n"
833 "This is free software; see the source for copying conditions. There is NO\n"
834 "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
839 * Get the major OS version.
841 /* XXX - Should this return the minor version as well, e.g. 0x00050002? */
843 get_os_major_version()
846 info.dwOSVersionInfoSize = sizeof info;
847 if (GetVersionEx(&info)) {
848 return info.dwMajorVersion;
860 * indent-tabs-mode: t
863 * ex: set shiftwidth=8 tabstop=8 noexpandtab:
864 * :indentSize=8:tabSize=8:noTabs=false: