1 /*
2 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
450 * Operating system dwMajorVersion dwMinorVersion
451 * ================== ============== ==============
452 *
453 * Windows 95 4 0
454 * Windows 98 4 10
455 * Windows ME 4 90
456 * Windows 3.51 3 51
457 * Windows NT 4.0 4 0
458 * Windows 2000 5 0
459 * Windows XP 32 bit 5 1
460 * Windows Server 2003 family 5 2
461 * Windows XP 64 bit 5 2
462 * where ((&ver.wServicePackMinor) + 2) = 1
463 * and si.wProcessorArchitecture = 9
464 * Windows Vista family 6 0 (VER_NT_WORKSTATION)
465 * Windows Server 2008 6 0 (!VER_NT_WORKSTATION)
466 * Windows 7 6 1 (VER_NT_WORKSTATION)
467 * Windows Server 2008 R2 6 1 (!VER_NT_WORKSTATION)
468 * Windows 8 6 2 (VER_NT_WORKSTATION)
469 * Windows Server 2012 6 2 (!VER_NT_WORKSTATION)
470 * Windows 10 10 0 (VER_NT_WORKSTATION)
471 *
472 * This mapping will presumably be augmented as new Windows
473 * versions are released.
474 */
475 switch (platformId) {
476 case VER_PLATFORM_WIN32_WINDOWS:
477 if (majorVersion == 4) {
478 switch (minorVersion) {
479 case 0: sprops.os_name = "Windows 95"; break;
480 case 10: sprops.os_name = "Windows 98"; break;
481 case 90: sprops.os_name = "Windows Me"; break;
482 default: sprops.os_name = "Windows 9X (unknown)"; break;
483 }
484 } else {
485 sprops.os_name = "Windows 9X (unknown)";
486 }
487 break;
488 case VER_PLATFORM_WIN32_NT:
489 if (majorVersion <= 4) {
490 sprops.os_name = "Windows NT";
524 case 3: sprops.os_name = "Windows 8.1"; break;
525 default: sprops.os_name = "Windows NT (unknown)";
526 }
527 } else {
528 switch (minorVersion) {
529 case 0: sprops.os_name = "Windows Server 2008"; break;
530 case 1: sprops.os_name = "Windows Server 2008 R2"; break;
531 case 2: sprops.os_name = "Windows Server 2012"; break;
532 case 3: sprops.os_name = "Windows Server 2012 R2"; break;
533 default: sprops.os_name = "Windows NT (unknown)";
534 }
535 }
536 } else if (majorVersion == 10) {
537 if (is_workstation) {
538 switch (minorVersion) {
539 case 0: sprops.os_name = "Windows 10"; break;
540 default: sprops.os_name = "Windows NT (unknown)";
541 }
542 } else {
543 switch (minorVersion) {
544 default: sprops.os_name = "Windows NT (unknown)";
545 }
546 }
547 } else {
548 sprops.os_name = "Windows NT (unknown)";
549 }
550 break;
551 default:
552 sprops.os_name = "Windows (unknown)";
553 break;
554 }
555 sprintf(buf, "%d.%d", majorVersion, minorVersion);
556 sprops.os_version = _strdup(buf);
557 #if _M_IA64
558 sprops.os_arch = "ia64";
559 #elif _M_AMD64
560 sprops.os_arch = "amd64";
561 #elif _X86_
562 sprops.os_arch = "x86";
563 #else
|
1 /*
2 * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
450 * Operating system dwMajorVersion dwMinorVersion
451 * ================== ============== ==============
452 *
453 * Windows 95 4 0
454 * Windows 98 4 10
455 * Windows ME 4 90
456 * Windows 3.51 3 51
457 * Windows NT 4.0 4 0
458 * Windows 2000 5 0
459 * Windows XP 32 bit 5 1
460 * Windows Server 2003 family 5 2
461 * Windows XP 64 bit 5 2
462 * where ((&ver.wServicePackMinor) + 2) = 1
463 * and si.wProcessorArchitecture = 9
464 * Windows Vista family 6 0 (VER_NT_WORKSTATION)
465 * Windows Server 2008 6 0 (!VER_NT_WORKSTATION)
466 * Windows 7 6 1 (VER_NT_WORKSTATION)
467 * Windows Server 2008 R2 6 1 (!VER_NT_WORKSTATION)
468 * Windows 8 6 2 (VER_NT_WORKSTATION)
469 * Windows Server 2012 6 2 (!VER_NT_WORKSTATION)
470 * Windows Server 2012 R2 6 3 (!VER_NT_WORKSTATION)
471 * Windows 10 10 0 (VER_NT_WORKSTATION)
472 * Windows Server 2016 10 0 (!VER_NT_WORKSTATION)
473 *
474 * This mapping will presumably be augmented as new Windows
475 * versions are released.
476 */
477 switch (platformId) {
478 case VER_PLATFORM_WIN32_WINDOWS:
479 if (majorVersion == 4) {
480 switch (minorVersion) {
481 case 0: sprops.os_name = "Windows 95"; break;
482 case 10: sprops.os_name = "Windows 98"; break;
483 case 90: sprops.os_name = "Windows Me"; break;
484 default: sprops.os_name = "Windows 9X (unknown)"; break;
485 }
486 } else {
487 sprops.os_name = "Windows 9X (unknown)";
488 }
489 break;
490 case VER_PLATFORM_WIN32_NT:
491 if (majorVersion <= 4) {
492 sprops.os_name = "Windows NT";
526 case 3: sprops.os_name = "Windows 8.1"; break;
527 default: sprops.os_name = "Windows NT (unknown)";
528 }
529 } else {
530 switch (minorVersion) {
531 case 0: sprops.os_name = "Windows Server 2008"; break;
532 case 1: sprops.os_name = "Windows Server 2008 R2"; break;
533 case 2: sprops.os_name = "Windows Server 2012"; break;
534 case 3: sprops.os_name = "Windows Server 2012 R2"; break;
535 default: sprops.os_name = "Windows NT (unknown)";
536 }
537 }
538 } else if (majorVersion == 10) {
539 if (is_workstation) {
540 switch (minorVersion) {
541 case 0: sprops.os_name = "Windows 10"; break;
542 default: sprops.os_name = "Windows NT (unknown)";
543 }
544 } else {
545 switch (minorVersion) {
546 case 0: sprops.os_name = "Windows Server 2016"; break;
547 default: sprops.os_name = "Windows NT (unknown)";
548 }
549 }
550 } else {
551 sprops.os_name = "Windows NT (unknown)";
552 }
553 break;
554 default:
555 sprops.os_name = "Windows (unknown)";
556 break;
557 }
558 sprintf(buf, "%d.%d", majorVersion, minorVersion);
559 sprops.os_version = _strdup(buf);
560 #if _M_IA64
561 sprops.os_arch = "ia64";
562 #elif _M_AMD64
563 sprops.os_arch = "amd64";
564 #elif _X86_
565 sprops.os_arch = "x86";
566 #else
|