PeerGroupAddRecord function (p2p.h)
The PeerGroupAddRecord function adds a new record to the peer group, which is propagated to all participating peers.
Syntax
NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerGroupAddRecord(
[in] HGROUP hGroup,
[in] PPEER_RECORD pRecord,
[out] GUID *pRecordId
);
Parameters
[in] hGroup
Handle to the peer group. This handle is returned by the PeerGroupCreate, PeerGroupOpen, or PeerGroupJoin function. This parameter is required.
[in] pRecord
Pointer to a PEER_RECORD structure that is added to the peer group specified in hGroup. This parameter is required.
The following members in PEER_RECORD must be populated.
- dwSize
- type
- ftExpiration
The following members are ignored and overwritten if populated.
- id
- pwzCreatorId
- pwzLastModifiedById
- ftCreation
- ftLastModified
- securityData
[out] pRecordId
Pointer to a GUID that identifies the record. This parameter is required.
Return value
Returns S_OK if the function succeeds. Otherwise, the function returns one of the following values.
Return code | Description |
---|---|
|
One of the parameters is not valid. |
|
There is not enough memory to perform the specified operation. |
|
The peer group is not in a state where records can be added. For example, PeerGroupJoin is called, but synchronization with the peer group database has not completed. |
|
The XML string that contains the record attributes in the pwzAttributes member of the PEER_RECORD structure does not comply with the schema specification. |
|
The handle to the peer group is invalid. |
|
The supplied peer name is invalid. |
|
One or more fields in PEER_RECORD are invalid. |
|
The record has exceeded the maximum size allowed by the peer group properties. |
|
The identity is not authorized to publish a record of that type. |
Cryptography-specific errors can be returned from the Microsoft RSA Base Provider. These errors are prefixed with CRYPT_* and defined in Winerror.h.
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 | P2P.lib |
DLL | P2P.dll |