PeerPnrpGetEndpoint function (p2p.h)

The PeerPnrpGetEndpoint function retrieves a peer endpoint address resolved during an asynchronous peer name resolution operation.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerPnrpGetEndpoint(
  HRESOLUTION              hResolve,
  PPEER_PNRP_ENDPOINT_INFO *ppEndpoint
);

Parameters

hResolve

The handle to the asynchronous peer name resolution operation returned by a previous call to PeerPnrpStartResolve.

ppEndpoint

Pointer to the address of a PEER_PNRP_ENDPOINT_INFO structure that contains an endpoint address for the peer name supplied in the previous call to PeerPnrpStartResolve.

This data returned by this parameter must be freed by calling PeerFreeData.

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_NO_MORE
All endpoint addresses have been retrieved for the peer.

Remarks

PeerPnrpStartResolve creates a handle to an asynchronous peer name resolution operation.

Whenever an endpoint is found, the event handle provided in hEvent is signaled, and PeerPnrpGetEndpoint must be called with the phResolve handle by the application to obtain that endpoint.

The last event specifies the PEER_E_NO_MORE error code, indicating that all endpoints corresponding to the peer name supplied to PeerPnrpStartResolve have been found. At this time, the application must close the handle with a call to PeerPnrpEndResolve.

Requirements

   
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 Windows Server 2008 [desktop apps only]
Target Platform Windows
Header p2p.h
Library P2P.lib
DLL P2P.dll

See also

PeerPnrpEndResolve

PeerPnrpStartResolve