INtime SDK Help
RegEnumValue (iwin32)
INtime SDK v6 > About INtime > Alternate APIs > iwin32 API > iwin32 API > RegEnumValue (iwin32)

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

LONG RegEnumValue(
    HKEY hKey,
    DWORD dwIndex,
    LPTSTR lpValueName,
    LPDWORD lpcValueName,
    LPDWORD lpReserved,
    LPDWORD lpType,
    LPBYTE lpData,
    LPDWORD lpcbData
);

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 RegEnumValue 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.
lpcValueName
Pointer to a variable that specifies number of characters in 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 lpcValueName 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.

If the type code is not required, the lpType parameter can be NULL.

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 RegEnumValue with the dwIndex parameter set to zero. The application should then increment dwIndex and call RegEnumValue until no more values exist (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 RegQueryInfoKey.

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

The key identified by the hKey parameter must be opened with KEY_QUERY_VALUE access. To open the key, use RegCreateKeyEx or RegOpenKeyEx.

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

Return Values

ERROR_SUCCESS
Success.
A nonzero status code defined in RTWIN32.H.
Failure. For extended error information, see GetLastError

Requirements

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

Note

This function operates in the real-time portion of your application.

See Also

RegCreateKeyEx, RegEnumKeyEx, RegOpenKeyEx, RegQueryInfoKey, iwin32 API, iwin32 Overview