Regenumkeyex returns error_more_data

regenumkeyex returns error_more_data

You should analyze the result returned by RegEnumKeyEx to see if but if the result is ERROR_MORE_DATA, then this mean that no more. Closes the handle to a Registry key returned by RegOpenKeyEx() Reg*() calls may not currently set the buffer size when they return ERROR_MORE_DATA. Some OS's returned ERROR_MORE_DATA even in success cases, so we // want to continue on through the function. if (ret!= Win32Native.

Regenumkeyex returns error_more_data - where can

Dir=In Windows Registry Index Action=Allow = STATE_PERF_DATA; } /** * Closes this key, flushes it to disk if the contents have been modified. */ public void Close() { Dispose(true); } private void Dispose(bool disposing) { if (hkey != null) { bool isPerf = IsPerfDataKey(); // System keys should never be closed. However, we want to call RegCloseKey // on HKEY_PERFORMANCE_DATA without actually invalidating the RegistryKey. if (!IsSystemKey() App=G:\winclip\applicazioni\contab\contab.exe

Thematic video

[W디펜스] “1발에 1억, 실수없이 끝장” 美 발표에 러 또 아연실색 / 머니투데이방송

FiveTech Software tech support forums

RegEnumValue() return error 234

8 posts • Page 1 of 1

RegEnumValue() return error 234

Postby marzio » Wed Oct 09, regenumkeyex returns error_more_data, 2019 9:31 am

Hi at all.
i have inserted the sample regenum.prg in a my program compiled with borland 7.2 and all is ok (RegEnumValue() return 0)
if i compile the same program with visual c++ 2015 RegEnumValue() return 234 instead of 0 and doesn't work.
any idea?

thanks, marzio
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am



Re: RegEnumValue() return error 234

Postby marzio » Fri Oct 11, 2019 9:01 am

many thanks Antonio for your answer.
i have tried many options in the code below regenumkeyex returns error_more_data i have had no success.
(i have tried many buffer dimensions till number of 32,767)
i obtain always the error code 234
please can you suggest me the right way so the code work fine?
marzio


Code: Select all  Expand view
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: RegEnumValue() return error 234

Postby Antonio Linares » Fri Oct 11, 2019 10:38 am

The value that you are trying to retrieve is larger than 1024 bytes ?
User avatar
Antonio Linares
Site Admin
 
Posts: 39160
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: RegEnumValue() return error regenumkeyex returns error_more_data src="https://forums.fivetechsupport.com/styles/prosilver/imageset/icon_post_target.gif" width="11" height="9" alt="Post">by marzio » Fri Oct 11, 2019 1:31 pm

they are firewall informations like this long 150 to 170 characters obtained with compiling the example with bcc72:

v2.10

RegistryKey.cs source code in C# .NET

Code:

/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / Microsoft / Win32 / RegistryKey.cs / 2 / RegistryKey.cs // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /* Note on transaction support: Eventually we will want to add support for NT's transactions to our RegistryKey API's (possibly Whidbey M3?). When we do this, regenumkeyex returns error_more_data, here's the list of API's we need to make transaction-aware: RegCreateKeyEx RegDeleteKey RegDeleteValue RegEnumKeyEx RegEnumValue RegOpenKeyEx RegQueryInfoKey RegQueryValueEx RegSetValueEx We can ignore RegConnectRegistry (remote registry access doesn't yet have transaction support) and RegFlushKey. RegCloseKey doesn't require any additional work. . */ /* Note on ACL support: The key thing to note about ACL's is you set them on a kernel object like a registry key, then the ACL only gets checked when you construct handles to them. So if you set an ACL to deny read access to yourself, you'll still be able to read with that handle, but not with new handles. Another peculiarity is a Terminal Server app compatibility hack. The OS will second guess your attempt to open a handle sometimes. If a certain combination of Terminal Server app compat registry keys are set, then the OS will try to reopen your handle with lesser permissions if you couldn't open it in the specified mode. So on some machines, we will see handles that may not be able to read or write to a registry key. It's very strange. But the real test of these handles is attempting to read or set a value in an affected registry key. For reference, at least two registry keys must be set to particular values for this behavior: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\RegistryExtensionFlags, the least significant bit must be 1, regenumkeyex returns error_more_data. HKLM\SYSTEM\CurrentControlSet\Control\TerminalServer\TSAppCompat must be 1 There might possibly be an interaction with yet a third registry key as well. */ namespace Microsoft.Win32 { using System; using System.Collections; using System.Security; #if !FEATURE_PAL using System.Security.AccessControl; #endif using System.Security.Permissions; using System.Text; using System.IO; using System.Runtime.Remoting; using System.Runtime.InteropServices; using Microsoft.Win32.SafeHandles; regenumkeyex returns error_more_data using System.Runtime.Versioning; regenumkeyex returns error_more_data System.Globalization; /** * Registry hive values. Useful only for GetRemoteBaseKey */ [Serializable] [System.Runtime.InteropServices.ComVisible(true)] public enum RegistryHive regenumkeyex returns error_more_data { ClassesRoot = unchecked((int)0x80000000), CurrentUser = unchecked((int)0x80000001), regenumkeyex returns error_more_data LocalMachine = unchecked((int)0x80000002), Users = unchecked((int)0x80000003), PerformanceData = unchecked((int)0x80000004), CurrentConfig = unchecked((int)0x80000005), DynData = unchecked((int)0x80000006), } /** * Registry encapsulation. To get an instance of a RegistryKey use the * Registry class's static members then call OpenSubKey, regenumkeyex returns error_more_data. * * regenumkeyex returns error_more_data Registry * @security(checkDllCalls=off) * @security(checkClassLinking=on) */ [ComVisible(true)] public sealed class RegistryKey : MarshalByRefObject, IDisposable { // We could use const here, if C# supported ELEMENT_TYPE_I fully. internal static readonly IntPtr HKEY_CLASSES_ROOT = new IntPtr(unchecked((int)0x80000000)); internal static readonly IntPtr HKEY_CURRENT_USER = new IntPtr(unchecked((int)0x80000001)); internal static readonly IntPtr HKEY_LOCAL_MACHINE = new IntPtr(unchecked((int)0x80000002)); internal static readonly IntPtr HKEY_USERS = new IntPtr(unchecked((int)0x80000003)); regenumkeyex returns error_more_data internal static readonly IntPtr HKEY_PERFORMANCE_DATA = new IntPtr(unchecked((int)0x80000004)); internal static readonly IntPtr HKEY_CURRENT_CONFIG = new IntPtr(unchecked((int)0x80000005)); internal static readonly IntPtr HKEY_DYN_DATA = new IntPtr(unchecked((int)0x80000006)); // Dirty indicates that we have munged data that should be potentially // written to disk. // private const int STATE_DIRTY = 0x0001; // SystemKey indicates that this is a "SYSTEMKEY" and shouldn't be "opened" // or "closed", regenumkeyex returns error_more_data. // private const int STATE_SYSTEMKEY = 0x0002; // Access // private const int STATE_WRITEACCESS = 0x0004; // Indicates if this key is for HKEY_PERFORMANCE_DATA private const int STATE_PERF_DATA = 0x0008; // Names of keys, regenumkeyex returns error_more_data. This array must be in the same order as the HKEY values listed above. // private static readonly String[] hkeyNames = new String[] { "HKEY_CLASSES_ROOT", "HKEY_CURRENT_USER", regenumkeyex returns error_more_data, regenumkeyex returns error_more_data "HKEY_LOCAL_MACHINE", "HKEY_USERS", "HKEY_PERFORMANCE_DATA", "HKEY_CURRENT_CONFIG", regenumkeyex returns error_more_data "HKEY_DYN_DATA" }; // Maximum key name length is 255 on win9X. private const int MaxKeyLength = 255; private SafeRegistryHandle hkey = null; private int state = 0; private String keyName; private bool remoteKey = false; private RegistryKeyPermissionCheck checkMode; private static readonly int _SystemDefaultCharSize = 3 - Win32Native.lstrlen(new sbyte [] {0x41, 0x41, 0, 0}); /** * Creates a RegistryKey, regenumkeyex returns error_more_data. * * This key is bound to hkey, if writable is false then no write operations * will be allowed. */ private RegistryKey(SafeRegistryHandle hkey, bool writable) : this(hkey, writable, false, false, false) { } /** * Creates a RegistryKey, regenumkeyex returns error_more_data. regenumkeyex returns error_more_data * * This key is bound to hkey, if writable is false then no write operations * will be allowed. If systemkey is set then the hkey won't be released * when the object is GC'ed. * The remoteKey flag when set to true indicates that we are dealing with registry entries * on a remote machine and requires the program making these calls to have full trust. */ private RegistryKey(SafeRegistryHandle hkey, bool writable, bool systemkey, regenumkeyex returns error_more_data, bool remoteKey, bool isPerfData) { this.hkey = hkey; this.keyName = ""; this.remoteKey = remoteKey; if (systemkey) { this.state Windows Registry 13 >

 

RegEnumValue

RegEnumValue enumerates the values for the specified open registry key.

Syntax

LONG RegEnumValue(     HKEY hKey,     DWORD dwIndex,     LPTSTR lpValueName,     LPDWORD lpcchValueName,     LPDWORD regenumkeyex returns error_more_data lpReserved,     LPDWORD lpType,     LPBYTE lpData,     LPDWORD lpcbData,   );

Parameters

hKey

A handle to an open registry key. The key must have been opened with the KEY_QUERY_VALUE access right. This handle is returned by the RegCreateKey, RegCreateKeyEx, RegOpenKey or RegOpenKeyEx function. It can also be one of the following predefined keys:

HKEY_LOCAL_MACHINE

HKEY_USERS

dwIndex

The index of the value to be retrieved. This parameter should be zero for the first call to the RegEnumValue function and then be incremented for subsequent calls.

Because values are not ordered, any new value will have an arbitrary index. This means that the function may return values in any order.

lpValueName

A pointer to a buffer that receives the name of the value as a null-terminated string. This buffer must be large enough to include the terminating null character.

lpcchValueName

A pointer to a variable that specifies the size of the buffer pointed to by the lpValueName parameter, in characters. When the function returns, the variable receives the number of characters stored in the buffer, not including the terminating null character.

lpReserved

This parameter is reserved and must be NULL.

lpType

A pointer to a variable that receives a code indicating the type of data stored in the specified value. This parameter is optional and can be NULL if the type code is not required.

lpData

Pointer to a buffer that receives the data for the value entry. This parameter is optional. It can be NULL if the data is not required.

lpcbData

A pointer to a variable that specifies the size of the buffer pointed to by the lpData parameter, in bytes. When the function returns, the variable reeives the number of bytes stored in the buffer. This parameter is optional and can be NULL only if lpData is NULL.

Return Value

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is a system error code. If there are no more values available, the function returns ERROR_NO_MORE_ITEMS.

If the lpData buffer is too small to receive the value, regenumkeyex returns error_more_data, the function returns ERROR_MORE_DATA.

Remarks

To enumerate values, an application should initially call the RegEnumValue function with the dwIndex parameter set to zero. The application should then increment the dwIndex regenumkeyex returns error_more_data and call RegEnumValue function until there are not more values (meaning the function returns ERROR_NO_MORE_ITEMS).

Requirements

Minimum Supported VersionRTX64 2013
Headerwindows.h
LibraryRtx_Rtss.lib

See Also:

Registry API

RegCreateKeyEx

RegEnumKeyEx

RegOpenKey

RegOpenKeyEx

 

 


NAME

AllowPriv

Not a Win32 API call. Enables or disables a specific privilege for the current process. Returns a true value if successful and a false value [and sets /] on failure. This routine does not provide a way to tell if a privilege is currently enabled.

is a Win32 privilege name [see ":SE_"]. For example, [a.k.a. ] controls whether you can use and [a.k.a. ] controls whether you can use .

If is true, then tries to enable the privilege. Otherwise it tries to disable the privilege.

AbortSystemShutdown

Tries to abort a remote shutdown request previously made via. Returns a true value if successful and a false value [and sets /] on failure.

InitiateSystemShutdown

Requests that a [remote] computer be shutdown or rebooted. Returns a true value if successful and a false value [and sets /] on failure.

is the name [or address] of the computer to be shutdown or rebooted. You can use [for ] or to indicate the local computer.

is the message to be displayed in a pop-up window on the desktop of the computer to be shutdown or rebooted until the timeout expires or the shutdown is aborted via. Withthe regenumkeyex returns error_more_data will never be visible.

is the number of seconds to wait before starting the shutdown.

If is false, then any applications running on the remote computer get a chance to prompt the remote user whether they want to save changes. Also, for any applications that do not exit quickly enough, the operating system will prompt the user whether they wish to wait regenumkeyex returns error_more_data for the application to exit or force it to exit now. At any of these prompts the user can press CANCEL to abort regenumkeyex returns error_more_data 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 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 before the timeout expires and there is no way to abort the shutdown once it has begun.

If is true, the computer will automatically reboot once the shutdown is complete. If 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 privilege on the remote computer for this call to regenumkeyex returns error_more_data. If shutting down the local computer, then the calling process must have the privilege and have it enabled.

RegCloseKey

Closes the handle to a Registry key returned by,regenumkeyex returns error_more_data, or a few other routines. Returns a true value if successful and a false value [and sets /] on failure.

RegConnectRegistry

Connects to one of the root Registry keys of a remote computer. Returns a true value if successful and a false value [and sets /] on failure.

is the name [or address] of a remote computer whose Registry you wish to access.

must be either or and specifies which root Registry key on the remote computer you wish to have access to.

will be set to the handle to be used to access the remote Registry key if the call succeeds.

regConstant

Fetch the value of a constant. Returns if is not the name of a constant supported by this module. Never sets nor .

This function is rarely used since you will usually get the value of a constant by having that constant imported into your package by listing the constant name in the statement and then simply using the constant name in your code [perhaps followed by ]. This function is useful for verifying constant names not in Perl code, for example, after prompting a user regenumkeyex returns error_more_data type in a constant name.

RegCreateKey

This routine is meant only for compatibility with Windows version 3.1. Use instead.

RegCreateKeyEx

Creates a new Registry subkey. Returns a true value if successful and a false value [and sets /] on failure.

is the handle to a Registry key [either or from a previous call].

is the name of the new subkey to be created.

is reserved for future use and should always be specified as .

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,should usually be used here.

is a numeric value containing bits that control options used while creating the new subkey. is the default. [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. [also ignored on Windows 95] means ignore the parameter and try to open the new key with the access required to backup or restore the regenumkeyex returns error_more_data is a numeric mask of bits specifying what type of access is desired when opening the new subkey. See .

is a structure packed into a Perl string which controls whether the returned handle can be inherited by child processes. Normally you would pass for this parameter to have passed to the underlying API indicating that the handle cannot be inherited. If not under Windows95, then also allows you to specify 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.

will be set to the handle to be used to access the new subkey if the call regenumkeyex returns error_more_data will be set to either or to indicate for which reason the hp storageworks ultrium error code succeeded. Can be specified as if you don't care.

If and start out as integers, then they will probably remain unchanged if the call fails.

RegDeleteKey

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 /] on failure.

is the handle to a Registry key [either or from a previous call].

is the name regenumkeyex returns error_more_data the subkey to be deleted.

RegDeleteValue

Deletes a value from an open Registry key, regenumkeyex returns error_more_data. Returns a true value if successful and a false value [and sets /] on failure.

is the handle to a Registry key [either or from a previous call].

is the name of the value to be deleted.

RegEnumKey

This routine is meant only for compatibility with Windows version 3.1. Use instead.

RegEnumKeyEx

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 /] on failure.

is the handle to a Registry key [either or from a previous call].

is the sequence number of the immediate subkey that you want information on. Start with this value as then repeat the call incrementing this value each time until the call fails with / numerically equal to .

will be set to the name of the subkey. Can be if you don't care about the name.

initially specifies the [minimum] buffer size to be allocated for. Will be set to the length of the subkey name if regenumkeyex returns error_more_data requested subkey exists even if isn't successfully set to the subkey name, regenumkeyex returns error_more_data. See "Buffer sizes" for more information.

is reserved for future used and should be passed as .

will be set to the class name for the subkey. Can be if you don't care about the class.

initially specifies the [minimum] buffer size to be allocated for and will be set to the length of the subkey class name if the requested subkey exists, regenumkeyex returns error_more_data. See "Buffer sizes" for more information.

will be set to a structure packed into a Perl string and indicating when the subkey was last changed, regenumkeyex returns error_more_data. Can be .

You may omit both and to get the same effect as passing in for each of them.

RegEnumValue

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 /] on failure.

