7.9 WFMSetValue

HRESULT WFMSetValue ( hKey, lpszValueName, lpszData, cchData )

Stores data in the specified value of the specified key. If the value does not exist, it is created.

Parameters HKEY hKey

Handle to a currently open key, or the predefined handle value:
WFS_CFG_HKEY_XFS_ROOT
The value set or created is within the key identified by this parameter.

LPSTR lpszValueName

Pointer to a null-terminated string containing the name of the value being set. If a value with this name does not already exist in the specified key, it is added to the key.

LPSTR lpszData

Pointer to a buffer containing the data (a null-terminated character string) to be stored with the specified value name.

DWORD cchData

The size, in characters, of the string pointed to by the lpszData parameter, including the terminating null character.

Comments Value lengths are limited by available memory. Long values (more than 2048 bytes) should be stored as files with the filenames stored in the configuration information.

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_INVALID_POINTER
A pointer parameter does not point to accessible memory.