PeerGraphEnumConnections function (p2p.h)

The PeerGraphEnumConnections function creates and returns an enumeration handle used to enumerate the connections of a local node.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerGraphEnumConnections(
  [in]  HGRAPH    hGraph,
  [in]  DWORD     dwFlags,
  [out] HPEERENUM *phPeerEnum
);

Parameters

[in] hGraph

Handle to a peer graph.

[in] dwFlags

The type of connection to enumerate. This parameter is required. Valid values are specified by PEER_CONNECTION_FLAGS.

[out] phPeerEnum

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

Return value

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

Return code Description
E_INVALIDARG
One of the parameters 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
The peer graph must be initialized with a call to PeerGraphStartup before using this function.

Remarks

When PeerGraphGetNextItem is called with the enumeration handle returned by PeerGraphEnumConnections, PeerGraphGetNextItem returns a PEER_CONNECTION_INFO structure.

Requirements

   
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_CONNECTION_INFO

PeerGraphEndEnumeration

PeerGraphGetItemCount

PeerGraphGetNextItem