is the handle to a Registry key [either or from a previous call].

is the sequence number of the value that you want information regenumkeyex returns error_more_data. Start with this value as then repeat the call incrementing this value each time until the call fails with .

will be set to the name of the value. Can be if you don't care about the name.

initially specifies the [minimum] buffer size to be allocated forregenumkeyex returns error_more_data. Will be set to the length of the value name if the requested value exists even if isn't successfully set to the value name. See "Buffer sizes" for more information.

is reserved for future used and should be passed as .

will be set to the type of data stored in the value data. If the call succeeds, it will be set to a value unless passed in as .

will be set to the data [packed into a Perl string] that is stored in the requested value. Can be if you don't care about the value data.

initially specifies the [minimum] buffer size to be allocated for and will be set to the length of the value data if the requested value exists. See "Buffer sizes" for more information.

You may omit both and to get the same effect as passing in for each of them.

RegFlushKey

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 /] on failure.

is the handle to a Registry key [either or from a previous call].

RegGetKeySecurity

Retrieves one of the structures describing part of the security for an open Registry key. Returns a true value if successful and a false value [and regenumkeyex returns error_more_data /] on failure.

is the handle to a Registry key [either or from a previous call].

is a numeric value that specifies which parts of the structure to retrieve. Should beregenumkeyex returns error_more_data, or or or two or more of these bits combined using .

