ResUtilSetExpandSzValue function (resapi.h)
Sets an expandable string value in the cluster database. The PRESUTIL_SET_EXPAND_SZ_VALUE type defines a pointer to this function.
Syntax
DWORD ResUtilSetExpandSzValue(
[in] HKEY hkeyClusterKey,
[in] LPCWSTR pszValueName,
[in] LPCWSTR pszNewValue,
[in, out, optional] LPWSTR *ppszOutString
);
Parameters
[in] hkeyClusterKey
Key identifying the location of the expandable 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 expandable 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 ResUtilSetExpandSzValue utility function allocates memory for the new value and calls the Cluster API function ClusterRegSetValue.
An expandable string value contains data that represents a null-terminated Unicode string containing unexpanded references to environment variables such as "%SystemRoot%".
Be sure to call LocalFree on *ppszOutValue to avoid memory leaks.
Do not call ResUtilSetExpandSzValue from the following resource DLL entry point functions:
ResUtilSetExpandSzValue 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 |