mLookupHandle = WSAAsyncGetHostByName(dnsService->mDNSWindow, mMsgID,
PR_Lock(gService->mThreadLock); mLookupHandle = WSAAsyncGetHostByName(gService->mDNSWindow, mMsgID,
nsDNSLookup::InitiateDNSLookup(nsDNSService * dnsService){	nsresult rv = NS_OK;	#if defined(XP_MAC)	OSErr   err;	    err = OTInetStringToAddress(dnsService->mServiceRef, (char *)mHostName, (InetHostInfo *)&mInetHostInfo);    if (err != noErr)        rv = NS_ERROR_UNEXPECTED;#endif /* XP_MAC */#if defined(XP_PC)    mMsgID = gService->AllocMsgID();    if (mMsgID == 0)        return NS_ERROR_UNEXPECTED;    mLookupHandle = WSAAsyncGetHostByName(dnsService->mDNSWindow, mMsgID,                                          mHostName, (char *)&mHostEntry.hostEnt, PR_NETDB_BUF_SIZE);    // check for error conditions    if (mLookupHandle == nsnull) {        rv = NS_ERROR_UNEXPECTED;  // or call WSAGetLastError() for details;		// While we would like to use mLookupHandle to allow for canceling the request in		// the future, there is a bug with winsock2 on win95 that causes WSAAsyncGetHostByName		// to always return the same value.  We have worked around this problem by using the		// msgID to identify which lookup has completed, rather than the handle, however, we		// still need to identify when this is a problem (by comparing the return values of		// the first two calls made to WSAAsyncGetHostByName), to avoid using the handle on		// those systems.  For more info, see bug 23709.    }#endif /* XP_PC */#ifdef XP_UNIX    // temporary SYNC version    PRStatus status = PR_GetHostByName(mHostName, mHostEntry.buffer,                                        PR_NETDB_BUF_SIZE,                                        &(mHostEntry.hostEnt));    if (PR_SUCCESS != status) rv = NS_ERROR_UNKNOWN_HOST;    mResult = rv;    CallOnFound();    delete this;#endif /* XP_UNIX */    return rv;}