_RegSetValue


include vmm.h

LONG _RegSetValue(HKEY hkey, LPTSTR lpszSubKey, DWORD fdwType, 
    LPTSTR lpszData, DWORD cbData)

Associates a value with the specified key; this value is of type REG_SZ and does not have a value name. See the documentation for the Win32 function of the same name for additional information.

ERROR_FILE_NOT_FOUND

ERROR_KEY_DELETED

ERROR_BADKEY

ERROR_REGISTRY_IO_FAILED

ERROR_REGISTRY_CORRUPT

ERROR_BADDB


hkey

Handle of an open key or one of the predefined keys:

HKEY_CLASSES_ROOT

HKEY_CURRENT_USER

HKEY_LOCAL_MACHINE

HKEY_USERS

HKEY_CURRENT_CONFIG


lpszSubKey

Address of null-terminated string that contains the name of the subkey of the hkey parameter for which the value is associated. If this is an empty string, the value will be associated with the key identified by the hkey parameter.

fdwType

Type of information to be stored. Must be REG_SZ.

lpszData

Address of null-terminated string containing value to set for the given key.

cbData

Length in bytes of string at which lpszData points, not including the terminating null character.

If the key specified by lpszSubKey does not exist, this service will create it.

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

Of the predefined key values, only HKEY_LOCAL_MACHINE is available to VxDs during initialization time. The entire registry space can only be accessed after VxD initialization is complete.