int xsPalHandleGetAddrByName(UINT message, WPARAM wParam, LPARAM lParam) { int tagId = message - WM_XS_RESOLVE_MSG; DWORD dwError, dwBufLen; xsResolveTag *tag; struct hostent *he; xsSysEvent evt; dwError = WSAGETASYNCERROR(lParam); dwBufLen = WSAGETASYNCBUFLEN(lParam); tag = &g_xsResolveTags[tagId]; he = (struct hostent *)tag->buf; if (dwError == 0) { memcpy(evt.data.resolve.addr.addr.b, he->h_addr_list[0], 4); evt.data.resolve.success = XS_TRUE; } else { evt.data.resolve.addr.addr.n = -1; evt.data.resolve.success = XS_FALSE; } xsFreeNative(tag->buf); evt.type = XS_EVT_RESOLVE; evt.data.resolve.tag = tagId; xsSysEventHandler(&evt); return 0; }
LRESULT COptionTab10::ProxySearch(int id,WPARAM wParam,LPARAM lParam) { int errcode=WSAGETASYNCERROR(lParam); int bufflen=WSAGETASYNCBUFLEN(lParam); if ((id>=0) && (id<10)) { if (!errcode) { //HOSTENT* host=(HOSTENT*) ProxyDetectBuff[id]; //if (host->h_name) { m_ctl_prox.AddString(ProxyDetectName[id]); //} } } return 0; }