Hi all,
I've read MSDN 's docs on Winsock 2 but ca'nt figure why the API : GetAddrInfoW
never wants to resolve the host always returning ERRORCODE : 11001 <- host-name not found in database
even though the API for getting the value for host-name returned correctly via API : gethostname
// I even tried gethostbyname (MSDN not recommended as host-name) still same result
.data
szHostname db 17 dup (0)
hints addrinfo <0,AF_UNSPEC,SOCK_STREAM,IPPROTO_TCP,0,0,0> ; 7 x dd
hndlResult dd 0
.code
;----init code and WSA setup here
invoke gethostname, addr szHostname, sizeof szHostname
;---returns without error - name of host correct - then later....
invoke GetAddrInfoW, addr szHostname, NULL, addr hints, addr hndlResult
;--- return eax never zero - therefore always fail ? - why ?
MSDN link sample: https://msdn.microsoft.com/en-us/library/windows/desktop/ms738520(v=vs.85).aspx
Thanks
Raistlin
W ::)
szHostname db
OK JJ, even for you that is seriously criptic....
did you mean address too or something else....
as in don't use Unicode. Sorry, very confused....
All *W functions require Unicode strings. Yours is db, b as in BYTE :(
Thanks JJ and Twell - that makes sense - I only used 'W' because the ANSI
version API call does'nt show up in RADASM (among loads of others) - probably need newer includes etc.