PeerGroupSearchRecords function (p2p.h)

The PeerGroupSearchRecords function searches the local peer group database for records that match the supplied criteria.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerGroupSearchRecords(
  [in]  HGROUP    hGroup,
  [in]  PCWSTR    pwzCriteria,
  [out] HPEERENUM *phPeerEnum
);

Parameters

[in] hGroup

Handle to the peer group whose local database is searched. This handle is returned by the PeerGroupCreate, PeerGroupOpen, or PeerGroupJoin function. This parameter is required.

[in] pwzCriteria

Pointer to a Unicode XML string that contains the record search query. For information about formulating an XML query string to search the peer group records database, see the Record Search Query Format documentation. This parameter is required.

[out] phPeerEnum

Pointer to the enumeration that contains the returned list of records. This handle is passed to
PeerGetNextItem to retrieve the items with each item represented as a pointer to a PEER_RECORD structure. When finished, PeerEndEnumeration is called to return the memory used by the enumeration. This parameter is required.

Return value

Returns S_OK if the operation succeeds. Otherwise, the function 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 available to complete the operation.
PEER_E_INVALID_SEARCH
The XML search query does not adhere to the search query schema specification.
 

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

See also

PeerEndEnumeration

PeerGetNextItem

PeerGroupCreate

PeerGroupJoin

PeerGroupOpen

Record Search Query Format