PeerGraphGetEventData function (p2p.h)

The PeerGraphGetEventData function retrieves peer events. An application calls this function until the return value PEER_S_NO_EVENT_DATA is returned, which indicates that a call is successful, but that there are no more peer events to retrieve.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerGraphGetEventData(
  [in]  HPEEREVENT             hPeerEvent,
  [out] PPEER_GRAPH_EVENT_DATA *ppEventData
);

Parameters

[in] hPeerEvent

Peer event handle obtained by a call to PeerGraphRegisterEvent.

[out] ppEventData

Receives a pointer to a PEER_GRAPH_EVENT_DATA structure that contains the data about an event notification. When this structure is not needed, free it by calling PeerGraphFreeData.

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_S_NO_EVENT_DATA
The function call succeeds, but there is no data associated with a peer event.
PEER_E_NOT_INITIALIZED
A peer graph must be initialized with a call to PeerGraphStartup before using this function.

Remarks

Peer event data is returned in a PEER_GRAPH_EVENT_DATA structure. The type of data structure that PEER_GRAPH_EVENT_DATA points to depends on which event is triggered.

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_GRAPH_EVENT_DATA

PeerGraphFreeData

PeerGraphRegisterEvent

PeerGraphUnregisterEvent