📄 registry.html
字号:
access is desired when opening the new subkey. See <a href="#item_regopenkeyex"><code>RegOpenKeyEx()</code></a>.</p>
</dd>
<dd>
<p><code>$pSecAttr</code> is a <code>SECURITY_ATTRIBUTES</code> structure packed into
a Perl string which controls whether the returned handle can be
inherited by child processes. Normally you would pass <code>[]</code> for
this parameter to have <code>NULL</code> passed to the underlying API
indicating that the handle cannot be inherited. If not under
Windows95, then <code>$pSecAttr</code> also allows you to specify
<code>SECURITY_DESCRIPTOR</code> 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.</p>
</dd>
<dd>
<p><code>$phKey</code> will be set to the handle to be used to access the new
subkey if the call succeeds.</p>
</dd>
<dd>
<p><code>$piDisp</code> will be set to either <code>REG_CREATED_NEW_KEY</code> or
<code>REG_OPENED_EXISTING_KEY</code> to indicate for which reason the
call succeeded. Can be specified as <code>[]</code> if you don't care.</p>
</dd>
<dd>
<p>If <code>$phKey</code> and <code>$piDisp</code> start out as integers, then they will
probably remain unchanged if the call fails.</p>
</dd>
</li>
<dt><strong><a name="item_regdeletekey">RegDeleteKey</a></strong>
<dt><strong><code>RegDeleteKey( $hKey, $sSubKey )</code></strong>
<dd>
<p>Deletes a subkey of an open Registry key provided that the subkey
contains no subkeys of its own [but the subkey may contain values].
Returns a true value if successful and a false value [and sets
<a href="../../lib/Pod/perlvar.html#item___e"><code>$^E</code></a>/<a href="#item_reglasterror"><code>regLastError()</code></a>] on failure.</p>
</dd>
<dd>
<p><code>$hKey</code> is the handle to a Registry key [either <code>HKEY_*</code> or from
a previous call].</p>
</dd>
<dd>
<p><code>$sSubKey</code> is the name of the subkey to be deleted.</p>
</dd>
</li>
<dt><strong><a name="item_regdeletevalue">RegDeleteValue</a></strong>
<dt><strong><code>RegDeleteValue( $hKey, $sValueName )</code></strong>
<dd>
<p>Deletes a value from an open Registry key. Returns a true value if
successful and a false value [and sets <a href="../../lib/Pod/perlvar.html#item___e"><code>$^E</code></a>/<a href="#item_reglasterror"><code>regLastError()</code></a>] on
failure.</p>
</dd>
<dd>
<p><code>$hKey</code> is the handle to a Registry key [either <code>HKEY_*</code> or from
a previous call].</p>
</dd>
<dd>
<p><code>$sValueKey</code> is the name of the value to be deleted.</p>
</dd>
</li>
<dt><strong><a name="item_regenumkey">RegEnumKey</a></strong>
<dt><strong><code>RegEnumKey( $hKey, $uIndex, $osName, $ilNameSize )</code></strong>
<dd>
<p>This routine is meant only for compatibility with Windows version
3.1. Use <a href="#item_regenumkeyex"><code>RegEnumKeyEx()</code></a> instead.</p>
</dd>
</li>
<dt><strong><a name="item_regenumkeyex">RegEnumKeyEx</a></strong>
<dt><strong><code>RegEnumKeyEx( $hKey, $uIndex, $osName, $iolName, $pNull, $osClass, $iolClass, $opftLastWrite )</code></strong>
<dd>
<p>Lets you enumerate the names of all of the subkeys directly under
an open Registry key. Returns a true value if successful and a false
value [and sets <a href="../../lib/Pod/perlvar.html#item___e"><code>$^E</code></a>/<a href="#item_reglasterror"><code>regLastError()</code></a>] on failure.</p>
</dd>
<dd>
<p><code>$hKey</code> is the handle to a Registry key [either <code>HKEY_*</code> or from
a previous call].</p>
</dd>
<dd>
<p><code>$iIndex</code> is the sequence number of the immediate subkey that
you want information on. Start with this value as <code>0</code> then
repeat the call incrementing this value each time until the
call fails with <a href="../../lib/Pod/perlvar.html#item___e"><code>$^E</code></a>/<a href="#item_reglasterror"><code>regLastError()</code></a> numerically equal to
<code>ERROR_NO_MORE_ITEMS</code>.</p>
</dd>
<dd>
<p><code>$sName</code> will be set to the name of the subkey. Can be <code>[]</code> if
you don't care about the name.</p>
</dd>
<dd>
<p><code>$plName</code> initially specifies the [minimum] buffer size to be
allocated for <code>$sName</code>. Will be set to the length of the subkey
name if the requested subkey exists even if <code>$sName</code> isn't
successfully set to the subkey name. See <a href="#buffer_sizes">Buffer sizes</a> for
more information.</p>
</dd>
<dd>
<p><code>$pNull</code> is reserved for future used and should be passed as <code>[]</code>.</p>
</dd>
<dd>
<p><code>$sClass</code> will be set to the class name for the subkey. Can be
<code>[]</code> if you don't care about the class.</p>
</dd>
<dd>
<p><code>$plClass</code> initially specifies the [minimum] buffer size to be
allocated for <code>$sClass</code> and will be set to the length of the
subkey class name if the requested subkey exists. See <a href="#buffer_sizes">Buffer sizes</a> for more information.</p>
</dd>
<dd>
<p><code>$pftLastWrite</code> will be set to a <code>FILETIME</code> structure packed
into a Perl string and indicating when the subkey was last changed.
Can be <code>[]</code>.</p>
</dd>
<dd>
<p>You may omit both <code>$plName</code> and <code>$plClass</code> to get the same effect
as passing in <code>[]</code> for each of them.</p>
</dd>
</li>
<dt><strong><a name="item_regenumvalue">RegEnumValue</a></strong>
<dt><strong><code>RegEnumValue( $hKey, $uIndex, $osValName, $iolValName, $pNull, $ouType, $opValData, $iolValData )</code></strong>
<dd>
<p>Lets you enumerate the names of all of the values contained in an
open Registry key. Returns a true value if successful and a false
value [and sets <a href="../../lib/Pod/perlvar.html#item___e"><code>$^E</code></a>/<a href="#item_reglasterror"><code>regLastError()</code></a>] on failure.</p>
</dd>
<dd>
<p><code>$hKey</code> is the handle to a Registry key [either <code>HKEY_*</code> or from
a previous call].</p>
</dd>
<dd>
<p><code>$iIndex</code> is the sequence number of the value that you want
information on. Start with this value as <code>0</code> then repeat the
call incrementing this value each time until the call fails with
<code>ERROR_NO_MORE_ITEMS</code>.</p>
</dd>
<dd>
<p><code>$sValName</code> will be set to the name of the value. Can be <code>[]</code>
if you don't care about the name.</p>
</dd>
<dd>
<p><code>$plValName</code> initially specifies the [minimum] buffer size to be
allocated for <code>$sValName</code>. Will be set to the length of the value
name if the requested value exists even if <code>$sValName</code> isn't
successfully set to the value name. See <a href="#buffer_sizes">Buffer sizes</a> for
more information.</p>
</dd>
<dd>
<p><code>$pNull</code> is reserved for future used and should be passed as <code>[]</code>.</p>
</dd>
<dd>
<p><code>$piType</code> will be set to the type of data stored in the value data.
If the call succeeds, it will be set to a <code>REG_*</code> value unless
passed in as <code>[]</code>.</p>
</dd>
<dd>
<p><code>$pValData</code> will be set to the data [packed into a Perl string]
that is stored in the requested value. Can be <code>[]</code> if you don't
care about the value data.</p>
</dd>
<dd>
<p><code>$plValData</code> initially specifies the [minimum] buffer size to be
allocated for <code>$sValData</code> and will be set to the length of the
value data if the requested value exists. See <a href="#buffer_sizes">Buffer sizes</a> for
more information.</p>
</dd>
<dd>
<p>You may omit both <code>$plValName</code> and <code>$plValData</code> to get the same
effect as passing in <code>[]</code> for each of them.</p>
</dd>
</li>
<dt><strong><a name="item_regflushkey">RegFlushKey</a></strong>
<dt><strong><code>RegFlushKey( $hKey )</code></strong>
<dd>
<p>Forces the 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. Returns a true value if successful
and a false value [and sets <a href="../../lib/Pod/perlvar.html#item___e"><code>$^E</code></a>/<a href="#item_reglasterror"><code>regLastError()</code></a>] on failure.</p>
</dd>
<dd>
<p><code>$hKey</code> is the handle to a Registry key [either <code>HKEY_*</code> or from
a previous call].</p>
</dd>
</li>
<dt><strong><a name="item_reggetkeysecurity">RegGetKeySecurity</a></strong>
<dt><strong><code>RegGetKeySecurity( $hKey, $uSecInfo, $opSecDesc, $iolSecDesc )</code></strong>
<dd>
<p>Retrieves one of the <code>SECURITY_DESCRIPTOR</code> structures describing
part of the security for an open Registry key. Returns a true value
if successful and a false value [and sets <a href="../../lib/Pod/perlvar.html#item___e"><code>$^E</code></a>/<a href="#item_reglasterror"><code>regLastError()</code></a>]
on failure.</p>
</dd>
<dd>
<p><code>$hKey</code> is the handle to a Registry key [either <code>HKEY_*</code> or from
a previous call].</p>
</dd>
<dd>
<p><code>$iSecInfo</code> is a numeric <code>SECURITY_INFORMATION</code> value that
specifies which parts of the <code>SECURITY_DESCRIPTOR</code> structure
to retrieve. Should be <code>OWNER_SECURITY_INFORMATION</code>,
<code>GROUP_SECURITY_INFORMATION</code>, <code>DACL_SECURITY_INFORMATION</code>, or
or <code>SACL_SECURITY_INFORMATION</code> or two or more of these bits
combined using <code>|</code>.</p>
</dd>
<dd>
<p><code>$pSecDesc</code> will be set to the requested <code>SECURITY_DESCRIPTOR</code>
structure [packed into a Perl string].</p>
</dd>
<dd>
<p><code>$plSecDesc</code> initially specifies the [minimum] buffer size to be
allocated for <code>$sSecDesc</code> and will be set to the length of the
security descriptor. See <a href="#buffer_sizes">Buffer sizes</a> for more information.
You may omit this parameter to get the same effect as passing in
<code>[]</code> for it.</p>
</dd>
</li>
<dt><strong><a name="item_reglasterror">regLastError</a></strong>
<dt><strong><code>$svError= regLastError();</code></strong>
<dt><strong><code>regLastError( $uError );</code></strong>
<dd>
<p>Returns the last error encountered by a routine from this module.
It is just like <a href="../../lib/Pod/perlvar.html#item___e"><code>$^E</code></a> except it isn't changed by anything except
routines from this module. Ideally you could just use <a href="../../lib/Pod/perlvar.html#item___e"><code>$^E</code></a>, but
current versions of Perl often overwrite <a href="../../lib/Pod/perlvar.html#item___e"><code>$^E</code></a> before you get a
chance to check it and really old versions of Perl don't really
support <a href="../../lib/Pod/perlvar.html#item___e"><code>$^E</code></a> under Win32.</p>
</dd>
<dd>
<p>Just like <a href="../../lib/Pod/perlvar.html#item___e"><code>$^E</code></a>, in a numeric context <a href="#item_reglasterror"><code>regLastError()</code></a> returns
the numeric error value while in a string context it returns a
text description of the error [actually it returns a Perl scalar
that contains both values so <a href="#item_reglasterror"><code>$x= regLastError()</code></a> causes <code>$x</code>
to give different values in string vs. numeric contexts].</p>
</dd>
<dd>
<p>The last form sets the error returned by future calls to
<a href="#item_reglasterror"><code>regLastError()</code></a> and should not be used often. <code>$uError</code> must
be a numeric error code. Also returns the dual-valued version
of <code>$uError</code>.</p>
</dd>
</li>
<dt><strong><a name="item_regloadkey">RegLoadKey</a></strong>
<dt><strong><code>RegLoadKey( $hKey, $sSubKey, $sFileName )</code></strong>
<dd>
<p>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 <a href="#item_regsavekey"><code>RegSaveKey()</code></a>. Returns a true value if successful and a
false value [and sets <a href="../../lib/Pod/perlvar.html#item___e"><code>$^E</code></a>/<a href="#item_reglasterror"><code>regLastError()</code></a>] on failure.</p>
</dd>
<dd>
<p><code>$hKey</code> is the handle to a Registry key that can have hives
loaded to it. This must be <code>HKEY_LOCAL_MACHINE</code>, <code>HKEY_USERS</code>,
or a remote version of one of these from a call to
<a href="#item_regconnectregistry"><code>RegConnectRegistry()</code></a>.</p>
</dd>
<dd>
<p><code>$sSubKey</code> is the name of the new subkey to created and associated
with the hive file.</p>
</dd>
<dd>
<p><code>$sFileName</code> is the name of the hive file to be loaded. This
file name is interpretted relative to the
<code>%SystemRoot%/System32/config</code> directory on the computer where
the <code>$hKey</code> key resides. If <code>$sFileName</code> is on a FAT file
system, then its name must not have an extension.</p>
</dd>
<dd>
<p>You must have the <code>SE_RESTORE_NAME</code> privilege to use this routine.</p>
</dd>
<dd>
<p>WARNING: Loading of hive files via a network share may silently
corrupt the hive and so should not be attempted [this is a problem
in at least some versions of the underlying API which this module
does not try to fix or avoid]. To access a hive file located on a
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -