summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSteve Hay <SteveHay@planit.com>2007-09-21 07:39:02 +0000
committerSteve Hay <SteveHay@planit.com>2007-09-21 07:39:02 +0000
commit166cd87e025da3b73833dbe6f3ac8a9279710d12 (patch)
treef4684b1dc39dad8d2612554eacb13d9e513bc5e0 /ext
parentc812d14677001807a06200e23fed431e7ac774bb (diff)
downloadperl-166cd87e025da3b73833dbe6f3ac8a9279710d12.tar.gz
Upgrade to Win32-0.32
p4raw-id: //depot/perl@31935
Diffstat (limited to 'ext')
-rw-r--r--ext/Win32/Win32.pm9
-rw-r--r--ext/Win32/Win32.xs5
-rw-r--r--ext/Win32/t/GetFileVersion.t4
-rw-r--r--ext/Win32/t/Names.t13
4 files changed, 20 insertions, 11 deletions
diff --git a/ext/Win32/Win32.pm b/ext/Win32/Win32.pm
index be3fd988cf..acdd4fd168 100644
--- a/ext/Win32/Win32.pm
+++ b/ext/Win32/Win32.pm
@@ -8,7 +8,7 @@ BEGIN {
require DynaLoader;
@ISA = qw|Exporter DynaLoader|;
- $VERSION = '0.31_01';
+ $VERSION = '0.32';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@@ -310,9 +310,10 @@ a name that can be passed to system calls and external programs.
=item Win32::DomainName()
-[CORE] Returns the name of the Microsoft Network domain that the
-owner of the current perl process is logged into. This function does
-B<not> work on Windows 9x.
+[CORE] Returns the name of the Microsoft Network domain or workgroup
+that the owner of the current perl process is logged into. The
+"Workstation" service must be running to determine this
+information. This function does B<not> work on Windows 9x.
=item Win32::ExpandEnvironmentStrings(STRING)
diff --git a/ext/Win32/Win32.xs b/ext/Win32/Win32.xs
index 6587cf29a8..9d0142d6f5 100644
--- a/ext/Win32/Win32.xs
+++ b/ext/Win32/Win32.xs
@@ -1178,8 +1178,10 @@ XS(w32_DomainName)
DWORD wki100_ver_major;
DWORD wki100_ver_minor;
} *pwi;
+ DWORD retval;
+ retval = pfnNetWkstaGetInfo(NULL, 100, &pwi);
/* NERR_Success *is* 0*/
- if (0 == pfnNetWkstaGetInfo(NULL, 100, &pwi)) {
+ if (retval == 0) {
if (pwi->wki100_langroup && *(pwi->wki100_langroup)) {
WideCharToMultiByte(CP_ACP, 0, pwi->wki100_langroup,
-1, (LPSTR)dname, dnamelen, NULL, NULL);
@@ -1193,6 +1195,7 @@ XS(w32_DomainName)
XSRETURN_PV(dname);
}
FreeLibrary(module);
+ SetLastError(retval);
}
else {
/* Win95 doesn't have NetWksta*(), so do it the old way */
diff --git a/ext/Win32/t/GetFileVersion.t b/ext/Win32/t/GetFileVersion.t
index 0129ce1198..b9e51f821d 100644
--- a/ext/Win32/t/GetFileVersion.t
+++ b/ext/Win32/t/GetFileVersion.t
@@ -12,5 +12,7 @@ plan tests => 2;
my @version = Win32::GetFileVersion($^X);
my $version = $version[0] + $version[1] / 1000 + $version[2] / 1000000;
-ok($version, $]);
+# numify $] because it is a version object in 5.10 which will stringify with trailing 0s
+ok($version, 0+$]);
+
ok($version[3], int(Win32::BuildNumber()));
diff --git a/ext/Win32/t/Names.t b/ext/Win32/t/Names.t
index 414c4793d3..bfe8797190 100644
--- a/ext/Win32/t/Names.t
+++ b/ext/Win32/t/Names.t
@@ -15,8 +15,11 @@ plan tests => $tests;
# test Win32::DomainName()
if (Win32::IsWinNT()) {
my $domain = eval { Win32::DomainName() };
- is( $@, '', "Win32::DomainName()" );
- like( $domain, '/^[a-zA-Z0-9!@#$%^&()_\'{}.~-]+$/', " - checking returned domain" );
+ SKIP: {
+ skip 'The Workstation service has not been started', 2 if $^E == 2138;
+ is( $@, '', "Win32::DomainName()" );
+ like( $domain, '/^[a-zA-Z0-9!@#$%^&()_\'{}.~-]+$/', " - checking returned domain" );
+ }
}
# test Win32::GetArchName()
@@ -38,9 +41,9 @@ cmp_ok( length($osname), '>', 3, " - checking returned OS name" );
# - list context
my ($osname2, $desc) = eval { Win32::GetOSName() };
is( $@, '', "Win32::GetOSName() in list context" );
-cmp_ok( length($osname), '>', 3, " - checking returned OS name" );
-cmp_ok( length($desc ), '>', 3, " - checking returned description" );
-is( $osname2, $osname, " - checking that OS name is the same in both calls" );
+cmp_ok( length($osname2), '>', 3, " - checking returned OS name" );
+ok( defined($desc), " - checking returned description" );
+is( $osname2, $osname, " - checking that OS name is the same in both calls" );
# test Win32::LoginName()
my $login = eval { Win32::LoginName() };