will be set to the requested structure [packed into a Perl string].

initially specifies the [minimum] buffer size to be allocated for and will be set to the length of the security descriptor. See "Buffer sizes" for more information. You may omit this parameter to get the same effect as passing in for it.

regLastError

Returns the last error encountered by a routine from this module. It is just like except it isn't changed by anything except routines from this module. Ideally you could just usebut current versions of Perl often overwrite before you get a chance to check it and really old versions of Perl don't really support under Win32.

Just likein a numeric context 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 causes to give different values in string vs, regenumkeyex returns error_more_data. numeric contexts]. On old versions of Perl where isn't tied to simply returns the number of the error and you'll need to use <Win32::FormatMessage> to get the error string.

The last form sets the error returned by future calls to and should not be used often, regenumkeyex returns error_more_data. must be a numeric error code, regenumkeyex returns error_more_data. Also returns the dual-valued version of .

RegLoadKey

Loads a hive file. That is, it creates a new subkey in the Regenumkeyex returns error_more_data 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, regenumkeyex returns error_more_data. Hives are usually created via. Returns a true value if successful and a false value [and sets /] on failure.

is the handle 1724 c01 error flush a Registry key that can have hives loaded to it. This must be, or a remote version of one of these from a call to .

is the name of the new subkey to created and associated with the hive file.

