PeerGraphSearchRecords function (p2p.h)

The PeerGraphSearchRecords function searches the peer graph for specific records.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerGraphSearchRecords(
  [in]  HGRAPH    hGraph,
  [in]  PCWSTR    pwzCriteria,
  [out] HPEERENUM *phPeerEnum
);

Parameters

[in] hGraph

Handle to the peer graph.

[in] pwzCriteria

Pointer to an XML string that specifies the records to search for. For information on formulating an XML query string to search the peer graphing records, see Record Search Query Format.

[out] phPeerEnum

Handle to the enumeration.

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 of the parameters is not valid.
E_OUTOFMEMORY
There is not enough memory to perform the specified operation.
PEER_E_INVALID_GRAPH
The handle to the peer graph is invalid.
PEER_E_INVALID_SEARCH
The specified query does not adhere to the search schema. See Record Search Query Format for further information.
PEER_E_NOT_INITIALIZED
The peer graph must be initialized with a call to PeerGraphStartup before using this function.

Remarks

The PeerGraphEnumRecords function is more efficient than the PeerGraphSearchRecords function.

When PeerGraphGetNextItem is called with the handle returned by PeerGraphSearchRecords, 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

PeerGraphEnumRecords

PeerGraphGetItemCount

PeerGraphGetNextItem