PeerGraphEnumNodes function (p2p.h)

The PeerGraphEnumNodes function creates and returns an enumeration handle used to enumerate the nodes in a peer graph. The enumeration provides a snapshot of a peer graph at the time an enumeration is performed. Depending on the policy of a peer graph, and if nodes do not publish presence information, an enumeration does not return some nodes that are connected to a peer graph.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerGraphEnumNodes(
  [in]  HGRAPH    hGraph,
  [in]  PCWSTR    pwzPeerId,
  [out] HPEERENUM *phPeerEnum
);

Parameters

[in] hGraph

Handle to a peer graph.

[in] pwzPeerId

The peer ID to obtain a node enumeration. Specify NULL to return all nodes in a peer graph.

[out] phPeerEnum

Receives a handle to an enumeration. Use PeerGraphGetNextItem to retrieve the actual node information. When this handle is not needed, free it by calling PeerGraphEndEnumeration.

Return value

If a function call succeeds, the return value is S_OK. Otherwise, it returns one of the following values.

Return code Description
E_INVALIDARG
One parameter is not valid.
E_OUTOFMEMORY
There is not enough memory to perform a specified operation.
PEER_E_INVALID_GRAPH
The handle to a peer graph is invalid.
PEER_E_NOT_INITIALIZED
A peer graph must be initialized with a call to PeerGraphStartup before using this function.
PEER_E_NOT_READY
A peer graph is not synchronized completely, and the nodes cannot be enumerated.
PEER_E_PRESENCE_DISABLED
A peer graph does not require presence information. Therefore, the nodes cannot be enumerated.

Remarks

If PeerGraphGetNextItem is called with the handle that PeerGraphEnumNodes returns, then PeerGraphGetNextItem returns the data in the PEER_NODE_INFO structure.

Requirements

Requirement Value
Minimum supported client Windows XP with SP2 [desktop apps only],Windows XP with SP1 with the Advanced Networking Pack forWindows XP
Minimum supported server None supported
Target Platform Windows
Header p2p.h
Library P2PGraph.lib
DLL P2PGraph.dll

See also

PEER_NODE_INFO

PeerGraphEndEnumeration

PeerGraphGetItemCount

PeerGraphGetNextItem