Condividi tramite


CLUSCTL_RESOURCE_GET_CHARACTERISTICS control code

Retrieves the intrinsic characteristics of a resource. Applications use this control code as a parameter to the ClusterResourceControl function, and resource DLLs receive the control code as a parameter to the ResourceControl function.

ClusterResourceControl( 
  hResource,                            // resource handle
  hHostNode,                            // optional host node
  CLUSCTL_RESOURCE_GET_CHARACTERISTICS, // this control code
  NULL,                                 // input buffer (not used)
  0,                                    // input buffer size (not used)
  lpOutBuffer,                          // output buffer: DWORD bitmask
  cbOutBufferSize,                      // allocated buffer size (bytes)
  lpcbBytesReturned );                  // actual size of resulting data (bytes)

Parameters

The following control code function and DLL support parameter is specific to this control code. For complete parameter descriptions, see ClusterResourceControl or ResourceControl.

lpOutBuffer

On a successful return, contains a DWORD bitmask describing the resource's characteristics as any combination of the following values enumerated from the CLUS_CHARACTERISTICS enumeration.

CLUS_CHAR_UNKNOWN (0x00000000)

The resource has no known characteristics.

CLUS_CHAR_QUORUM (0x00000001)

The resource can be selected as the quorum resource for the cluster.

CLUS_CHAR_DELETE_REQUIRES_ALL_NODES (0x00000002)

The resource cannot be deleted unless all nodes are active.

CLUS_CHAR_LOCAL_QUORUM (0x00000004)

The resource can be selected as the quorum resource in clusters configured using the -localquorum switch.

CLUS_CHAR_REQUIRES_STATE_CHANGE_REASON (0x00000010)

The resource DLL will receive the CLUSCTL_RESOURCE_STATE_CHANGE_REASON control code.

CLUS_CHAR_SINGLE_CLUSTER_INSTANCE (0x00000040)

Only one instance of this resource type is allowed in a cluster.

CLUS_CHAR_SINGLE_GROUP_INSTANCE (0x00000080)

Only one instance of this resource type is allowed in a group.

Return value

ClusterResourceControl returns one of the following values.

ERROR_SUCCESS

The operation completed successfully. The lpcbBytesReturned parameter points to the actual size of the returned data.

ERROR_MORE_DATA

More data is available. The output buffer pointed to by lpOutBuffer was not large enough to hold the data resulting from the operation. The lpcbBytesReturned parameter points to the size required for the output buffer.

System error code

If any other value is returned, the operation failed. The value of lpcbBytesReturned is unreliable.

Implementations of ResourceControl can return the above values or the following value.

ERROR_INVALID_FUNCTION

Requests that the Resource Monitor perform default processing (if any) for the control code addition to processing supplied by the DLL (if any).

Remarks

Do not use the CLUSCTL_RESOURCE_GET_CHARACTERISTICS control code in any resource DLL entry point function. This control code can safely be called from a worker thread. For more information, see Function Calls to Avoid in Resource DLLs.

ClusAPI.h defines the 32 bits of CLUSCTL_RESOURCE_GET_CHARACTERISTICS as follows (for more information, see Control Code Architecture).

Component Bit location Value
Object code 24 31 CLUS_OBJECT_RESOURCE (0x1)
Global bit 23 CLUS_NOT_GLOBAL (0x0)
Modify bit 22 CLUS_NO_MODIFY (0x0)
User bit 21 CLCTL_CLUSTER_BASE (0x0)
Type bit 20 External (0x0)
Operation code 0 23 CLCTL_GET_CHARACTERISTICS (0x5)
Access code 0 1 CLUS_ACCESS_READ (0x1)

Resource DLL Support

Optional. If you support CLUSCTL_RESOURCE_GET_CHARACTERISTICS, use the output buffer to specify a value that accurately describes the resource.

  • If the resource is quorum-capable and you want users and applications to be able to select it as the quorum resource for the cluster, specify CLUS_CHAR_QUORUM. Note that if a resource that is not quorum-capable is selected as the quorum resource, the cluster becomes unusable.
  • If you want to prevent the resource from being deleted unless all nodes are active, specify CLUS_CHAR_DELETE_REQUIRES_ALL_NODES. Attempts to delete the resource will fail and return ERROR_HOST_NODE_NOT_AVAILABLE unless all nodes are active.
  • If you want your resource DLL to receive the CLUSCTL_RESOURCE_STATE_CHANGE_REASON control code, specify CLUS_CHAR_REQUIRES_STATE_CHANGE_REASON.

If you do not support this control code, return ERROR_INVALID_FUNCTION to allow the following default processing to occur.

  • If your resource DLL has Arbitrate and Release entry points, the Resource Monitor sets the CLUS_CHAR_QUORUM characteristic for the resource.
  • If your resource DLL does not have Arbitrate and Release entry points, the Resource Monitor clears the CLUS_CHAR_QUORUM characteristic for the resource.

For more information on the ResourceControl entry point, see Implementing ResourceControl.

Requirements

Minimum supported client
None supported
Minimum supported server
Windows Server 2008 Enterprise, Windows Server 2008 Datacenter
Header
ClusAPI.h

See also

External Resource Control Codes

ClusterResourceControl

ResourceControl

CLUS_CHARACTERISTICS