ClusterResourceControl function (clusapi.h)
Initiates an operation affecting a resource. The operation performed depends on the control code passed to the dwControlCode parameter.
Syntax
DWORD ClusterResourceControl(
[in] HRESOURCE hResource,
[in, optional] HNODE hHostNode,
[in] DWORD dwControlCode,
[in, optional] LPVOID lpInBuffer,
[in] DWORD cbInBufferSize,
[out, optional] LPVOID lpOutBuffer,
[in] DWORD cbOutBufferSize,
[out, optional] LPDWORD lpBytesReturned
);
Parameters
[in] hResource
Handle to the resource to be affected.
[in, optional] hHostNode
Optional handle to the node to perform the operation. If NULL, the node that owns the resource identified by hResource performs the operation.
[in] dwControlCode
A resource control code, enumerated by the
CLUSCTL_RESOURCE_CODES enumeration, specifying
the operation to be performed. For the syntax associated with a control code, refer to
Control Code Architecture and the following
topics:
- CLUSCTL_RESOURCE_UNKNOWN
- CLUSCTL_RESOURCE_GET_CHARACTERISTICS
- CLUSCTL_RESOURCE_GET_FLAGS
- CLUSCTL_RESOURCE_GET_CLASS_INFO
- CLUSCTL_RESOURCE_GET_REQUIRED_DEPENDENCIES
- CLUSCTL_RESOURCE_GET_NAME
- CLUSCTL_RESOURCE_GET_ID
- CLUSCTL_RESOURCE_GET_RESOURCE_TYPE
- CLUSCTL_RESOURCE_ENUM_COMMON_PROPERTIES
- CLUSCTL_RESOURCE_GET_RO_COMMON_PROPERTIES
- CLUSCTL_RESOURCE_GET_COMMON_PROPERTIES
- CLUSCTL_RESOURCE_SET_COMMON_PROPERTIES
- CLUSCTL_RESOURCE_VALIDATE_COMMON_PROPERTIES
- CLUSCTL_RESOURCE_GET_COMMON_PROPERTY_FMTS
- CLUSCTL_RESOURCE_ENUM_PRIVATE_PROPERTIES
- CLUSCTL_RESOURCE_GET_RO_PRIVATE_PROPERTIES
- CLUSCTL_RESOURCE_GET_PRIVATE_PROPERTIES
- CLUSCTL_RESOURCE_SET_PRIVATE_PROPERTIES
- CLUSCTL_RESOURCE_VALIDATE_PRIVATE_PROPERTIES
- CLUSCTL_RESOURCE_GET_PRIVATE_PROPERTY_FMTS
- CLUSCTL_RESOURCE_ADD_REGISTRY_CHECKPOINT
- CLUSCTL_RESOURCE_DELETE_REGISTRY_CHECKPOINT
- CLUSCTL_RESOURCE_GET_REGISTRY_CHECKPOINTS
- CLUSCTL_RESOURCE_ADD_CRYPTO_CHECKPOINT
- CLUSCTL_RESOURCE_DELETE_CRYPTO_CHECKPOINT
- CLUSCTL_RESOURCE_GET_CRYPTO_CHECKPOINTS
- CLUSCTL_RESOURCE_GET_LOADBAL_PROCESS_LIST
- CLUSCTL_RESOURCE_GET_NETWORK_NAME
- CLUSCTL_RESOURCE_NETNAME_GET_VIRTUAL_SERVER_TOKEN
- CLUSCTL_RESOURCE_NETNAME_SET_PWD_INFO
- CLUSCTL_RESOURCE_NETNAME_DELETE_CO
- CLUSCTL_RESOURCE_NETNAME_VALIDATE_VCO
- CLUSCTL_RESOURCE_NETNAME_RESET_VCO
- CLUSCTL_RESOURCE_NETNAME_REGISTER_DNS_RECORDS
- CLUSCTL_RESOURCE_GET_DNS_NAME
- CLUSCTL_RESOURCE_STORAGE_GET_DISK_INFO
- CLUSCTL_RESOURCE_STORAGE_IS_PATH_VALID
- CLUSCTL_RESOURCE_QUERY_DELETE
- CLUSCTL_RESOURCE_UPGRADE_DLL
- CLUSCTL_RESOURCE_IPADDRESS_RENEW_LEASE
- CLUSCTL_RESOURCE_IPADDRESS_RELEASE_LEASE
- CLUSCTL_RESOURCE_ADD_REGISTRY_CHECKPOINT_64BIT
- CLUSCTL_RESOURCE_ADD_REGISTRY_CHECKPOINT_32BIT
- CLUSCTL_RESOURCE_QUERY_MAINTENANCE_MODE
- CLUSCTL_RESOURCE_SET_MAINTENANCE_MODE
- CLUSCTL_RESOURCE_STORAGE_SET_DRIVELETTER
- CLUSCTL_RESOURCE_STORAGE_GET_DISK_INFO_EX
- CLUSCTL_RESOURCE_FILESERVER_SHARE_ADD
- CLUSCTL_RESOURCE_FILESERVER_SHARE_DEL
- CLUSCTL_RESOURCE_FILESERVER_SHARE_MODIFY
- CLUSCTL_RESOURCE_FILESERVER_SHARE_REPORT
- CLUSCTL_RESOURCE_STORAGE_GET_MOUNTPOINTS
- CLUSCTL_RESOURCE_STORAGE_CLUSTER_DISK
- CLUSCTL_RESOURCE_STORAGE_GET_DIRTY
- CLUSCTL_RESOURCE_SET_CSV_MAINTENANCE_MODE
- CLUSCTL_RESOURCE_ENABLE_SHARED_VOLUME_DIRECTIO
- CLUSCTL_RESOURCE_DISABLE_SHARED_VOLUME_DIRECTIO
- CLUSCTL_RESOURCE_SET_SHARED_VOLUME_BACKUP_MODE
- CLUSCTL_RESOURCE_DELETE
- CLUSCTL_RESOURCE_INSTALL_NODE
- CLUSCTL_RESOURCE_EVICT_NODE
- CLUSCTL_RESOURCE_ADD_DEPENDENCY
- CLUSCTL_RESOURCE_REMOVE_DEPENDENCY
- CLUSCTL_RESOURCE_ADD_OWNER
- CLUSCTL_RESOURCE_REMOVE_OWNER
- CLUSCTL_RESOURCE_SET_NAME
- CLUSCTL_RESOURCE_CLUSTER_NAME_CHANGED
- CLUSCTL_RESOURCE_CLUSTER_VERSION_CHANGED
- CLUSCTL_RESOURCE_FORCE_QUORUM
- CLUSCTL_RESOURCE_INITIALIZE
- CLUSCTL_RESOURCE_STATE_CHANGE_REASON
- CLUSCTL_RESOURCE_PROVIDER_STATE_CHANGE
- CLUSCTL_RESOURCE_LEAVING_GROUP
- CLUSCTL_RESOURCE_JOINING_GROUP
- CLUSCTL_RESOURCE_FSWITNESS_GET_EPOCH_INFO
- CLUSCTL_RESOURCE_FSWITNESS_SET_EPOCH_INFO
- CLUSCTL_RESOURCE_FSWITNESS_RELEASE_LOCK
- CLUSCTL_RESOURCE_NETNAME_CREDS_UPDATED
[in, optional] lpInBuffer
Pointer to an input buffer containing information needed for the operation, or NULL if no information is needed.
[in] cbInBufferSize
The allocated size (in bytes) of the input buffer.
[out, optional] lpOutBuffer
Pointer to an output buffer to receive the data resulting from the operation, or NULL if no data will be returned.
[in] cbOutBufferSize
The allocated size (in bytes) of the output buffer.
[out, optional] lpBytesReturned
Returns the actual size (in bytes) of the data resulting from the operation. If this information is not needed, pass NULL for lpBytesReturned.
Return value
The function returns one of the following values.
Return code/value | Description |
---|---|
|
The operation was successful. If the operation required an output buffer, lpBytesReturned (if not NULL on input) points to the actual size of the data returned in the buffer. |
|
The output buffer pointed to by lpOutBuffer was not large enough to hold the data resulting from the operation. The lpBytesReturned parameter (if not NULL on input) points to the size required for the output buffer. Only operations requiring an output buffer return ERROR_MORE_DATA. If the lpOutBuffer parameter is NULL and the cbOutBufferSize parameter is zero, then ERROR_SUCCESS may be returned, not ERROR_MORE_DATA. |
|
Applies only to CLUSCTL_RESOURCE_SET_COMMON_PROPERTIES and CLUSCTL_RESOURCE_SET_PRIVATE_PROPERTIES. Indicates that the properties were successfully stored but have not yet been applied to the resource. The new properties will take effect after the resource is taken offline and brought online again. |
|
The node specified by the hNode parameter is not the node that owns the resource specified by hResource. |
The operation was not successful. If the operation required an output buffer, the value specified by lpBytesReturned (if not NULL on input) is unreliable. |
Remarks
When ClusterResourceControl returns ERROR_MORE_DATA, set cbOutBufferSize to the number of bytes pointed to by lpBytesReturned, and call the function again.
Do not pass LPC and RPC handles to the same function call. Otherwise, the call will raise an RPC exception and can have additional destructive effects. For information on how LPC and RPC handles are created, see LPC and RPC Handles and OpenCluster.
The ClusterResourceControl function is one of the control code functions. For more information on control codes and control code functions, see Using Control Codes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | None supported |
Minimum supported server | Windows Server 2008 Enterprise, Windows Server 2008 Datacenter |
Target Platform | Windows |
Header | clusapi.h |
Library | ClusAPI.lib |
DLL | ClusAPI.dll |