Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

PeerPnrpRegister function

The PeerPnrpRegister function registers a peer with a PNRP cloud and returns a handle that can be used for registration updates.

Note  When called, this function will block until the PNRP service has been initiated.

Syntax


HRESULT WINAPI PeerPnrpRegister(
  _In_     PCWSTR                       pcwzPeerName,
  _In_opt_ PPEER_PNRP_REGISTRATION_INFO pRegistrationInfo,
  _Out_    HANDLE                       *phRegistration
);

Parameters

pcwzPeerName [in]

Pointer to a zero-terminated Unicode string that contains the peer name to register with the PNRP service.

pRegistrationInfo [in, optional]

Pointer to a PEER_PNRP_REGISTRATION_INFO structure that contains the endpoint information for the registering peer node. If NULL, the API will register the peer with all known PNRP clouds, and any registered addresses are automatically selected by the infrastructure.

phRegistration [out]

Handle to the PNRP registration for the calling peer node. Use this handle to update the registration or to deregister with the PNRP service.

Return value

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

Return codeDescription
E_INVALIDARG

One of the parameters is not valid.

E_OUTOFMEMORY

There is not enough memory to perform the specified operation.

PEER_E_IDENTITY_NOT_FOUND

The local peer is using an identity that does not exist.

 

Additionally, this function can return WSA values. For a complete list of possible values, see PNRP NSP Error Codes.

Remarks

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

A name cannot be registered with an endpoint more than once. When updates to a registered name are required, use PeerPnrpUpdateRegistration.

When pRegistrationInfo is NULL, or PEER_PNRP_AUTO_ADDRESSES is specified for cAddresses, the infrastructure will keep the addresses registered up to date as addresses change or cloud availability changes.

Requirements

Minimum supported client

Windows XP with SP2 [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Version

Windows XP with SP1 with the Advanced Networking Pack for Windows XP

Header

P2P.h

Library

P2P.lib

DLL

P2P.dll

See also

PeerPnrpUnregister
PeerPnrpUpdateRegistration

 

 

Community Additions

ADD
Show:
© 2015 Microsoft