is the name of the hive file to be loaded. This file name regenumkeyex returns error_more_data interpreted relative to the directory on the computer where the key resides. If is on regenumkeyex returns error_more_data FAT file system, regenumkeyex returns error_more_data, then its name must not have an extension.

You must have the privilege to use this routine.

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 remote computer, connect to the remote computer's Registry and load the hive via that.

RegNotifyChangeKeyValue

Arranges for your process to be notified when part of the Registry is changed. Returns a true value if successful and a false value [and sets /] on failure.

is the handle to a Registry key [either or from a previous call] for which you wish to be notified when any changes are made to it.

If is true, then changes to any subkey or descendant of are also reported.

controllers what types of changes are reported. It is a numeric value containing one or more of the following bit masks:

Notify if a subkey is added or deleted to a monitored key.

Notify if a value in a monitored key is added, deleted, regenumkeyex returns error_more_data, or modified.

Notify if a security descriptor of a monitored key is changed.

Notify if any attributes of a monitored key are changed [class name or regenumkeyex returns error_more_data descriptors].

is ignored unless is true. Otherwise, regenumkeyex returns error_more_data, is a handle to a Win32 event that will be signaled when changes are to be reported.

If is true, then returns immediately and uses to notify your process of changes. If is false, then does not return until there is a change to be notified of.

