ResUtilSetBinaryValue function (resapi.h)

Sets a binary value in the cluster database.

Syntax

DWORD ResUtilSetBinaryValue(
  [in]                HKEY         hkeyClusterKey,
  [in]                LPCWSTR      pszValueName,
  [in]                const LPBYTE pbNewValue,
  [in]                DWORD        cbNewValueSize,
  [in, out, optional] LPBYTE       *ppbOutValue,
  [in, out]           LPDWORD      pcbOutValueSize
);

Parameters

[in] hkeyClusterKey

Key identifying the location of the binary value in the cluster database.

[in] pszValueName

A null-terminated Unicode string containing the name of the value to update.

[in] pbNewValue

Pointer to the new binary value.

[in] cbNewValueSize

Size of the new binary value.

[in, out, optional] ppbOutValue

Address of a pointer to the new binary value.

[in, out] pcbOutValueSize

Pointer to a DWORD in which the size in bytes of the value pointed to by ppbOutValue is returned.

Return value

If the operation succeeds, the function returns ERROR_SUCCESS.

If the operation fails, the function returns a system error code. The following is a possible error code.

Return code Description
ERROR_NOT_ENOUGH_MEMORY
An error occurred during memory allocation.

Remarks

The ResUtilSetBinaryValue utility function allocates memory for the ppbOutValue pointer using the function LocalAlloc, calls the Cluster API function ClusterRegSetValue, and then copies the new value to this buffer. If the pointer is not NULL, ResUtilSetBinaryValue also deallocates it. As callers of this function, you are responsible for deallocating the buffer using the function LocalFree.

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

ResUtilSetBinaryValue 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 resapi.h
Library ResUtils.lib
DLL ResUtils.dll

See also

ClusterRegSetValue

ResUtilSetDwordValue

ResUtilSetExpandSzValue

ResUtilSetMultiSzValue

ResUtilSetSzValue