perl
view release on metacpan or search on metacpan
cpan/Win32/Win32.pm view on Meta::CPAN
metrics return integer values.
=item Win32::GetProcAddress(INSTANCE, PROCNAME)
Returns the address of a function inside a loaded library. The
information about what you can do with this address has been lost in
the mist of time. Use the Win32::API module instead of this deprecated
function.
=item Win32::GetProcessPrivileges([PID])
Returns a reference to a hash holding the information about the privileges
held by the specified process. The keys are privilege names, and the values
are booleans indicating whether a given privilege is currently enabled or not.
If the optional PID parameter is omitted, the function queries the current
process.
Example return value:
{
SeTimeZonePrivilege => 0,
SeShutdownPrivilege => 0,
SeUndockPrivilege => 0,
SeIncreaseWorkingSetPrivilege => 0,
SeChangeNotifyPrivilege => 1
}
=item Win32::GetProductInfo(OSMAJOR, OSMINOR, SPMAJOR, SPMINOR)
Retrieves the product type for the operating system on the local
computer, and maps the type to the product types supported by the
specified operating system. Please refer to the Microsoft
documentation of the GetProductInfo() function for more information
about the parameters and return value. This function requires Windows
Vista or later.
See also the Win32::GetOSName() and Win32::GetOSDisplayName()
functions which provide a higher level abstraction of the data
returned by this function.
=item Win32::GetTickCount()
[CORE] Returns the number of milliseconds elapsed since the last
system boot. Resolution is limited to system timer ticks (about 10ms
on WinNT and 55ms on Win9X).
=item Win32::GuidGen()
Creates a globally unique 128 bit integer that can be used as a
persistent identifier in a distributed setting. To a very high degree
of certainty this function returns a unique value. No other
invocation, on the same or any other system (networked or not), should
return the same value.
The return value is formatted according to OLE conventions, as groups
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)
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
only on WinNT.
=item Win32::IsAdminUser()
Returns non zero if the account in whose security context the
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 C<undef>
and prints a warning if an error occurred. This function always
returns 1 on Win9X.
=item Win32::IsDeveloperModeEnabled()
Returns true if the developer mode is currently enabled. It always returns
false on Windows versions older than Windows 10.
=item Win32::IsSymlinkCreationAllowed()
Returns true if the current process is allowed to create symbolic links. This
function is a convenience wrapper around Win32::GetProcessPrivileges() and
Win32::IsDeveloperModeEnabled().
=item Win32::IsWinNT()
[CORE] Returns non zero if the Win32 subsystem is Windows NT.
=item Win32::IsWin95()
[CORE] Returns non zero if the Win32 subsystem is Windows 95.
=item Win32::LoadLibrary(LIBNAME)
Loads a dynamic link library into memory and returns its module
handle. This handle can be used with Win32::GetProcAddress() and
Win32::FreeLibrary(). This function is deprecated. Use the Win32::API
module instead.
=item Win32::LoginName()
( run in 5.027 seconds using v1.01-cache-2.11-cpan-df04353d9ac )