PeerGroupEnumConnections function (p2p.h)

The PeerGroupEnumConnections function creates an enumeration of connections currently active on the peer.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerGroupEnumConnections(
  [in]  HGROUP    hGroup,
  [in]  DWORD     dwFlags,
  [out] HPEERENUM *phPeerEnum
);

Parameters

[in] hGroup

Handle to the group that contains the connections to be enumerated. This handle is returned by the PeerGroupCreate, PeerGroupOpen, or PeerGroupJoin function. This parameter is required.

[in] dwFlags

Specifies the flags that indicate the type of connection to enumerate. Valid values are specified by PEER_CONNECTION_FLAGS.

[out] phPeerEnum

Pointer to the enumeration that contains the returned list of active connections. This handle is passed to
PeerGetNextItem to retrieve the items, with each item represented as a pointer to a PEER_CONNECTION_INFO structure. When finished, PeerEndEnumeration is called to return the memory used by the enumeration. This parameter is required.

Return value

Returns S_OK if the operation succeeds. Otherwise, the function 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 the specified operation.
PEER_E_INVALID_GROUP
The handle to the peer group is invalid.
 

Cryptography-specific errors can be returned from the Microsoft RSA Base Provider. These errors are prefixed with CRYPT_* and defined in Winerror.h.

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 P2P.lib
DLL P2P.dll

See also

PeerEndEnumeration

PeerGetItemCount

PeerGetNextItem