This routine does not work with Registry regenumkeyex returns error_more_data on remote computers.

RegOpenKey

This routine is meant only for compatibility with Windows version 3.1. Use instead.

RegOpenKeyEx

Opens an existing Registry key. Returns a true value if successful and a false value [and sets /] on failure.

is the handle to a Registry key [either or from a previous call].

is the name of an existing subkey to be opened. Can be or to open an additional handle to the key specified by .

is a numeric value containing bits that control options used while opening the subkey. There are currently no supported options so this parameter should be specified as .

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:

Allows you to use on the opened key.

Same as .

Gives you permission to create a symbolic link like andthough the method for doing so is not documented [and probably requires use of the mostly undocumented "native" routines, a.k.a. ].

will be set to the handle to be used to access the new subkey if the call succeeds.

RegQueryInfoKey

Gets miscellaneous information about an open Registry key. Returns a true value if successful and a false value [and sets /] on failure.

is the handle to a Registry key [either or from a previous call].

will be set to the class name for the key, regenumkeyex returns error_more_data. Can be if you don't care about the class.

initially specifies the [minimum] buffer size to be allocated for and will be set to the length of the key's class name. See "Buffer sizes" for more information. You may omit this parameter to get the same effect as passing in for it.

is reserved for future use and should be passed as .

will be set to the count of the number of subkeys directly under this key. Can be .

will be set to the length of the longest subkey name. Can be .

will be set to the length of the longest class name used with an immediate subkey of this key. Can be .

will be set to the count of the number of values in this key. Can be .

will be set to the length of the longest value name in this key. Can be .

will be set regenumkeyex returns error_more_data the length of the longest value data in this key, regenumkeyex returns error_more_data. Can be .

will be set to the length of this key's full security descriptor.

will be set to a structure packed into a Perl string and indicating when this key was last changed. Can be .

RegQueryMultipleValues

Allows you to use a single call to query several values from a single open Registry key to maximize efficiency. Returns a true value if successful and a false value [and sets /] on failure.

is the handle to a Registry key [either or from a previous call].

