require DynaLoader;
@ISA = qw|Exporter DynaLoader|;
- $VERSION = '0.31_01';
+ $VERSION = '0.32';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
=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)
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);
XSRETURN_PV(dname);
}
FreeLibrary(module);
+ SetLastError(retval);
}
else {
/* Win95 doesn't have NetWksta*(), so do it the old way */
# 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()
# - 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() };