summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/tlperl/lib/Win32.pm
diff options
context:
space:
mode:
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/tlperl/lib/Win32.pm')
-rw-r--r--systems/texlive/tlnet/tlpkg/tlperl/lib/Win32.pm70
1 files changed, 64 insertions, 6 deletions
diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Win32.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Win32.pm
index 1092c5ab52..2ad726a99a 100644
--- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Win32.pm
+++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Win32.pm
@@ -8,7 +8,7 @@ package Win32;
require DynaLoader;
@ISA = qw|Exporter DynaLoader|;
- $VERSION = '0.57';
+ $VERSION = '0.59';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@@ -306,6 +306,8 @@ sub PRODUCT_EDUCATION_N () { 0x7A } # Windows 10 Education
sub PRODUCT_UNLICENSED () { 0xABCDABCD } # product has not been activated and is no longer in the grace period
+sub PROCESSOR_ARCHITECTURE_ARM64 () { 12 } # ARM64
+sub PROCESSOR_ARCHITECTURE_ARM () { 5 } # ARM
sub PROCESSOR_ARCHITECTURE_AMD64 () { 9 } # x64 (AMD or Intel)
sub PROCESSOR_ARCHITECTURE_IA64 () { 6 } # Intel Itanium Processor Family (IPF)
sub PROCESSOR_ARCHITECTURE_INTEL () { 0 } # x86
@@ -319,6 +321,14 @@ sub _GetProcessorArchitecture {
2200 => PROCESSOR_ARCHITECTURE_IA64,
8664 => PROCESSOR_ARCHITECTURE_AMD64,
}->{Win32::GetChipName()};
+
+ if (!defined($arch)) {
+ $arch = {
+ 5 => PROCESSOR_ARCHITECTURE_ARM,
+ 12 => PROCESSOR_ARCHITECTURE_ARM64,
+ }->{Win32::GetChipArch()};
+ }
+
return defined($arch) ? $arch : PROCESSOR_ARCHITECTURE_UNKNOWN;
}
@@ -890,10 +900,17 @@ $ENV{PROCESSOR_ARCHITECTURE}. This might not work on Win9X.
=item Win32::GetChipName()
-Returns the processor type: 386, 486 or 586 for x86 processors, 8664
-for the x64 processor and 2200 for the Itanium. Since it returns the
-native processor type it will return a 64-bit processor type even when
-called from a 32-bit Perl running on 64-bit Windows.
+Returns the processor type: 386, 486 or 586 for x86 processors, 8664 for the x64
+processor and 2200 for the Itanium. For arm/arm64 processor, the value is marked
+as "Reserved" (not specified, but usually 0) in Microsoft documentation, so it's
+better to use GetChipArch(). Since it returns the native processor type it will
+return a 64-bit processor type even when called from a 32-bit Perl running on
+64-bit Windows.
+
+=item Win32::GetChipArch()
+
+Returns the processor architecture: 0 for x86 processors, 5 for arm, 6 for
+Itanium, 9 for x64 and 12 for arm64, and 0xFFFF for unknown architecture.
=item Win32::GetConsoleCP()
@@ -1305,11 +1322,52 @@ of hex digits with surrounding braces. For example:
{09531CF1-D0C7-4860-840C-1C8C8735E2AD}
+=item Win32::HttpGetFile(URL, FILENAME [, IGNORE_CERT_ERRORS])
+
+Uses the WinHttp library to download the file specified by the URL
+parameter to the local file specified by FILENAME. The optional third
+parameter, if true, indicates that certficate errors are to be ignored
+for https connections; please use with caution in a safe environment,
+such as when testing locally using a self-signed certificate.
+
+Only http and https protocols are supported. Authentication is not
+supported. The function is not available when building with gcc prior to
+4.8.0 because the WinHttp library is not available.
+
+In scalar context returns a boolean success or failure, and in list
+context also returns, in addition to the boolean status, a second
+value containing message text related to the status.
+
+If the call fails, C<Win32::GetLastError()> will return a numeric
+error code, which may be a system error, a WinHttp error, or a
+user-defined error composed of 1e9 plus the HTTP status code.
+
+Scalar context example:
+
+ print Win32::GetLastError()
+ unless Win32::HttpGetFile('http://example.com/somefile.tar.gz',
+ '.\file.tgz');
+
+List context example:
+
+ my ($ok, $msg) = Win32::HttpGetFile('http://example.com/somefile.tar.gz',
+ '.\file.tgz');
+ if ($ok) {
+ print "Success!: $msg\n";
+ }
+ else {
+ print "Failure!: $msg\n";
+ my $err = Win32::GetLastError();
+ if ($err > 1e9) {
+ printf "HTTP status: %d\n", ($err - 1e9);
+ }
+ }
+
=item Win32::InitiateSystemShutdown
(MACHINE, MESSAGE, TIMEOUT, FORCECLOSE, REBOOT)
-Shutsdown the specified MACHINE, notifying users with the
+Shuts down the specified MACHINE, notifying users with the
supplied MESSAGE, within the specified TIMEOUT interval. Forces
closing of all documents without prompting the user if FORCECLOSE is
true, and reboots the machine if REBOOT is true. This function works