ext/Win32/t/GetFullPathName.t See if Win32 extension works
ext/Win32/t/GetLongPathName.t See if Win32 extension works
ext/Win32/t/GetOSVersion.t See if Win32 extension works
+ext/Win32/t/GetShortPathName.t See if Win32 extension works
ext/Win32/t/GuidGen.t See if Win32 extension works
ext/Win32/t/Unicode.t See if Win32 extension works
ext/Win32/Win32.pm Win32 extension Perl module
VERSION_FROM => 'Win32.pm',
LIBS => \@libs,
INSTALLDIRS => ($] >= 5.008004 ? 'perl' : 'site'),
+ NO_META => 1,
AUTHOR => 'Jan Dubois <jand@activestate.com>',
ABSTRACT_FROM => 'Win32.pm',
require DynaLoader;
@ISA = qw|Exporter DynaLoader|;
- $VERSION = '0.29';
+ $VERSION = '0.30';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
(8.3) path components where available. For path components where the
file system has not generated the short form the returned path will
use the long form, so this function might still for instance return a
-path containing spaces. Compare with Win32::GetFullPathName() and
+path containing spaces. Returns C<undef> when the PATHNAME does not
+exist. Compare with Win32::GetFullPathName() and
Win32::GetLongPathName().
=item Win32::GetProcAddress(INSTANCE, PROCNAME)
current process/thread is running belongs to the local group of
Administrators in the built-in system domain; returns 0 if not.
On Windows Vista it will only return non-zero if the process is
-actually running with elevated privileges. Returns the undefined
-value and prints a warning if an error occurred. This function always
+actually running with elevated privileges. Returns C<undef>
+and prints a warning if an error occurred. This function always
returns 1 on Win9X.
=item Win32::IsWinNT()
WCHAR *wlong = sv_to_wstr(aTHX_ ST(0));
len = GetShortPathNameW(wlong, wshort, countof(wshort));
Safefree(wlong);
- if (len < sizeof(wshort)) {
+ if (len && len < sizeof(wshort)) {
ST(0) = wstr_to_sv(aTHX_ wshort);
XSRETURN(1);
}
--- /dev/null
+use strict;
+use Test;
+use Win32;
+
+my $path = "Long Path $$";
+unlink($path);
+END { unlink $path }
+
+plan tests => 5;
+
+Win32::CreateFile($path);
+ok(-f $path);
+
+my $short = Win32::GetShortPathName($path);
+ok($short, qr/^\S{1,8}(\.\S{1,3})?$/);
+ok(-f $short);
+
+unlink($path);
+ok(!-f $path);
+ok(!defined Win32::GetShortPathName($path));
use strict;
use Test;
-
use Cwd qw(cwd);
use Win32;