Platform SDK: Windows Sockets

gethostbyname Function in the SPI

The WSALookupServiceBegin query uses SVCID_INET_HOSTADDRBYNAME as the service class GUID. The host name is supplied in lpszServiceInstanceName. The Ws2_32.dll specifies LUP_RETURN_BLOB and the NSP places a HOSTENT struct in the blob (using offsets instead of pointers as described above). NSPs 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. Note that this routine does not resolve host names consisting of a dotted internet address.