PeerGraphEnumRecords function (p2p.h)

The PeerGraphEnumRecords function creates and returns an enumeration handle used to enumerate records of a specific type of record, user, or both. An enumeration provides a snapshot of records at the time an enumeration is performed.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerGraphEnumRecords(
  [in]  HGRAPH     hGraph,
  [in]  const GUID *pRecordType,
  [in]  PCWSTR     pwzPeerId,
  [out] HPEERENUM  *phPeerEnum
);

Parameters

[in] hGraph

Handle to a peer graph.

[in] pRecordType

Pointer to the type of record to enumerate. Specify NULL to enumerate all record types.

[in] pwzPeerId

Pointer to a string that identifies the creator that an application is requesting an enumeration for. Specify NULL to enumerate all records.

[out] phPeerEnum

Receives a handle to an enumeration. Supply the handle to all calls to PeerGraphGetNextItem. When a handle is not needed, free it by calling PeerGraphEndEnumeration.

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 parameter is not valid.
E_OUTOFMEMORY
There is not enough memory to perform a specified operation.
PEER_E_INVALID_GRAPH
The handle to a peer graph is invalid.
PEER_E_NOT_INITIALIZED
A graph must be initialized with a call to PeerGraphStartup before using this function.

Remarks

  • If both the pRecordType and pwzPeerId parameters are NULL, all records are returned.
  • For simple enumeration tasks, use the PeerGraphEnumRecords function, because it is more efficient than the PeerGraphSearchRecords function. For complex enumeration and filtering tasks such as heuristic searches of the database, use the PeerGraphSearchRecords function.
  • When PeerGraphGetNextItem is called with the handle that PeerGraphEnumRecords returns, PeerGraphGetNextItem returns the data in the PEER_RECORD structure.

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

PeerGraphEndEnumeration

PeerGraphGetItemCount

PeerGraphGetNextItem

PeerGraphSearchRecords