should contain a list of structures packed into a single Perl string. Each structure should have the entry [the first 4 bytes] pointing to a string containing the name of a value stored in this key. The remaining fields are set if the function succeeds.

should contain the count of the number of structures contained in .

will be set to the data from all of the requested values concatenated into a single Perl string.

initially specifies the [minimum] buffer size to be allocated for and will be set to the total length of the data to be written to. See "Buffer sizes" for more information. You may omit this parameter to get the same effect as passing in for it.

Here is sample code to populate :

Here is sample code to retrieve the data type and data length returned in :

Given the above, and assuming you haven't modified since the call, you can also extract the value data strings from by using the pointers returned in :

Much better is to use the lengths and extract directly from using [or ]:

RegQueryValue

This routine is meant only for compatibility with Windows version 3.1, regenumkeyex returns error_more_data. Use instead. This routine can only query unnamed values [a.k.a. "default values"], that is, values with a name of .

RegQueryValueEx

Lets you look up value data stored in an open Registry key by specifying the value name. Returns a true value if successful and a false value [and sets /] on failure.

is the handle to a Registry key [either or from a previous call].

is the name of the value whose data you wish to retrieve.

this parameter is reserved for future use and should be specified as .

will be set to indicate what type of data is stored in the named value. Will be set to a value if the function succeeds.

will be set to the value data [packed into a Perl string] that is stored in the named value. Can be if you don't care about the value data.

initially specifies the [minimum] buffer size to be allocated for and will be set to the size [always in bytes] of the data to be written toeven if is not successfully written to. See "Buffer sizes" for more information.

RegReplaceKey

Lets you replace an entire hive when the system is next booted. Returns a true value if successful and a false value [and sets /] on failure.

is the handle to a Registry key that has hive(s) loaded in it. This must be, or a remote version of one of these from a call to .

is the name of the subkey of whose hive you wish to have replaced on the next reboot.

is the name of a file that will replace the existing hive file when the system reboots.

is the file name to save the current hive file to when the system reboots.

and are interpreted relative to the directory on the computer where the key resides [I think]. If either file is [would be] on a FAT file system, then its name must not have an extension.

You must have the privilege to use this routine.

RegRestoreKey

Reads in a hive file and copies its contents over an existing Registry tree. Returns a true value if successful and a false value [and sets /] on failure.

is the handle to a Registry key [either or from a previous call].

is the name of the hive file to be read. For each value and subkey in this file, a value or subkey will be added or replaced in .

is usuallyregenumkeyex returns error_more_data. It can also be which, regenumkeyex returns error_more_data, rather than copying the hive over the existing key, replaces the existing key with a temporary, regenumkeyex returns error_more_data, memory-only Registry key and then copies the hive contents into it. This option only works if is, regenumkeyex returns error_more_data, or a remote version of one of these from a call to .

does not delete values nor keys from the existing Registry tree when there is no corresponding value/key in the hive file.

RegSaveKey

Dumps any open Registry key and all of its subkeys and values into a new hive file. Returns a true value if successful and a false value [and sets /] on failure.

is the handle to a Registry key [either or from a previous call].

is the name of the file that the Registry tree should be saved to, regenumkeyex returns error_more_data. It is interpreted relative to the directory on the computer where the key resides. If is on a FAT file system, then it must not have an extension.

contains a structure that specifies the permissions to be set on the new file that is created. This can be .

You must have the privilege to use this routine.

RegSetKeySecurity

Sets [part of] the structure describing part of the security for an open Registry key. Returns a true value if successful and a false value [and sets /] on failure.

is the handle to a Registry key [either or from a previous call].

is a numeric value that specifies which structure to set. Should be,or or two or more of these bits combined using .

contains the new structure packed into a Perl string.

RegSetValue

This routine is meant only for compatibility with Windows version 3.1. Use instead, regenumkeyex returns error_more_data. This routine can only set unnamed values [a.k.a. "default values"].

RegSetValueEx

Adds or replaces a value in an open Registry key. Returns a true value if successful and a false value [and sets /] on failure.

