ClusterResourceControl function

Initiates an operation affecting a resource. The operation performed depends on the control code passed to the dwControlCode parameter.


DWORD ClusterResourceControl(
  HRESOURCE hResource,
  HNODE     hHostNode,
  DWORD     dwControlCode,
  LPVOID    lpInBuffer,
  DWORD     cbInBufferSize,
  LPVOID    lpOutBuffer,
  DWORD     cbOutBufferSize,
  LPDWORD   lpBytesReturned



Handle to the resource to be affected.


Optional handle to the node to perform the operation. If NULL, the node that owns the resource identified by hResource performs the operation.


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:


Pointer to an input buffer containing information needed for the operation, or NULL if no information is needed.


The allocated size (in bytes) of the input buffer.


Pointer to an output buffer to receive the data resulting from the operation, or NULL if no data will be returned.


The allocated size (in bytes) of the output buffer.


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.
234 (0xEA)
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.
5024 (0x13A0)
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.
5015 (0x1397)
The node specified by the hNode parameter is not the node that owns the resource specified by hResource.
System error code
The operation was not successful. If the operation required an output buffer, the value specified by lpBytesReturned (if not NULL on input) is unreliable.


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.


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

See Also


Resource Control Codes