ClusterResourceEnum function (clusapi.h)

Enumerates a resource's dependent resources, nodes, or both. It returns the name of one cluster object with each call. The PCLUSAPI_CLUSTER_RESOURCE_ENUM type defines a pointer to this function.

Syntax

DWORD ClusterResourceEnum(
  [in]      HRESENUM hResEnum,
  [in]      DWORD    dwIndex,
  [out]     LPDWORD  lpdwType,
  [out]     LPWSTR   lpszName,
  [in, out] LPDWORD  lpcchName
);

Parameters

[in] hResEnum

A resource enumeration handle returned from the ClusterResourceOpenEnum function.

[in] dwIndex

The index of the resource or node object to return. This parameter should be zero for the first call to the ClusterResourceEnum function and then incremented for subsequent calls.

[out] lpdwType

The type of object returned by ClusterResourceEnum.

The possible values are one of the following CLUSTER_RESOURCE_ENUM enumeration values:

CLUSTER_RESOURCE_ENUM_DEPENDS (1)

The object is a resource and hResEnum is a resource that depends on this object.

CLUSTER_RESOURCE_ENUM_PROVIDES (2)

The object is a resource that depends on the resource identified by hResEnum.

CLUSTER_RESOURCE_ENUM_NODES (4)

The object is a node that can host the resource identified by hResEnum.

[out] lpszName

A pointer to a null-terminated Unicode string containing the name of the returned object.

[in, out] lpcchName

A pointer to the size of the lpszName buffer as a count of characters. On input, specify the maximum number of characters the buffer can hold, including the terminating null character. On output, specifies the number of characters in the resulting name, excluding the terminating null character.

Return value

The function returns one of the following values.

Return code/value Description
ERROR_SUCCESS
0
The operation completed successfully or the lpszName parameter is NULL.
ERROR_MORE_DATA
234 (0xEA)
The buffer pointed to by the lpszName parameter is not big enough to hold the result. The lpcchName parameter returns the number of characters in the result, excluding the terminating null character.
ERROR_NO_MORE_ITEMS
259 (0x103)
There are no more objects to be returned.
System error code
Any other returned error code indicates that the operation failed.

Remarks

Note that lpcchName refers to a count of characters and not a count of bytes, and that the returned size does not include the terminating null character in the count. For more information on sizing buffers, see Data Size Conventions.

Do not call ClusterResourceEnum from any resource DLL entry point function. ClusterResourceEnum can safely be called from a worker thread. For more information, see Function Calls to Avoid in Resource DLLs.

Examples

See Enumerating Objects.

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 Management Functions

ClusterResourceCloseEnum

ClusterResourceOpenEnum