SetClusterQuorumResource function (clusapi.h)

Establishes a resource as the quorum resource for a cluster. The PCLUSAPI_SET_CLUSTER_QUORUM_RESOURCE type defines a pointer to this function.

Syntax

DWORD SetClusterQuorumResource(
  [in]           HRESOURCE hResource,
  [in, optional] LPCWSTR   lpszDeviceName,
  [in]           DWORD     dwMaxQuoLogSize
);

Parameters

[in] hResource

Handle to the new quorum resource; or the existing quorum resource when dwMaxQuoLogSize is CLUS_NODE_MAJORITY_QUORUM.

[in, optional] lpszDeviceName

Determines the drive letter and path that the Cluster service will use to maintain the quorum files on the new quorum resource. Pass a null-terminated Unicode string or NULL, as follows.

  • If you specify a drive letter in the path, the Cluster service will verify that the drive letter refers to a valid partition on the new quorum resource.
  • If you do not specify a drive letter in the path, the Cluster service will use a default partition on the new quorum resource (see below).
  • If NULL, the Cluster service will use a default partition and a default path name (see below).
The Cluster service uses the partition flagged as CLUSPROP_PIFLAG_DEFAULT_QUORUM as the default partition (see CLUSPROP_PARTITION_INFO), or, if the flag cannot be found, the first available NTFS partition on the new quorum resource.

For the default path name, the Cluster service uses the previous path name if one exists; otherwise it uses "MSCS".

[in] dwMaxQuoLogSize

The quorum type value. Specify one of the three constants listed. When you specify CLUS_NODE_MAJORITY_QUORUM, hResource must refer to the existing quorum resource.

CLUS_HYBRID_QUORUM (1024 (0x400))

CLUS_NODE_MAJORITY_QUORUM (0 (0x0))

CLUS_LEGACY_QUORUM (4194304 (0x400000))

Return value

If the operation succeeds, the function returns ERROR_SUCCESS (0).

If the operation fails, the function returns a system error code. The following is a possible error code.

Return code/value Description
ERROR_RESOURCE_NOT_ONLINE
5004 (0x138C)
The quorum resource is not online.

Remarks

Do not call SetClusterQuorumResource from a resource DLL. For more information, see Function Calls to Avoid in Resource DLLs.

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

See also

GetClusterQuorumResource