📄 registry.pm
字号:
to wait longer for the application to exit or force it to exit now.
At any of these prompts the user can press B<CANCEL> to abort the
shutdown but if no applications have unsaved data, they will likely
all exit quickly and the shutdown will progress with the remote user
having no option to cancel the shutdown.
If C<$bForce> is true, all applications are told to exit immediately
and so will not prompt the user even if there is unsaved data. Any
applications that take too long to exit will be forcibly killed after
a short time. The only way to abort the shutdown is to call
C<AbortSystemShutdown()> before the timeout expires and there is no
way to abort the shutdown once it has begun.
If C<$bReboot> is true, the computer will automatically reboot once
the shutdown is complete. If C<$bReboot> is false, then when the
shutdown is complete the computer will halt at a screen indicating
that the shutdown is complete and offering a way for the user to
start to boot the computer.
You must have the C<"SeRemoteShutdownPrivilege"> privilege
on the remote computer for this call to succeed. If shutting
down the local computer, then the calling process must have
the C<"SeShutdownPrivilege"> privilege and have it enabled.
=item RegCloseKey( $hKey )
Closes the handle to a Registry key returned by C<RegOpenKeyEx()>,
C<RegConnectRegistry()>, C<RegCreateKeyEx()>, or a few other
routines.
=item RegConnectRegistry( $sComputer, $hKey, $phKey )
Connects to one of the root Registry keys of a remote computer.
C<$sComputer> is the name [or address] of a remote computer you
whose Registry you wish to access.
C<$hKey> must be either C<HKEY_LOCAL_MACHINE> or C<HKEY_USERS>
and specifies which root Registry key on the remote computer
you wish to have access to.
C<$phKey> will be set to the handle to be used to access the remote
Registry key.
=item RegCreateKey( $hKey, $sSubKey, $phKey )
This routine is meant only for compatibility with Windows version
3.1. Use C<RegCreateKeyEx()> instead.
=item RegCreateKeyEx( $hKey, $sSubKey, $iZero, $sClass, $iOpts, $iAccess, $pSecAttr, $phKey, $piDisp )
Creates a new Registry subkey.
C<$hKey> is the handle to a Registry key [either C<HKEY_*> or from
a previous call].
C<$sSubKey> is the name of the new subkey to be created.
C<$iZero> is reserved for future use and should always be specified
as C<0>.
C<$sClass> is a string to be used as the class for the new
subkey. We are not aware of any current use for Registry key
class information so the empty string, C<"">, should usually
be used here.
C<$iOpts> is a numeric value containing bits that control options
used while creating the new subkey. C<REG_OPTION_NON_VOLATILE>
is the default. C<REG_OPTION_VOLATILE> [which is ignored on
Windows 95] means the data stored under this key is not kept in a
file and will not be preserved when the system reboots.
C<REG_OPTION_BACKUP_RESTORE> [also ignored on Windows 95] means
ignore the C<$iAccess> parameter and try to open the new key with
the access required to backup or restore the key.
C<$iAccess> is a numeric mask of bits specifying what type of
access is desired when opening the new subkey. See C<RegOpenKeyEx()>.
C<$pSecAttr> is a C<SECURITY_ATTRIBUTES> structure packed into
a Perl string which controls whether the returned handle can be
inherited by child processes. Normally you would pass C<[]> for
this argument to have C<NULL> passed to the underlying API
indicating that the handle cannot be inherited. If not under
Windows95, then C<$pSecAttr> also allows you to specify
C<SECURITY_DESCRIPTOR> that controls which users will have
what type of access to the new key -- otherwise the new key
inherits its security from its parent key.
C<$phKey> will be set to the handle to be used to access the new subkey.
C<$piDisp> will be set to either C<REG_CREATED_NEW_KEY> or
C<REG_OPENED_EXISTING_KEY> to indicate for which reason the
call succeeded. Can be specified as C<[]> if you don't care.
If C<$phKey> and C<$piDisp> start out is integers, then they will
probably remain unchanged if the call fails.
=item RegDeleteKey( $hKey, $sSubKey )
Deletes a subkey of an open Registry key provided that the subkey
contains no subkeys of its own [but the subkey may contain values].
C<$hKey> is the handle to a Registry key [either C<HKEY_*> or from
a previous call].
C<$sSubKey> is the name of the subkey to be deleted.
=item RegDeleteValue( $hKey, $sValueName )
Deletes a values from an open Registry key provided.
C<$hKey> is the handle to a Registry key [either C<HKEY_*> or from
a previous call].
C<$sValueKey> is the name of the value to be deleted.
=item RegEnumKey( $hKey, $iIndex, $sName, $lNameSize )
This routine is meant only for compatibility with Windows version
3.1. Use C<RegEnumKeyEx()> instead.
=item RegEnumKeyEx( $hKey, $iIndex, $sName, $plName, $pNull, $sClass, $plClass, $pftLastWrite )
Lets you enumerate the names of all of the subkeys directly under
an open Registry key.
C<$hKey> is the handle to a Registry key [either C<HKEY_*> or from
a previous call].
C<$iIndex> is the sequence number of the immediate subkey that you
want information on. Start with this value as C<0> then repeat
the call incrementing this value each time until the call fails
with C<ERROR_NO_MORE_ITEMS>.
C<$sName> will be set to the name of the subkey. Can be C<[]> if
you don't care about the name.
C<$plName> initially specifies the [minimum] buffer size to be
allocated for C<$sName>. Will be set to the length of the subkey
name if the requested subkey exists even if C<$sName> isn't
successfully set to the subkey name. See L<Buffer sizes> for
more information.
C<$pNull> is reserved for future used and should be passed as C<[]>.
C<$sClass> will be set to the class name for the subkey. Can be
C<[]> if you don't care about the class.
C<$plClass> initially specifies the [minimum] buffer size to be
allocated for C<$sClass> and will be set to the length of the
subkey class name if the requested subkey exists. See L<Buffer
sizes> for more information.
C<$pftLastWrite> will be set to a C<FILETIME> structure packed
into a Perl string and indicating when the subkey was last changed.
Can be C<[]>.
You may omit both C<$plName> and C<$plClass> to get the same effect
as passing in C<[]> for each of them.
=item RegEnumValue( $hKey, $iIndex, $sValName, $plValName, $pNull, $piType, $pValData, $plValData )
Lets you enumerate the names of all of the values contained in an
open Registry key.
C<$hKey> is the handle to a Registry key [either C<HKEY_*> or from
a previous call].
C<$iIndex> is the sequence number of the value that you want
information on. Start with this value as C<0> then repeat the
call incrementing this value each time until the call fails with
C<ERROR_NO_MORE_ITEMS>.
C<$sValName> will be set to the name of the value. Can be C<[]>
if you don't care about the name.
C<$plValName> initially specifies the [minimum] buffer size to be
allocated for C<$sValName>. Will be set to the length of the value
name if the requested value exists even if C<$sValName> isn't
successfully set to the value name. See L<Buffer sizes> for
more information.
C<$pNull> is reserved for future used and should be passed as C<[]>.
C<$piType> will be set to the type of data stored in the value data.
If the call succeeds, it will be set to a C<REG_*> value unless
passed in as C<[]>.
C<$pValData> will be set to the data [packed into a Perl string]
that is stored in the requested value. Can be C<[]> if you don't
care about the value data.
C<$plValData> initially specifies the [minimum] buffer size to be
allocated for C<$sValData> and will be set to the length of the
value data if the requested value exists. See L<Buffer sizes> for
more information.
You may omit both C<$plValName> and C<$plValData> to get the same
effect as passing in C<[]> for each of them.
=item RegFlushKey( $hKey )
Forces that data stored under an open Registry key to be flushed
to the disk file where the data is preserved between reboots.
Forced flushing is not guaranteed to be efficient so this routine
should almost never be called.
C<$hKey> is the handle to a Registry key [either C<HKEY_*> or from
a previous call].
=item RegGetKeySecurity( $hKey, $iSecInfo, $pSecDesc, $plSecDesc )
Retrieves one of the C<SECURITY_DESCRIPTOR> structures describing
part of the security for an open Registry key.
C<$hKey> is the handle to a Registry key [either C<HKEY_*> or from
a previous call].
C<$iSecInfo> is a numeric C<SECURITY_INFORMATION> value that
specifies which C<SECURITY_DESCRIPTOR> structure to retrieve. Should
be C<OWNER_SECURITY_INFORMATION>, C<GROUP_SECURITY_INFORMATION>,
C<DACL_SECURITY_INFORMATION>, or C<SACL_SECURITY_INFORMATION>.
C<$pSecDesc> will be set to the requested C<SECURITY_DESCRIPTOR>
structure [packed into a Perl string].
C<$plSecDesc> initially specifies the [minimum] buffer size to be
allocated for C<$sSecDesc> and will be set to the length of the
security descriptor. See L<Buffer sizes> for more information.
You may omit this parameter to get the same effect as passing in
C<[]> for it.
=item RegLoadKey( $hKey, $sSubKey, $sFileName )
Loads a hive file. That is, it creates a new subkey in the
Registry and associates that subkey with a disk file that contains
a Registry hive so that the new subkey can be used to access the
keys and values stored in that hive. Hives are usually created
via C<RegSaveKey()>.
C<$hKey> is the handle to a Registry key that can have hives
loaded to it. This must be C<HKEY_LOCAL_MACHINE>, C<HKEY_USERS>,
or a remote version of one of these from a call to
C<RegConnectRegistry()>.
C<$sSubKey> is the name of the new subkey to created and associated
with the hive file.
C<$sFileName> is the name of the hive file to be loaded. This
file name is interpretted relative to the
C<%SystemRoot%/System32/config> directory on the computer where
the C<$hKey> key resides.
Loading of hive files located on network shares may fail or
corrupt the hive and so should not be attempted.
=item RegNotifyChangeKeyValue( $hKey, $bWatchSubtree, $iNotifyFilter, $hEvent, $bAsync )
Arranges for your process to be notified when part of the Registry
is changed.
C<$hKey> is the handle to a Registry key [either C<HKEY_*> or from
a previous call] for which you wish to be notified when any changes
are made to it.
If C<$bWatchSubtree> is true, then changes to any subkey or
descendant of C<$hKey> are also reported.
C<$iNotifyFilter> controllers what types of changes are reported. It
is a numeric value containing one or more of the following bit masks:
=over
=item REG_NOTIFY_CHANGE_NAME
Notify if a subkey is added or deleted to a monitored key.
=item REG_NOTIFY_CHANGE_LAST_SET
Notify if a value in a monitored key is added, deleted, or modified.
=item REG_NOTIFY_CHANGE_SECURITY
Notify a security descriptor of a monitored key is changed.
=item REG_NOTIFY_CHANGE_ATTRIBUTES
Notify if any attributes of a monitored key are changed [class
name or security descriptors].
=back
C<$hEvent> is ignored unless C<$bAsync> is true. Otherwise, C<$hEvent>
is a handle to a Win32 I<event> that will be signaled when changes are
to be reported.
If C<$bAsync> is true, then C<RegNotifyChangeKeyValue()> returns
immediately and uses C<$hEvent> to notify your process of changes.
If C<$bAsync> is false, then C<RegNotifyChangeKeyValue()> does
not return until there is a change to be notified of.
This routine does not work with Registry keys on remote computers.
=item RegOpenKey( $hKey, $sSubKey, $phKey )
This routine is meant only for compatibility with Windows version
3.1. Use C<RegOpenKeyEx()> instead.
=item RegOpenKeyEx( $hKey, $sSubKey, $iOptions, $iAccess, $phKey )
Opens an existing Registry key.
C<$hKey> is the handle to a Registry key [either C<HKEY_*> or from
a previous call].
C<$sSubKey> is the name of an existing subkey to be opened.
Can be C<""> or C<[]> to open an additional handle to the
key specified by C<$hKey>.
C<$iOptions> is a numeric value containing bits that control options
used while open the subkey. There are currently no supported options
so this parameters should be specified as C<0>.
C<$iAccess> is a numeric mask of bits specifying what type of
access is desired when opening the new subkey. Should be a
combination of one or more of the following bit masks:
=over
=item KEY_ALL_ACCESS
KEY_READ | KEY_WRITE | KEY_CREATE_LINK
=item KEY_READ
KEY_QUERY_VALUE | KEY_ENUMERATE_SUBKEYS | KEY_NOTIFY | STANDARD_RIGHTS_READ
=item KEY_WRITE
KEY_SET_VALUE | KEY_CREATE_SUB_KEY | STANDARD_RIGHTS_WRITE
=item KEY_QUERY_VALUE
=item KEY_SET_VALUE
=item KEY_ENUMERATE_SUB_KEYS
=item KEY_CREATE_SUB_KEY
=item KEY_NOTIFY
=item KEY_EXECUTE
Same as C<KEY_READ>.
=item KEY_CREATE_LINK
Allows you to create a symbolic link like C<HKEY_CLASSES_ROOT>
and C<HKEY_CURRENT_USER> if the method for doing so were documented.
=back
C<$phKey> will be set to the handle to be used to access the new subkey.
=item RegQueryInfoKey( $hKey, $sClass, $plClass, $pNull, $pcSubKeys, $plSubKey, $plSubClass, $pcValues, $plValName, $plValData, $plSecDesc, $pftTime )
Gets miscellaneous information about an open Registry key.
C<$hKey> is the handle to a Registry key [either C<HKEY_*> or from
a previous call].
C<$sClass> will be set to the class name for the key. Can be
C<[]> if you don't care about the class.
C<$plClass> initially specifies the [minimum] buffer size to be
allocated for C<$sClass> and will be set to the length of the
key's class name. See L<Buffer sizes> for more information.
You may omit this parameter to get the same effect as passing in
C<[]> for it.
C<$pNull> is reserved for future used and should be passed as C<[]>.
C<$pcSubKeys> will be set to the count of the number of subkeys directly
under this key. Can be C<[]>.
C<$plSubKey> will be set to the length of the longest subkey name.
Can be C<[]>.
C<$plSubClass> will be set to the length of the longest class name
used with an immediate subkey of this key. Can be C<[]>.
C<$pcValues> will be set to the count of the number of values in
this key. Can be C<[]>.
C<$plValName> will be set to the length of the longest value name
in this key. Can be C<[]>.
C<$plValData> will be set to the length of the longest value data
in this key. Can be C<[]>.
C<$plSecDesc> will be set to the length of this key's [longest?]
security descriptor.
C<$pftTime> will be set to a C<FILETIME> structure packed
into a Perl string and indicating when this key was last changed.
Can be C<[]>.
=item RegQueryMultipleValues( $hKey, $pValueEnts, $cValueEnts, $pBuffer, $plBuffer )
Allows you to use a single call to query several values from a
single open Registry key to maximize efficiency.
C<$hKey> is the handle to a Registry key [either C<HKEY_*> or from
a previous call].
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -