PeerPnrpResolve function (p2p.h)

The PeerPnrpResolve function obtains the endpoint address(es) registered for a specific peer name.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerPnrpResolve(
  [in]           PCWSTR                   pcwzPeerName,
  [in, optional] PCWSTR                   pcwzCloudName,
  [in, out]      ULONG                    *pcEndpoints,
  [out]          PPEER_PNRP_ENDPOINT_INFO *ppEndpoints
);

Parameters

[in] pcwzPeerName

Pointer to a zero-terminated string that contains the peer name for which endpoint addresses will be obtained.

[in, optional] pcwzCloudName

Pointer to a zero-terminated string that contains the name of the PNRP cloud under which to resolve the peer name. If NULL, the resolve is performed in all clouds. If PEER_PNRP_ALL_LINK_CLOUDS, the resolve is performed in all link local clouds. When "GLOBAL_", resolve will only take place in the global cloud.

[in, out] pcEndpoints

The maximum number of endpoints to return in ppEndpoints. Upon return, this parameter contains the actual number of endpoints in ppEndpoints.

[out] ppEndpoints

Pointer to a list of PEER_PNRP_ENDPOINT_INFO structures that contain the endpoints for which the peer name successfully resolved. Each endpoint contains one or more IP addresses at which the peer node can be reached.

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.

Remarks

This call is synchronous and will block until completed. For asynchronous peer name resolution, call PeerPnrpStartResolve and obtain the resolved endpoint address when the supplied event is raised.

A handle must be resolved in a process separate of the process it was registered in. If a handle is registered and resolved within the same process it will not be recognized.

When resolution is performed for all clouds, it is issued to each cloud simultaneously. The method will return as soon as it has received enough results from any combination of clouds.

The default resolve timeout used internally by this method is 30 seconds. If a specific timeout is required,the asynchronous PeerPnrpStartResolve function should be used.

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

See also

PeerPnrpStartResolve