PeerCollabSubscribeEndpointData function (p2p.h)
The PeerCollabSubscribeEndpointData function creates a subscription to an available endpoint.
Syntax
NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerCollabSubscribeEndpointData(
[in] const PCPEER_ENDPOINT pcEndpoint
);
Parameters
[in] pcEndpoint
Pointer to a PEER_ENDPOINT structure that contains the peer endpoint used to obtain presence information.
Return value
Returns S_OK or PEER_S_SUBSCRIPTION_EXISTS if the function succeeds. Otherwise, the function returns one of the following values.
Return code | Description |
---|---|
|
There is not enough memory to support this operation. |
|
One of the arguments is invalid. |
|
The Windows Peer infrastructure is not initialized. Calling the relevant initialization function is required. |
Remarks
PeerCollabSubscribeEndpointData is an asynchronous call, meaning that the process to subscribe the endpoint has been started but not necessarily completed when this call returns. An application should wait for PEER_EVENT_REQUEST_STATUS_CHANGED to get the result of the subscription request.
This function will timeout at 30 seconds.
PeerCollabSubscribeEndpointData can be called multiple times from different applications for the same endpoint. Each call is reference counted; only when the last reference is released is a peer unsubscribed. To release the reference call PeerCollabUnsubscribeEndpointData.
When an application exits without calling PeerCollabUnsubscribeEndpointData, all of the references for that application are released automatically.
To successfully call the PeerCollabGetPresenceInfo, PeerCollabEnumApplications, PeerCollabEnumObjects, and PeerCollabQueryContactData APIs, an application must first call PeerCollabSubscribeEndpointData.
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 |