_RegSetValueEx


DWORD _RegSetValueEx(HKEY hKey, LPSTR lpszValueName, DWORD dwReserved,
      DWORD fdwType, LPBYTE lpbData, DWORD cbData)

Sets the value for the given registry key and the given value name.

hKey

Handle of a previously opened key or one of the predefined root keys given in Predefined Keys.

lpszValueName

Address of a null-terminated string specifying the value name for which to set the value. Can be NULL or point to a NULL-string.

dwReserved

Reserved; set to NULL.

fdwType

Value data type to set. Must be one of REG_SZ or REG_BINARY. Must be REG_SZ if lpszValueName is NULL or points to a NULL-string. See Registry Value Types.

lpbData

Address of a buffer that contains the value data to set.

cbData

Size in bytes of the value data buffer (lpbData). Can be zero for REG_SZ, in which case, the value length is automatically calculated.