PeerGraphGetItemCount function (p2p.h)

The PeerGraphGetItemCount function retrieves the number of items in an enumeration.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerGraphGetItemCount(
  [in]  HPEERENUM hPeerEnum,
  [out] ULONG     *pCount
);

Parameters

[in] hPeerEnum

Handle to a peer graph.

[out] pCount

Receives a pointer to the number of records in an enumeration.

Return value

If the function call succeeds, the return value is S_OK. Otherwise, it returns the following value.

Return code Description
E_INVALIDARG
One parameter is not valid.
E_OUTOFMEMORY
There is not enough memory to perform a specified operation.
PEER_E_NOT_INITIALIZED
A peer graph must be initialized with a call to PeerGraphStartup before using this function.

Remarks

Because some items can become invalid while an application is enumerating a set of items, the number of items returned from PeerGraphGetNextItem can be less than the number of items returned in pCount. The value of pCount indicates the number of items in an enumeration when the handle is created. Due to the dynamic nature of the Peer Infrastructure, it is not guaranteed that the number of items retrieved by using PeerGraphGetNextItem is equal to pCount.

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

PeerGraphEndEnumeration

PeerGraphGetNextItem