ClusterRegBatchAddCommand function (clusapi.h)
Adds a command to a batch that will be executed on a cluster registry key. Additional calls to the function will yield additional commands added to the batch. The batch was created by the ClusterRegCreateBatch function and will be either executed or ignored by the ClusterRegCloseBatch function.
Syntax
LONG ClusterRegBatchAddCommand(
[in] HREGBATCH hRegBatch,
[in] CLUSTER_REG_COMMAND dwCommand,
[in, optional] LPCWSTR wzName,
[in] DWORD dwOptions,
[in, optional] VOID const *lpData,
[in] DWORD cbData
);
Parameters
[in] hRegBatch
The handle of the batch to which a command will be added.
[in] dwCommand
A command supported by this API that is taken from the CLUSTER_REG_COMMAND enumeration. The possible commands are as follows.
CLUSREG_SET_VALUE (1)
Sets a value relative to the last executed CLUSREG_CREATE_KEY command or (if not provided) relative to a key passed into the ClusterRegCreateBatch function.
CLUSREG_CREATE_KEY (2)
Creates a specified cluster registry key if it does not exist, or opens an existing one.
CLUSREG_DELETE_KEY (3)
Deletes a key with all values and nested subkeys. No commands that operate on values can follow CLUSREG_DELETE_KEY until CLUSREG_CREATE_KEY is added.
CLUSREG_DELETE_VALUE (4)
Deletes a value relative to the last executed CLUSREG_CREATE_KEY command or (if not provided) relative to a key passed into the ClusterRegCreateBatch function.
[in, optional] wzName
The name of the value or key relative to the command issued by the dwCommand parameter.
[in] dwOptions
If dwCommand takes the CLUSREG_SET_VALUE command, then this parameter takes one of the standard registry value types. If not, then dwCommand is set to 0.
[in, optional] lpData
A pointer to the data relative to the command issued by dwCommand. The value of this parameter is NULL for all but the CLUSREG_SET_VALUE command.
[in] cbData
The count, in bytes, of the data relative to the command issued by dwCommand. The value of this parameter is 0 for all but the CLUSREG_SET_VALUE command.
Return value
The function returns one of the following system error codes.
Return code/value | Description |
---|---|
|
The operation was successful. |
|
Incorrect function. This value is returned if dwCommand takes any command other than the commands described in the previous section. |
|
The handle is not valid. This value is returned if the hRegBatch parameter is NULL. |
|
Not enough storage is available to complete this operation. |
|
A device attached to the system is not functioning. |
|
The parameter is incorrect. This value will be returned if the cluster registry key that the batch is attempting to execute commands on is not the current key. |
Remarks
The PCLUSTER_REG_BATCH_ADD_COMMAND type defines a pointer to this function.
Requirements
Requirement | Value |
---|---|
Minimum supported client | None supported |
Minimum supported server | Windows Server 2008 Datacenter, Windows Server 2008 Enterprise |
Target Platform | Windows |
Header | clusapi.h |
Library | ClusAPI.lib |
DLL | ClusAPI.dll |