_RegSetValueEx

include vmm.h

LONG _RegSetValueEx(HKEY hkey, LPTSTR lpszValueName, 
    DWORD dwReserved, DWORD fdwType, LPBYTE lpbDta, DWORD cbData)
 

Stores data in the value field of an open registry key; the service can also set additional value and type information for the given key. See the documentation for the Win32 function of the same name for additional information.

ERROR_KEY_DELETED
ERROR_OUTOFMEMORY
ERROR_REGISTRY_IO_FAILED
ERROR_REGISTRY_CORRUPT
ERROR_BADDB

hkey
Handle of the open key or one of these predefined values:
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS

lpszValueName
Points to a null-terminated string containing the name of the value to set. If a value with this name is not already present in the key, the function adds it to the key. If this parameter is NULL or points to an empty string, the fdwType must be REG_SZ and this service will set the same value as RegSetValue.
lpdwReserved
Reserved; must be NULL.
fdwType
The type code for the value entry. It can be one of these values:
REG_BINARY Binary data in any form.
REG_SZ A null-terminated UNICODE or ANSI string.

lpbData
Address of buffer that receives the data for the value entry.
lpcbData
Address of variable that specifies size, in bytes, of the buffer addressed by lpbData. If the type is REG_SZ this must include 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.