ClusterNetworkEnum function (clusapi.h)

Enumerates cluster objects on a network, returning the name of one object with each call. The PCLUSAPI_CLUSTER_NETWORK_ENUM type defines a pointer to this function.

Syntax

DWORD ClusterNetworkEnum(
  [in]      HNETWORKENUM hNetworkEnum,
  [in]      DWORD        dwIndex,
  [out]     LPDWORD      lpdwType,
  [out]     LPWSTR       lpszName,
  [in, out] LPDWORD      lpcchName
);

Parameters

[in] hNetworkEnum

A handle to an existing enumeration object originally returned by the ClusterNetworkOpenEnum function.

[in] dwIndex

The index used to identify the next entry to be enumerated. This parameter should be zero for the first call to ClusterNetworkEnum and then incremented for subsequent calls.

[out] lpdwType

A pointer to the type of object returned. The following value of the CLUSTER_NETWORK_ENUM enumeration is returned with each call.

CLUSTER_NETWORK_ENUM_NETINTERFACES (1)

The object is a network interface.

[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. 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 completed successfully.
ERROR_MORE_DATA
234 (0xEA)
More data is available. This value is returned if 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.
ERROR_NO_MORE_ITEMS
259 (0x103)
No more data is available. This value is returned if there are no more objects of the requested type to be returned.

Remarks

The ClusterNetworkEnum function is typically used to iterate through a collection of objects of one or more types belonging to a network object. If, for example, an application wants to enumerate all of the network interface objects on a network, it calls ClusterNetworkOpenEnum to open a network enumerator that can process network interface objects. The dwType parameter is set to CLUSTER_NETWORK_ENUM_NETINTERFACES to specify network interfaces as the object type to be enumerated. With the handle that ClusterNetworkOpenEnum returns, the application calls ClusterNetworkEnum repeatedly to retrieve each of the objects. The lpdwType parameter points to the type of object that is retrieved.

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_NETWORK_ENUM

Cluster Network Management Functions

ClusterNetworkCloseEnum

ClusterNetworkOpenEnum