PeerNameToPeerHostName function

The PeerNameToPeerHostName function encodes the supplied peer name as a format that can be used with a subsequent call to the getaddrinfo Windows Sockets function.

Syntax


HRESULT WINAPI PeerNameToPeerHostName(
  _In_  PCWSTR pwzPeerName,
  _Out_ PWSTR  *ppwzHostName
);

Parameters

pwzPeerName [in]

Pointer to a zero-terminated Unicode string that contains the peer name to encode as a host name.

ppwzHostName [out]

Pointer to the address of the zero-terminated Unicode string that contains the encoded host name. This string can be passed to getaddrinfo_v2 to obtain network information about the peer.

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.

 

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

PeerHostNameToPeerName

 

 

Community Additions

ADD
Show: