PeerGraphSetPresence function (p2p.h)

The PeerGraphSetPresence function explicitly turns on or off the publication of presence records for a specific node. This function can override the presence settings in the peer graph properties. Calling this function enables nodes to be enumerated with PeerGraphEnumNodes.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerGraphSetPresence(
  [in] HGRAPH hGraph,
  [in] BOOL   fPresent
);

Parameters

[in] hGraph

Handle to a peer graph.

[in] fPresent

Specify TRUE to force the Peer Graphing Infrastructure to publish a presence record for this node, which overrides the setting specified by the cPresenceMax in PEER_GRAPH_PROPERTIES. Specify FALSE to return the node to the default behavior specified in the peer graph properties.

Note  Depending on the peer graphing presence policy, setting fPresent to FALSE does not guarantee that a peer's presence information is removed. It means that a peer's presence is not published anymore.
 

Return value

If the function call succeeds, the return value is S_OK. Otherwise, it returns one of the following values.

Return code Description
E_INVALIDARG
One of the parameters is not valid.
PEER_E_INVALID_GRAPH
The handle to the peer graph is invalid. The presence information cannot be published.
PEER_E_NOT_INITIALIZED
The peer graph must be initialized with a call to PeerGraphStartup before using this function.

Remarks

If presence information has not been explicitly published by the peer graph, the nodes are not visible when a peer graph is enumerated.

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

See also

PeerGraphEnumNodes