ClusterResourceTypeEnum function (clusapi.h)

Enumerates a resource type's possible owner nodes or resources, returning the name of one node or resource per call. The PCLUSAPI_CLUSTER_RESOURCE_TYPE_ENUM type defines a pointer to this function.

Syntax

DWORD ClusterResourceTypeEnum(
  [in]      HRESTYPEENUM hResTypeEnum,
  [in]      DWORD        dwIndex,
  [out]     LPDWORD      lpdwType,
  [out]     LPWSTR       lpszName,
  [in, out] LPDWORD      lpcchName
);

Parameters

[in] hResTypeEnum

Resource type enumeration handle returned from ClusterResourceTypeOpenEnum.

[in] dwIndex

Index of the resource or node object to return. This parameter should be zero for the first call to ClusterResourceTypeEnum and then incremented for subsequent calls.

[out] lpdwType

Type of object returned by ClusterResourceTypeEnum. The following values of the CLUSTER_RESOURCE_TYPE_ENUM enumeration are valid.

CLUSTER_RESOURCE_TYPE_ENUM_NODES (1)

The object is a node that can be a possible owner of the resource type.

CLUSTER_RESOURCE_TYPE_ENUM_RESOURCES (2)

The object is a resource that is an instance of the resource type.

[out] lpszName

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

[in, out] lpcchName

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. On output, specifies the number of characters in the resulting name, excluding the terminating NULL.

Return value

The function returns one of the following values.

Return code/value Description
ERROR_SUCCESS
0
The operation was successful.
ERROR_NO_MORE_ITEMS
259
There are no more objects to be returned.
ERROR_MORE_DATA
234
The buffer pointed to by lpszName is not big enough to hold the result. The lpcchName parameter returns the number of characters in the result, excluding the terminating NULL.
System error code
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 in the count. For more information on sizing buffers, see Data Size Conventions.

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_TYPE_ENUM

ClusterResourceTypeCloseEnum

ClusterResourceTypeOpenEnum

Resource Type Management Functions