7.6 WFMEnumValue

HRESULT WFMEnumValue ( hKey, iValue, lpszValue, lpcchValue, lpszData, lpcchData )

Enumerates the values of the specified open key. Retrieves the name and data for one value each time it is called.

Parameters HKEY hKey

Handle to a currently open key, or the predefined handle value:
WFS_CFG_HKEY_XFS_ROOT
The value enumerated by this function is a value of the key identified by this parameter.

DWORD iValue

The index of the value to retrieve. This parameter should be zero for the first call to this function, then incremented for each subsequent call, in order to enumerate all the values of the specified open key.

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

LPSTR lpszValue

Pointer to a buffer that receives the name of the value, including the terminating null character.

LPDWORD lpcchValue

Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the lpszValue parameter. This size should include the terminating null character. When the function returns, this variable contains the the number of characters actually stored in the buffer, not including the terminating null character.

LPSTR lpszData

Pointer to a buffer that receives the data for the value entry, including the terminating null character. This parameter can be NULL, if the data is not required.

LPDWORD lpcchData

Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the lpszData parameter, including the terminating null character. When the function returns, this variable contains the the number of characters actually stored in the buffer, not including the terminating null character. Ignored if lpszData is NULL.

Comments While a program is using this function iteratively, it should not call any other configuration functions that would change the key being queried.

Error Codes If the function return is not WFS_SUCCESS, it is one of the following error conditions.

WFS_ERR_CFG_INVALID_HKEY
The specified hKey parameter does not correspond to a currently open key.
WFS_ERR_CFG_NO_MORE_ITEMS
There are no more values to be returned (the iValue parameter is greater than the index of the last value).
WFS_ERR_CFG_NAME_TOO_LONG
The length of the name to be returned exceeds the length of the buffer.
WFS_ERR_CFG_VALUE_TOO_LONG
The length of the value to be returned exceeds the length of the buffer.
WFS_ERR_INVALID_POINTER
A pointer parameter does not point to accessible memory.