PeerCollabEnumEndpoints function (p2p.h)

The PeerCollabEnumEndpoints function returns the handle to an enumeration that contains the endpoints associated with a specific peer contact.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerCollabEnumEndpoints(
  [in]  PCPEER_CONTACT pcContact,
  [out] HPEERENUM      *phPeerEnum
);

Parameters

[in] pcContact

Pointer to a PEER_CONTACT structure that contains the contact information for a specific peer. This parameter must not be NULL.

[out] phPeerEnum

Pointer to a handle for the enumerated set of endpoints that are associated with the supplied peer contact. Pass this handle to PeerGetNextItem to obtain each item in the enumerated set.

Return value

Returns S_OK if the function succeeds. Otherwise, the function returns one of the following values.

Return code Description
E_OUTOFMEMORY
There is not enough memory to support this operation.
E_INVALIDARG
One of the arguments is invalid.
PEER_E_NOT_INITIALIZED
The Windows Peer infrastructure is not initialized. Calling the relevant initialization function is required.
PEER_E_NOT_SIGNED_IN
The operation requires the user to be signed in.

Remarks

It is recommended that a contact record is updated using PeerCollabUpdateContact prior to calling PeerCollabEnumEndpoints. Failure to do so can result in a return of E_INVALIDARG.

Endpoints will be available only for contacts with fWatch set to true. Only endpoints that have the "Me" contact of the calling peer saved as a trusted contact and have WatcherPermissions set to allow will be available. A contact must also be signed-in to the internet. In the event the contact is not signed-in, the error E_INVALIDARG will be returned.

To obtain the individual peer endpoints, pass the returned handle to PeerGetNextItem. An array of pointers to PEER_ENDPOINT structures will be returned. If no endpoints are available, an empty array will be returned. To close the enumeration and release the resources associated with it, pass this handle to PeerEndEnumeration. Individual items returned by the enumeration must be released with PeerFreeData.

The limit for connections to a single contact is 50.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header p2p.h
Library P2P.lib
DLL P2P.dll

See also

PEER_ENDPOINT

Peer Collaboration API Functions