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 |
---|---|
|
Cannot access a peer graph. |
|
One of the parameters is not valid. |
|
There is not enough memory to perform a specified operation. |
|
A graph is not synchronized. Records cannot be added until the peer graph is synchronized. |
|
PeerGraphClose has been called. |
|
The specified attributes do not match the schema. |
|
The handle to a peer graph is invalid. |
|
The record exceeds the maximum size allowed by a peer graph. |
|
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:
- dwSize.
- type.
- ftExpiration - Must be later than the current graph time, and must be specified in peer time by using PeerGraphUniversalTimeToPeerTime.
- data
- pwzAttributes
- securityData
- dwVersion
- pwzCreatorId - Uses the peer ID passed to either PeerGraphCreate or PeerGraphOpen.
- pwzModifiedById - Uses the pwzCreatorId.
- 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 |