ClusterRegSetValue function (clusapi.h)

Sets a value for a cluster database key.

Syntax

DWORD ClusterRegSetValue(
  [in] HKEY       hKey,
  [in] LPCWSTR    lpszValueName,
  [in] DWORD      dwType,
  [in] const BYTE *lpData,
  [in] DWORD      cbData
);

Parameters

[in] hKey

Handle to a cluster database key.

[in] lpszValueName

Pointer to a null-terminated Unicode string containing the name of the value to set. If a value with this name is not already present in the resource, ClusterRegSetValue adds it to the resource.

[in] dwType

Type of information to be stored as the value's data. This parameter can be one of the following values. For more information see Registry Value Types.

REG_BINARY (3)

Binary data in any form.

REG_DWORD (4)

A 32-bit number.

REG_DWORD_BIG_ENDIAN (5)

A 32-bit number stored in big-endian format.

REG_EXPAND_SZ (2)

A null-terminated Unicode string that contains unexpanded references to environment variables (for example, "%PATH%").

REG_MULTI_SZ (6)

A sequence of null-terminated strings, terminated by an empty string (\0).

The following is an example:

String1\0String2\0String3\0LastString\0\0

The first \0 terminates the first string, the second to the last \0 terminates the last string, and the final \0 terminates the sequence. Note that the final terminator must be factored into the length of the string.

REG_NONE (0)

No defined value type.

REG_QWORD (11)

A 64-bit number.

REG_SZ (1)

A null-terminated Unicode string.

[in] lpData

Pointer to the data to be stored with the name pointed to by lpszValueName.

[in] cbData

Count of bytes in the data pointed to by the lpbData parameter. If the data is of type REG_SZ, REG_EXPAND_SZ or REG_MULTI_SZ, cbData must include the size of the null-terminating character.

Return value

If the operation succeeds, the function returns ERROR_SUCCESS.

If the operation fails, the function returns a system error code.

Remarks

Do not call ClusterRegSetValue from the following resource DLL entry point functions:

ClusterRegSetValue can be safely called from any other resource DLL entry point function or from a worker thread. For more information, see Function Calls to Avoid in Resource DLLs.

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows Server 2008 Enterprise, Windows Server 2008 Datacenter
Target Platform Windows
Header clusapi.h
Library ClusAPI.lib
DLL ClusAPI.dll

See also

ClusterRegOpenKey

GetLastError