ClusterRegBatchAddCommand Function
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_opt LPCWSTR wzName,
__in DWORD dwOptions,
__in_opt VOID CONST *lpData,
__in DWORD cbData
);
Parameters
hRegBatch [in]
The handle of the batch to which a command will be added.dwCommand [in]
A command supported by this API that is taken from the CLUSTER_REG_COMMAND enumeration. The possible commands are as follows.Command Meaning CLUSREG_SET_VALUE
1Sets 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
2Creates a specified cluster registry key if it doesn't exist, or opens an existing one.
CLUSREG_DELETE_KEY
3Deletes 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
4Deletes a value relative to the last executed CLUSREG_CREATE_KEY command or (if not provided) relative to a key passed into the ClusterRegCreateBatch function.
wzName [in, optional]
The name of the value or key relative to the command issued by the dwCommand parameter.dwOptions [in]
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.lpData [in, optional]
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.cbData [in]
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 |
---|---|
ERROR_SUCCESS |
The operation was successful. |
ERROR_INVALID_FUNCTION |
Incorrect function. This value is returned if dwCommand takes any command other than the commands described in the previous section. |
ERROR_INVALID_HANDLE |
The handle is not valid. This value is returned if the hRegBatch parameter is NULL. |
ERROR_OUTOFMEMORY |
Not enough storage is available to complete this operation. |
ERROR_GEN_FAILURE |
A device attached to the system is not functioning. |
ERROR_INVALID_PARAMETER |
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
Minimum supported client | None supported |
Minimum supported server | Windows Server 2008 Datacenter Edition, Windows Server 2008 Enterprise Edition |
Header | ClusApi.h |
Library | ClusApi.lib |
DLL | ClusApi.dll |
See Also
Cluster Registry Access Functions
Registry Value Types
CLUSTER_REG_COMMAND
ClusterRegCreateBatch
ClusterRegCloseBatch
Send comments about this topic to Microsoft
Build date: 2/9/2009