PeerCollabEnumApplications function (p2p.h)

The PeerCollabEnumApplications function returns the handle to an enumeration that contains the applications registered to a specific peer's endpoint(s).

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerCollabEnumApplications(
  [in, optional] PCPEER_ENDPOINT pcEndpoint,
  [in, optional] const GUID      *pApplicationId,
  [out]          HPEERENUM       *phPeerEnum
);

Parameters

[in, optional] pcEndpoint

Pointer to a PEER_ENDPOINT structure that contains the endpoint information for a peer whose applications will be enumerated.

If this parameter is set to NULL, the published application information for the local peer's endpoint is enumerated.

[in, optional] pApplicationId

Pointer to the GUID value that uniquely identifies a particular application of the supplied peer. If this parameter is supplied, the only peer application returned is the one that matches this GUID.

[out] phPeerEnum

Pointer to the handle for the enumerated set of registered applications that correspond to the GUID returned in pObjectId. 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.

Remarks

In order to enumerate the applications for the specified endpoint successfully, application data must be available on the endpoint. For application data to be available, one of the following must occur:

To obtain the individual peer applications, pass the returned handle to PeerGetNextItem. 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.

Peer application data items are returned as individual PEER_APPLICATION structures.

The PeerCollabEnumApplications function returns an empty array for endpoints on the subnet that are not trusted contacts.

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_APPLICATION

PEER_CONTACT

PEER_ENDPOINT

Peer Collaboration API Functions