ResUtilSetBinaryValue function

Sets a binary value in the cluster database.

Syntax


DWORD WINAPI ResUtilSetBinaryValue(
  _In_              HKEY    hkeyClusterKey,
  _In_              LPCWSTR pszValueName,
  _In_        const LPBYTE  pbNewValue,
  _In_              DWORD   cbNewValueSize,
  _Inout_opt_       LPBYTE  *ppbOutValue,
  _Inout_           LPDWORD pcbOutValueSize
);

typedef DWORD (WINAPI *PRESUTIL_SET_BINARY_VALUE)(
    _In_              HKEY    hkeyClusterKey,
    _In_              LPCWSTR pszValueName,
    _In_        const LPBYTE  pbNewValue,
    _In_              DWORD   cbNewValueSize,
    _Inout_opt_       LPBYTE  *ppbOutValue,
    _Inout_           LPDWORD pcbOutValueSize
);

Parameters

hkeyClusterKey [in]

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

pszValueName [in]

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

pbNewValue [in]

Pointer to the new binary value.

cbNewValueSize [in]

Size of the new binary value.

ppbOutValue [in, out, optional]

Address of a pointer to the new binary value.

pcbOutValueSize [in, out]

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.

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

Minimum supported client

None supported

Minimum supported server

Windows Server 2008 Enterprise, Windows Server 2008 Datacenter

Header

ResApi.h

Library

ResUtils.lib

DLL

ResUtils.dll

See also

ClusterRegSetValue
ResUtilSetExpandSzValue
ResUtilSetDwordValue
ResUtilSetMultiSzValue
ResUtilSetSzValue

 

 

Show: