summaryrefslogtreecommitdiff
path: root/win32/ext
diff options
context:
space:
mode:
authorJan Dubois <jand@activestate.com>2005-08-22 08:37:09 -0700
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-08-23 13:11:34 +0000
commitb76aa5af2840585626e18c84f60feb97c68abd14 (patch)
tree4f3425bcc0fc06df343e7c16926bb1d90a735df2 /win32/ext
parent3ce239a037d49e310d47ffca0fa9c35c0a28abac (diff)
downloadperl-b76aa5af2840585626e18c84f60feb97c68abd14.tar.gz
Add Windows Vista support to Win32::GetOSName()
From: "Jan Dubois" <jand@ActiveState.com> Message-Id: <200508222237.j7MMbFPA027764@smtp3.ActiveState.com> p4raw-id: //depot/perl@25321
Diffstat (limited to 'win32/ext')
-rw-r--r--win32/ext/Win32/Win32.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/win32/ext/Win32/Win32.pm b/win32/ext/Win32/Win32.pm
index 3844c63429..af3f2fe175 100644
--- a/win32/ext/Win32/Win32.pm
+++ b/win32/ext/Win32/Win32.pm
@@ -195,9 +195,9 @@ sub GetOSName {
90 => "Me"
},
2 => {
- 0 => "2000",
+ 0 => "NT4",
1 => "XP/.Net",
- 2 => "2003",
+ 2 => "2003",
51 => "NT3.51"
}
}->{$id}->{$minor};
@@ -212,9 +212,9 @@ sub GetOSName {
my $tag = "";
- # But distinguising W2k from NT4 requires looking at the major version
- if ($os eq "2000" && $major != 5) {
- $os = "NT4";
+ # But distinguising W2k and Vista from NT4 requires looking at the major version
+ if ($os eq "NT4") {
+ $os = {5 => "2000", 6 => "Vista"}->{$major} || "NT4";
}
# For the rest we take a look at the build numbers and try to deduce
@@ -483,6 +483,7 @@ Currently known values for ID MAJOR and MINOR are as follows:
Windows 2000 2 5 0
Windows XP 2 5 1
Windows Server 2003 2 5 2
+ Windows Vista 2 6 0
On Windows NT 4 SP6 and later this function returns the following
additional values: SPMAJOR, SPMINOR, SUITEMASK, PRODUCTTYPE.