PFNPEER_SECURE_RECORD callback function (p2p.h)

The PFNPEER_SECURE_RECORD callback specifies the function that the Peer Graphing Infrastructure calls to secure records.



HRESULT PfnpeerSecureRecord(
  [in]  HGRAPH hGraph,
  [in]  PVOID pvContext,
  [in]  PPEER_RECORD pRecord,
  [in]  PEER_RECORD_CHANGE_TYPE changeType,
  [out] PPEER_DATA *ppSecurityData


[in] hGraph

Specifies the peer graph associated with the specified record.

[in] pvContext

Pointer to the security context. This parameter points to the pvContext member of the PEER_SECURITY_INTERFACE structure.

[in] pRecord

Pointer to the record to secure.

[in] changeType

Specifies the reason the validation must occur. PEER_RECORD_CHANGE_TYPE enumerates the valid values.

[out] ppSecurityData

Specifies the security data for this record. This data is released by calling the method specified in the pfnFreeSecurityData member of the PEER_SECURITY_INTERFACE after the data is copied and added to the record.

Return value

If this callback succeeds, the return value is S_OK.


This callback is invoked whenever an application calls any of the methods that modify records, such as PeerGraphAddRecord or PeerGraphUpdateRecord. This callback
should create data that is specific to this record, such as a small digital signature, and return it through the ppSecurityData parameter. This data is then added to the record in the securityData member, and is verified by the method specified by the pfnValidateRecord member of the PEER_SECURITY_INTERFACE.

Note  This process happens on the local computer as well as any peer connected to the graph when the peer receives the record.
If the operation specified by the changeType parameter is not allowed, the callback should return a failure code, such as PEER_E_NOT_AUTHORIZED, instead of S_OK.

This callback can be invoked from any of the Peer Graphing API functions involving records, such as PeerGraphUpdateRecord.


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

See also