Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 2.31 KB

gethostbyaddr-function-in-the-api-2.md

File metadata and controls

37 lines (24 loc) · 2.31 KB
description ms.assetid title ms.topic ms.date
The gethostbyaddr function uses the WSALookupServiceBegin function to query SVCID\_INET\_HOSTNAMEBYADDR as the service class GUID.
9b1e3f3f-bfc0-4099-b699-af56019055e6
gethostbyaddr Function in the API
article
05/31/2018

gethostbyaddr Function in the API

The gethostbyaddr function uses the WSALookupServiceBegin function to query SVCID_INET_HOSTNAMEBYADDR as the service class GUID. The host address is supplied as a dotted decimnal IPv4 string (for example, "192.9.200.120") in the lpszServiceInstanceName member of the WSAQUERYSET structure passed to the WSALookupServiceBegin function. The Ws2_32.dll specifies LUP_RETURN_BLOB and the name service provider places a HOSTENT structure in the blob (using offsets instead of pointers as described above). Name service providers should honor these other LUP_RETURN_* flags as well.

Flag Description
LUP_RETURN_NAME Returns the h_name member from HOSTENT structure in lpszServiceInstanceName.
LUP_RETURN_ADDR Returns addressing information from HOSTENT in CSADDR_INFO structures, port information is defaulted to zero.

 

Related topics

Compatible Name Resolution for TCP/IP in the Windows Sockets 1.1 API

Protocol-Independent Name Resolution

Registration and Name Resolution