CreateClusterResource function (clusapi.h)

Creates a resource in a cluster. The PCLUSAPI_CREATE_CLUSTER_RESOURCE type defines a pointer to this function.

Syntax

HRESOURCE CreateClusterResource(
  [in] HGROUP  hGroup,
  [in] LPCWSTR lpszResourceName,
  [in] LPCWSTR lpszResourceType,
  [in] DWORD   dwFlags
);

Parameters

[in] hGroup

Handle to the group that should receive the resource.

[in] lpszResourceName

Pointer to a null-terminated Unicode string containing the name of the new resource. The specified name must be unique within the cluster.

[in] lpszResourceType

Pointer to the type of new resource. The specified type must be installed in the cluster.

[in] dwFlags

Bitmask describing how the resource should be added to the cluster. The dwFlags parameter can be set to one of the following values enumerated from the CLUSTER_RESOURCE_CREATE_FLAGS enumeration.

CLUSTER_RESOURCE_DEFAULT_MONITOR (0)

The Cluster service determines the Resource Monitor to which the new resource will be assigned.

CLUSTER_RESOURCE_SEPARATE_MONITOR (1)

Causes the Cluster service to create a separate Resource Monitor dedicated exclusively to the new resource.

Return value

If the operation succeeds, the function returns a resource handle.

If the operation fails, the function returns NULL. For more information about the error, call GetLastError.

Remarks

Do not call CreateClusterResource 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

CLUSTER_RESOURCE_CREATE_FLAGS

Cluster Resource Management Functions

DeleteClusterResource

OpenClusterGroup