PeerPnrpStartResolve function (p2p.h)
The PeerPnrpStartResolve function starts an asynchronous peer name resolution operation.
Syntax
NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerPnrpStartResolve(
[in] PCWSTR pcwzPeerName,
[in, optional] PCWSTR pcwzCloudName,
[in, optional] ULONG cMaxEndpoints,
[in] HANDLE hEvent,
[out] HRESOLUTION *phResolve
);
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, resolution is performed for all clouds. If PEER_PNRP_ALL_LINK_CLOUDS, resolution is performed for all link local clouds. When "GLOBAL_" is specified, resolution takes place in the global cloud.
[in, optional] cMaxEndpoints
The maximum number of endpoints to return for the peer name.
[in] hEvent
Handle to the event signaled when a peer endpoint is resolved for the supplied peer name and are ready for consumption by calling PeerPnrpGetEndpoint. This event is signaled for every endpoint discovered by the PNRP service. If PEER_NO_MORE is returned by a call to PeerPnrpGetEndpoint, then all endpoints have been found for that peer.
[out] phResolve
Handle to this peer name resolution request. This handle must be provided to PeerPnrpEndResolve after the resolution events are raised and the endpoints are obtained with corresponding calls to PeerPnrpGetEndpoint, or if the operation fails.
Return value
If the function call succeeds, the return value is S_OK. Otherwise, it returns one of the following values.
Return code | Description |
---|---|
|
One of the parameters is not valid. |
|
There is not enough memory to perform the specified operation. |
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.
A handle must be resolved in a process separate from the process in which it was registered. If a handle is registered and resolved within the same process it will not be recognized.
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 |