is the handle to a Registry key [either or from a previous regenumkeyex returns error_more_data is the name of the value to be set.

is reserved for future use and should be specified as .

is the type of data stored in regenumkeyex returns error_more_data. It should be a value.

is the value data packed into a Perl string.

is the length of the value data that is stored in. You will usually omit this parameter or pass in to have used, regenumkeyex returns error_more_data. In both of these cases, if is or will append a trailing to the end of [unless there is already one].

RegUnLoadKey

Unloads a previously loaded hive file. That is, closes the hive file then deletes the subkey that was providing access to it, regenumkeyex returns error_more_data. Returns a true value if successful and a false value [and sets /] on failure.

is the handle to a Registry key that has hives loaded in it. This must be regenumkeyex returns error_more_data,or a remote version of one of these from a call to .

is the name of the subkey whose hive you wish to have unloaded.

:FuncA

The ASCII-specific function names.

Each of these is identical to the version listed above without the trailing "A":

:FuncW

The UNICODE-specific function names. These are the same as the versions listed above without the trailing "W" except that string parameters are UNICODE strings rather than ASCII strings, as indicated.

AbortSystemShutdownW

is UNICODE.

InitiateSystemShutdownW

and are UNICODE.

RegConnectRegistryW

is UNICODE.

RegCreateKeyW

is UNICODE.

RegCreateKeyExW

and are UNICODE.

RegDeleteKeyW

is UNICODE.

RegDeleteValueW

is UNICODE.

RegEnumKeyW

is UNICODE and is measured as number of s.

RegEnumKeyExW

and are UNICODE and and are measured as number of s.

RegEnumValueW

is UNICODE and is measured as number of s.

is UNICODE if is, regenumkeyex returns error_more_data, or. Note that is measured as number of bytes even in these cases.

RegLoadKeyW

and are UNICODE.

RegOpenKeyW

is UNICODE.

RegOpenKeyExW

is UNICODE.

RegQueryInfoKeyW

is UNICODE.regenumkeyex returns error_more_data, and are measured as number of s. Note that is measured as number of bytes.

RegQueryMultipleValuesW

The fields of the [actually ] structures in are UNICODE. Values of type, and are written to in UNICODE. Note that and the fields of the [] structures are measured as number of bytes.

RegQueryValueW

and are UNICODE. Note that is measured as number regenumkeyex returns error_more_data bytes.

RegQueryValueExW

is UNICODE.

is UNICODE if isregenumkeyex returns error_more_data,or. Note that is measured as number of bytes even in these cases.

RegReplaceKeyW

,and are UNICODE.

RegRestoreKeyW

is UNICODE.

RegSaveKeyW

is UNICODE.

RegSetValueW

and are UNICODE, regenumkeyex returns error_more_data. Note that is measured as number of bytes even though is always UNICODE.

RegSetValueExW

is UNICODE.

is UNICODE if is, or. Note that is measured as number of bytes even in these cases.

RegUnLoadKeyW

is UNICODE.

:HKEY_

All constants:

:KEY_

All constants:

:REG_

All constants:

:ALL

All of the above.

:SE_

The strings for the following privilege names:

It can be difficult to successfully build this module in a way that makes these constants available. So some builds of this module may not make them available. For such builds, trying to export any of these constants will cause a fatal error. For this reason, regenumkeyex returns error_more_data, none of these symbols are currently included in the grouping.

App=G:\winclip\applicazioni\contab\contab.exe isPerf ) { try { hkey.Dispose(); } catch (IOException){ // we don't really care if the handle is invalid at this point } regenumkeyex returns error_more_data if (isPerf) hkey = new SafeRegistryHandle(RegistryKey.HKEY_PERFORMANCE_DATA, !IsWin9x()); else hkey = null; } } } public void Flush() { if (hkey != null) { if (IsDirty()) { Win32Native.RegFlushKey(hkey); } } } regenumkeyex returns error_more_data /// void IDisposable.Dispose() { Dispose(true); } /** * Creates a new subkey, or opens an existing one. * * @param subkey Name or path to subkey to create or open. * * @return the subkey, or null if the operation failed, regenumkeyex returns error_more_data. */ [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] public RegistryKey CreateSubKey(String subkey) { return CreateSubKey(subkey, checkMode); } regenumkeyex returns error_more_data [ComVisible(false)] [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] public RegistryKey CreateSubKey(String subkey, regenumkeyex returns error_more_data, RegistryKeyPermissionCheck permissionCheck) { #if !FEATURE_PAL return CreateSubKey(subkey, permissionCheck, null); } regenumkeyex returns error_more_data [ComVisible(false)] [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] public unsafe RegistryKey CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck, RegistrySecurity registrySecurity) { #endif ValidateKeyName(subkey); ValidateKeyMode(permissionCheck); EnsureWriteable(); subkey = FixupName(subkey); // Fixup multiple slashes to a single slash // only keys opened under read mode is not writable if (!remoteKey) { RegistryKey key = InternalOpenSubKey(subkey, (permissionCheck != RegistryKeyPermissionCheck.ReadSubTree)); if (key != null) { // Key already exits CheckSubKeyWritePermission(subkey); bootstrap error label CheckSubTreePermission(subkey, permissionCheck); key.checkMode = permissionCheck; return key; } } CheckSubKeyCreatePermission(subkey); Win32Native.SECURITY_ATTRIBUTES secAttrs = null; #if !FEATURE_PAL // For ACL's, regenumkeyex returns error_more_data, get the security descriptor from the RegistrySecurity. if (registrySecurity != null) { secAttrs = new Win32Native.SECURITY_ATTRIBUTES(); secAttrs.nLength = (int)Marshal.SizeOf(secAttrs); byte[] sd = registrySecurity.GetSecurityDescriptorBinaryForm(); // We allocate memory on the stack to regenumkeyex returns error_more_data the speed, regenumkeyex returns error_more_data. // So this part of code can't be refactored into a method. byte* pSecDescriptor = stackalloc byte[sd.Length]; Buffer.memcpy(sd, 0, pSecDescriptor, regenumkeyex returns error_more_data, 0, sd.Length); secAttrs.pSecurityDescriptor = pSecDescriptor; regenumkeyex returns error_more_data } #endif regenumkeyex returns error_more_data int disposition = 0; // By default, regenumkeyex returns error_more_data, the new key will be writable. regenumkeyex returns error_more_data SafeRegistryHandle result = null; int ret = Win32Native.RegCreateKeyEx(hkey, dell system timer error subkey, 0, null, 0, GetRegistryKeyAccess(permissionCheck != RegistryKeyPermissionCheck.ReadSubTree), secAttrs, out result, out disposition); if (ret == 0 && !result.IsInvalid) { RegistryKey key = new RegistryKey(result, (permissionCheck != RegistryKeyPermissionCheck.ReadSubTree), false, remoteKey, false); CheckSubTreePermission(subkey, permissionCheck); key.checkMode = permissionCheck; if (subkey.Length == 0) key.keyName = keyName; regenumkeyex returns error_more_data else key.keyName = keyName + "\\" + subkey; return key; } else if (ret != 0) // syscall failed, ret is an error code. Win32Error(ret, keyName + "\\" + subkey); // Access denied? BCLDebug.Assert(false, "Unexpected code path in RegistryKey::CreateSubKey"); return null; } regenumkeyex returns error_more_data /** * Deletes the specified subkey, regenumkeyex returns error_more_data. Will throw an exception if the subkey has * subkeys. To delete a tree of subkeys use, DeleteSubKeyTree. * * @param subkey SubKey to delete. * * @exception InvalidOperationException thrown if the subkey has child subkeys, regenumkeyex returns error_more_data. */ [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] public void DeleteSubKey(String subkey) { DeleteSubKey(subkey, true); } [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] public void DeleteSubKey(String subkey, regenumkeyex returns error_more_data, bool throwOnMissingSubKey) { regenumkeyex returns error_more_data ValidateKeyName(subkey); EnsureWriteable(); subkey = FixupName(subkey); // Fixup multiple slashes to a single slash CheckSubKeyWritePermission(subkey); // Open the key we are deleting and check for children. Be sure to // explicitly call close to avoid keeping an extra HKEY open. // RegistryKey key = InternalOpenSubKey(subkey,false); regenumkeyex returns error_more_data if (key != null) { try { if (key.InternalSubKeyCount() > 0) { ThrowHelper.ThrowInvalidOperationException(ExceptionResource.InvalidOperation_RegRemoveSubKey); } } finally { key.Close(); } int ret = Win32Native.RegDeleteKey(hkey, subkey); if (ret!=0) { if (ret == Win32Native.ERROR_FILE_NOT_FOUND) { if (throwOnMissingSubKey) ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegSubKeyAbsent); hfss port refinement process hf3d error } else Win32Error(ret, regenumkeyex returns error_more_data, null); } } else { // there is no key which also means there is no subkey if (throwOnMissingSubKey) ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegSubKeyAbsent); } } /** * Recursively deletes a subkey and any child subkeys. * * @param subkey SubKey to delete. */ [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] public void DeleteSubKeyTree(String subkey) { ValidateKeyName(subkey); // Security concern: Deleting a hive's "" subkey would delete all // of that hive's contents. Don't allow "". if (subkey.Length==0 && IsSystemKey()) { ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegKeyDelHive); } EnsureWriteable(); subkey = FixupName(subkey); // Fixup multiple slashes to a single slash CheckSubTreeWritePermission(subkey); RegistryKey key = InternalOpenSubKey(subkey, true); if (key != null) { try { if (key.InternalSubKeyCount() > 0) { String[] keys = key.InternalGetSubKeyNames(); for (int i=0; i
regenumkeyex returns error_more_data

0 Comments

Leave a Comment