Basic Approach for GetXbyY in the API
Most getXbyY functions are translated by the Ws2_32.dll to a WSALookupServiceBegin, WSALookupServiceNext, and WSALookupServiceEnd sequence that uses one of a set of special GUIDs as the service class. These GUIDs identify the type of getXbyY operation that is being emulated. The query is constrained to those name service providers that support AF_INET. Whenever a getXbyY function returns a HOSTENT or SERVENT structure, the Ws2_32.dll specifies the LUP_RETURN_BLOB flag in WSALookupServiceBegin so that the desired information is returned by the name service provider. These structures must be modified slightly in that the pointers contained within must be replaced with offsets that are relative to the start of the blob's data. All values referenced by these pointer parameters must, of course, be completely contained within the blob, and all strings are ASCII.
Related topics