PeerEnumGroups function (p2p.h)

The PeerEnumGroups function creates and returns a peer enumeration handle used to enumerate all the peer groups associated with a specific peer identity.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerEnumGroups(
  [in]  PCWSTR    pwzIdentity,
  [out] HPEERENUM *phPeerEnum
);

Parameters

[in] pwzIdentity

Specifies the peer identity to enumerate groups for.

[out] phPeerEnum

Receives a handle to the peer enumeration that contains the list of peer groups that the specified identity is a member of, with each item represented as a pointer to a PEER_NAME_PAIR structure. Pass this handle to PeerGetNextItem to retrieve the items; when finished, call PeerEndEnumeration release the memory.

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_NOT_FOUND
The specified peer identity cannot be found.

Remarks

Once the application has obtained the enumeration handle, use PeerGetNextItem and PeerGetItemCount to enumerate the peer groups.

When enumerating peer groups, PeerGetNextItem returns an array of pointers to PEER_NAME_PAIR structures.

Call PeerEndEnumeration to free the peer enumeration handle when it is no longer required.

Requirements

Requirement Value
Minimum supported client Windows XP with SP2 [desktop apps only],Windows XP with SP1 with the Advanced Networking Pack for Windows XP
Minimum supported server None supported
Target Platform Windows
Header p2p.h
Library P2P.lib
DLL P2P.dll

See also

PEER_NAME_PAIR

PeerEndEnumeration

PeerGetItemCount

PeerGetNextItem