INtime SDK Help
RtRegEnumValue
INtime SDK v6 > About INtime > INtime Kernel > Registry access > RtRegEnumValue

Enumerates the values for the specified open registry key. The call copies one indexed value name and data block for the key each time it is called.

LONG RtRegEnumValue(
    HKEY hKey,              // handle to key to query
    DWORD dwIndex,          // index of value to query
    LPTSTR lpValueName,     // address of buffer for value string
    LPDWORD lpcbValueName,  // address for size of value buffer
    LPDWORD lpReserved,     // reserved
    LPDWORD lpType,         // address of buffer for type code
    LPBYTE lpData,          // address of buffer for value data
    LPDWORD lpcbData        // address for size of data buffer
)

Parameters

hKey
Handle to a currently open key or one of the following predefined reserved handle values:

HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
HKEY_PERFORMANCE_DATA

The enumerated values are associated with the key identified by hKey.
dwIndex
Specifies the index of the value to retrieve. This parameter should be zero for the first call to RtRegEnumValue and then be incremented for subsequent calls.
Because values are not ordered, any new value has an arbitrary index. This means that the call may return values in any order.
lpValueName
Pointer to a buffer that receives the name of the value, including the terminating null character.
lpcbValueName
Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the lpValueName parameter. This size should include the terminating null character. When the call returns, the variable pointed to by lpcbValueName contains the number of characters stored in the buffer. The count returned does not include the terminating null character.
lpReserved
Reserved; must be NULL.
lpType
Pointer to a variable that receives one of these type codes for the value entry:
REG_BINARY Binary data in any form.
REG_DWORD A 32-bit number.
REG_DWORD_LITTLE_ENDIAN A 32-bit number in little-endian format. This is equivalent to REG_DWORD.
REG_DWORD_BIG_ENDIAN A 32-bit number in big-endian format.
REG_EXPAND_SZ A null-terminated string that contains unexpanded references to environment variables (for example, "%PATH%"). It is either a Unicode or ANSI string depending on whether you use the Unicode or ANSI calls.
REG_LINK A Unicode symbolic link.
REG_MULTI_SZ An array of null-terminated strings, terminated by two null characters.
REG_NONE No defined value type.
REG_RESOURCE_LIST A device-driver resource list.
REG_SZ A null-terminated string. It is either a Unicode or ANSI string, depending on whether you use the Unicode or ANSI calls.

The lpType parameter 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 can be NULL if the data is not required.
lpcbData
Pointer to a variable that specifies the size, in bytes, of the buffer pointed to by the lpData parameter. When the call returns, the variable pointed to by the lpcbData parameter contains the number of bytes stored in the buffer. This parameter can be NULL, only if lpData is NULL.

Remarks

To enumerate values, an application should initially call RtRegEnumValue with the dwIndex parameter set to zero. The application should then increment dwIndex and call RtRegEnumValue until there are no more values (until the call returns ERROR_NO_MORE_ITEMS).

The application can also set dwIndex to the index of the last value on the first call to the call and decrement the index until the value with index 0 is enumerated. To retrieve the index of the last value, use RtRegQueryInfoKey.

While using RtRegEnumValue, an application should not call any registration calls that might change the key being queried.

The key identified by the hKey parameter must have been opened with KEY_QUERY_VALUE access. To open the key, use RtRegCreateKeyEx or RtRegOpenKeyEx.

To determine the maximum size of the name and data buffers, use RtRegQueryInfoKey.

Return Values

ERROR_SUCCESS
Success.
A nonzero status code defined in RTWIN32.H.
Failure.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/rtbase.h rt.h rt.lib

See Also

Registry system calls, RtRegQueryInfoKey, RtRegEnumValue, RtRegCreateKeyEx, RtRegOpenKeyEx, RtRegEnumKeyEx