PeerCollabEnumObjects function (p2p.h)

The PeerCollabEnumObjects function returns the handle to an enumeration that contains the peer objects associated with a specific peer's endpoint.

Syntax

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

Parameters

[in] pcEndpoint

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

If this parameter is NULL the published objects of the local peer's contacts are returned.

[in, optional] pObjectId

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

[out] phPeerEnum

Pointer to the handle for the enumerated set of peer objects 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.
PEER_E_NOT_SIGNED_IN
The operation requires the user to be signed in.

Remarks

Peer objects are run-time data items associated with a particular application, such as a picture, an avatar, a certificate, or a specific description. Each peer object must be smaller than 16K in size.

PeerCollabEnumObjects will return all of the objects published for the local peer. The objects can be published by more than one application.

To obtain the individual peer objects, pass the returned handle to PeerGetNextItem. The peer objects are returned as an array of pointers to the PEER_OBJECT structures. If the endpoint is not publishing any objects, 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.

To obtain a peer object successfully:

If the user is publishing a picture, the picture can be obtained by retrieving the corresponding object. The GUID for the picture object is PEER_COLLAB_OBJECTID_USER_PICTURE.

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_CONTACT

PEER_ENDPOINT

PEER_OBJECT

Peer Collaboration API Functions