Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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.

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.

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.

ERROR_SUCCESS

0

The operation was successful.

ERROR_INVALID_FUNCTION

1

Incorrect function. This value is returned if dwCommand takes any command other than the commands described in the previous section.

ERROR_INVALID_HANDLE

6

The handle is not valid. This value is returned if the hRegBatch parameter is NULL.

ERROR_OUTOFMEMORY

14 (0xE)

Not enough storage is available to complete this operation.

ERROR_GEN_FAILURE

31 (0x1F)

A device attached to the system is not functioning.

ERROR_INVALID_PARAMETER

87 (0x57)

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, Windows Server 2008 Enterprise

Header

ClusAPI.h

Library

ClusAPI.lib

DLL

ClusAPI.dll

See also

Cluster Registry Access Functions
Registry Value Types
CLUSTER_REG_COMMAND
ClusterRegCreateBatch
ClusterRegCloseBatch

 

 

Show: