Skip to content

Commit

Permalink
Merged
Browse files Browse the repository at this point in the history
  • Loading branch information
colinnewell committed Jun 28, 2010
2 parents 6db930e + 21683f3 commit 02fa9df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 7 additions & 5 deletions lib/Devel/Platform/Info/Win32.pm
Expand Up @@ -61,14 +61,16 @@ sub _InterpretWin32Info
my ($osname, $oslabel, $version, $source);
my %info;
my $NTWORKSTATION = 1;
if($major == 5 && $minor == 2)
if($major == 5 && $minor == 2 && $producttype == $NTWORKSTATION)
{
$osname = 'Windows XP Pro 64';
} elsif($major == 5 && $minor == 2 && $producttype != $NTWORKSTATION)
{
# server 2003, win home server
# server 2003 R2
# XP Pro 64
# I need more info from GetSystemMetrics and architecture info to
# I need more info from GetSystemMetrics
# be sure about the exact details.
$osname = 'Windows Server 2003 / XP 64';
$osname = 'Windows Server 2003';
} elsif($major == 5 && $minor == 1)
{
$osname = 'Windows XP';
Expand Down Expand Up @@ -173,7 +175,7 @@ Returns the following keys:
=head1 BUGS, PATCHES & FIXES
The module cannot accurately tell the difference between the Windows Server 2003 and Windows XP 64 or Windows Server 2003 R2.
The module cannot accurately tell the difference between the Windows Server 2003 and Windows Server 2003 R2.
It would be useful if we could tell is we are runing WOW64 but we don't do that yet either.
Expand Down
10 changes: 4 additions & 6 deletions t/55win32_agnostic.t
Expand Up @@ -4,7 +4,7 @@

use strict;

use Test::More tests => 22;
use Test::More tests => 21;

use Devel::Platform::Info::Win32;

Expand Down Expand Up @@ -57,19 +57,17 @@ is($os, 'Unrecognised - please file an RT case');

# FIXME: remove these once we can determine the O/S more reliably
$os = $win32->_InterpretWin32Info('', 5, 2, 3790, 2, 2, 0, 272, 2)->{osLabel};
is($os, 'Windows Server 2003 / XP 64');
is($os, 'Windows Server 2003');
$os = $win32->_InterpretWin32Info('', 5, 2, 3790, 2, 2, 0, 272, 2)->{osLabel};
is($os, 'Windows Server 2003 / XP 64');
is($os, 'Windows Server 2003');
$os = $win32->_InterpretWin32Info('', 5, 2, 3790, 2, 2, 0, 272, 1)->{osLabel};
is($os, 'Windows Server 2003 / XP 64');
is($os, 'Windows XP Pro 64');

TODO: {
local $TODO = 'These require me to add calls to other sources of information in order to figure them out.';
$os = $win32->_InterpretWin32Info('', 5, 2, 3790, 2, 2, 0, 272, 2)->{osLabel};
is($os, 'Windows Server 2003');
$os = $win32->_InterpretWin32Info('', 5, 2, 3790, 2, 2, 0, 272, 2)->{osLabel};
is($os, 'Windows XP Pro 64');
$os = $win32->_InterpretWin32Info('', 5, 2, 3790, 2, 2, 0, 272, 1)->{osLabel};
is($os, 'Windows Server 2003 R2');
}

0 comments on commit 02fa9df

Please sign in to comment.