The PeerPnrpRegister function registers a peer with a PNRP cloud and returns a handle that can be used for registration updates.
Syntax
HRESULT WINAPI PeerPnrpRegister(
__in PCWSTR pcwzPeerName,
__in_opt PPEER_PNRP_REGISTRATION_INFO pRegistrationInfo,
__out HANDLE* phRegistration
);
Parameters
- pcwzPeerName
-
Pointer to a zero-terminated Unicode string that contains the peer name to register with the PNRP service.
- pRegistrationInfo
-
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
-
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 code | Description |
| E_INVALIDARG | One of the parameters is not valid. |
| E_OUTOFMEMORY | There is not enough memory to perform the specified operation. |
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
| Client | Requires Windows XP SP2 or Windows Vista. |
| Server | Requires Windows Server 2008, Windows Server 2008, or Windows Server 2008. |
| Version | Requires Windows XP SP1 with the Advanced Networking Pack for Windows XP. |
| Header | Declared in P2P.h. |
| Library | Use P2P.lib. |
| DLL | Requires P2P.dll. |
See Also
PeerPnrpUnregister
PeerPnrpUpdateRegistration
Send comments about this topic to Microsoft
Build date: 2/28/2008