@@ -292,7 +292,7 @@ sub GetOSDisplayName {
292292 $desc =~ s / ^\s *// ;
293293 s / (200.)/ $name Server $1 / ;
294294 }
295- s / ^Windows (200[38] )/ Windows Server $1 / ;
295+ s / ^Windows (20(03|08|12) )/ Windows Server $1 / ;
296296 }
297297 }
298298 $name .= " $desc " if length $desc ;
@@ -460,8 +460,16 @@ sub _GetOSName {
460460 $desc = " R2" ;
461461 }
462462 }
463+ elsif ($minor == 2) {
464+ if ($producttype == VER_NT_WORKSTATION) {
465+ $os = " 8" ;
466+ }
467+ else {
468+ $os = " 2012" ;
469+ }
470+ }
463471
464- if ($productinfo == PRODUCT_ULTIMATE) {
472+ if ($productinfo == PRODUCT_ULTIMATE) {
465473 $desc .= " Ultimate" ;
466474 }
467475 elsif ($productinfo == PRODUCT_HOME_PREMIUM) {
@@ -970,6 +978,8 @@ Currently known values for ID MAJOR and MINOR are as follows:
970978 Windows Server 2008 2 6 0
971979 Windows 7 2 6 1
972980 Windows Server 2008 R2 2 6 1
981+ Windows 8 2 6 2
982+ Windows Server 2012 2 6 2
973983
974984On Windows NT 4 SP6 and later this function returns the following
975985additional values: SPMAJOR, SPMINOR, SUITEMASK, PRODUCTTYPE.
@@ -986,6 +996,10 @@ The version numbers for Windows 7 and Windows Server 2008 R2 are
986996identical; the PRODUCTTYPE field must be used to differentiate between
987997them.
988998
999+ The version numbers for Windows 8 and Windows Server 2012 are
1000+ identical; the PRODUCTTYPE field must be used to differentiate between
1001+ them.
1002+
9891003SPMAJOR and SPMINOR are are the version numbers of the latest
9901004installed service pack.
9911005
@@ -1016,9 +1030,9 @@ constants.
10161030PRODUCTTYPE provides additional information about the system. It should
10171031be one of the following integer values:
10181032
1019- 1 - Workstation (NT 4, 2000 Pro, XP Home, XP Pro, Vista)
1033+ 1 - Workstation (NT 4, 2000 Pro, XP Home, XP Pro, Vista, etc )
10201034 2 - Domaincontroller
1021- 3 - Server (2000 Server, Server 2003, Server 2008)
1035+ 3 - Server (2000 Server, Server 2003, Server 2008, etc )
10221036
10231037Note that a server that is also a domain controller is reported as
10241038PRODUCTTYPE 2 (Domaincontroller) and not PRODUCTTYPE 3 (Server).
0 commit comments