PeerGraphAddRecord function (p2p.h)

The PeerGraphAddRecord function adds a new record to a peer graph. A record added with this function is sent to each node in a peer graph.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerGraphAddRecord(
  [in]  HGRAPH       hGraph,
  [in]  PPEER_RECORD pRecord,
  [out] GUID         *pRecordId
);

Parameters

[in] hGraph

Handle to a peer graph.

[in] pRecord

Pointer to a record to add.

[out] pRecordId

Specifies the record ID that uniquely identifies a record in a peer graph.

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_ACCESSDENIED
Cannot access a peer graph.
E_INVALIDARG
One of the parameters is not valid.
E_OUTOFMEMORY
There is not enough memory to perform a specified operation.
PEER_E_GRAPH_NOT_READY
A graph is not synchronized. Records cannot be added until the peer graph is synchronized.
PEER_E_GRAPH_SHUTTING_DOWN

PeerGraphClose has been called.

PEER_E_INVALID_ATTRIBUTES
The specified attributes do not match the schema.
PEER_E_INVALID_GRAPH
The handle to a peer graph is invalid.
PEER_E_MAX_RECORD_SIZE_EXCEEDED
The record exceeds the maximum size allowed by a peer graph.
PEER_E_NOT_INITIALIZED
The graph must be initialized with a call to PeerGraphStartup—before using this function.

Remarks

The following members of the PEER_RECORD structure must contain valid values:

The following members of the PEER_RECORD structure are optional. Set them to NULL if they are not used by your application:
  • data
  • pwzAttributes
  • securityData
  • dwVersion
If any of the following members are NULL, the Peer Graphing API performs the specified default behavior: The following members cannot be specified; any value used is overwritten by the Peer Graphing infrastructure:
  • id.
  • ftCreation - Uses peer time.
  • ftLastModified - Uses peer time.

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

PEER_RECORD

PeerGraphDelete

PeerGraphGetEventData

PeerGraphUpdate