ResUtilSetSzValue function (resapi.h)
Sets a string value in the cluster database. The PRESUTIL_SET_SZ_VALUE type defines a pointer to this function.
Syntax
DWORD ResUtilSetSzValue(
[in] HKEY hkeyClusterKey,
[in] LPCWSTR pszValueName,
[in] LPCWSTR pszNewValue,
[in, out, optional] LPWSTR *ppszOutString
);
Parameters
[in] hkeyClusterKey
Key identifying the location of the string value in the cluster database.
[in] pszValueName
Null-terminated Unicode string containing the name of the value to update.
[in] pszNewValue
Pointer to the new string value.
[in, out, optional] ppszOutString
Pointer to a string pointer that receives a copy of the updated value. If used, callers must call LocalFree on *ppszOutValue.
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 |
---|---|
|
An error occurred while attempting to allocate memory. |
Remarks
The ResUtilSetSzValue utility function allocates memory for the new value and calls the Cluster API function ClusterRegSetValue. If necessary, a previous value is deallocated. The new value is copied to the content of ppszOutValue.
Be sure to call LocalFree on *ppszOutValue to avoid memory leaks.
Do not call ResUtilSetSzValue from the following resource DLL entry point functions:
ResUtilSetSzValue 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 |