dv8 Posted November 2, 2006 Share Posted November 2, 2006 I need some help from experienced DllCall user, to call the function gethostbyaddr from Ws2_32.dll.I made this:$test = DllCall("WS2_32.DLL","ptr","gethostbyaddr","string","10.1.128.101","int",4,"int","AF_INET") MsgBox(64,"","Error: "&@error)and I get no error. (@error=0)But the gethostbyaddr function returns a pointer to the hostent structure, and I don't know what to do with it... Please, any suggestions??? Free Remote Desktop Software For Windows Link to comment Share on other sites More sharing options...
arcker Posted November 2, 2006 Share Posted November 2, 2006 (edited) mmm try to create the structure by : $rep=dllstructcreate("long;long;long") before to call this dll it seems to be an easy function, and useful will take a look on it, because i need some train ^^ struct HOSTENT* FAR gethostbyaddr( const char* addr, int len, int type ); FYI your not in the support forum here :/ with 93 messages, it's not good Edited November 2, 2006 by arcker -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list] Link to comment Share on other sites More sharing options...
dv8 Posted November 2, 2006 Author Share Posted November 2, 2006 FYI your not in the support forum here :/with 93 messages, it's not goodOOPS...You are absolutely right. :"> I'm sorry, this is my mistake. I just didn't pay attention... :">To any moderator, please move thist topic to "V3 Support"I apologise again. Free Remote Desktop Software For Windows Link to comment Share on other sites More sharing options...
arcker Posted November 2, 2006 Share Posted November 2, 2006 (edited) so, did you try to create the structure before to call the function if you want some more help, look at the functions of paulIA : AutoIT3Lib edit : oups,your problems are over ^^ Edited November 2, 2006 by arcker -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list] Link to comment Share on other sites More sharing options...
dv8 Posted November 3, 2006 Author Share Posted November 3, 2006 Larry, please be more specific. I tried to find this function in the helpfiles, with no luck. I serched the forums and still no luck. so, did you try to create the structure before to call the function if you want some more help, look at the functions of paulIA : AutoIT3Lib edit : oups,your problems are over ^^ I tried this: $Hostent = DllStructCreate("char;char;short;short;char") MsgBox(0,"StructCreateError:",@error) $Test = DllStructGetSize($Hostent) MsgBox(0,"StructSize:",$Test) $pHostent = DllStructGetPtr($Hostent) MsgBox(0,"GetPtrError:",@error) $pHostent = DllCall("WS2_32.DLL","ptr","gethostbyaddr","string","10.1.128.108","int",4,"int","AF_INET") MsgBox(0,"DllCallError:",@error) $Test = DllStructGetSize($Hostent) MsgBox(0,"StructSize:",$Test) $Test1 = DllStructGetData($Hostent,1) MsgBox(0,"GetData1",$Test1) $Test1 = DllStructGetData($Hostent,2) MsgBox(0,"GetData2",$Test1) $Test1 = DllStructGetData($Hostent,3) MsgBox(0,"GetData3",$Test1) $Test1 = DllStructGetData($Hostent,4) MsgBox(0,"GetData4",$Test1) $Test1 = DllStructGetData($Hostent,5) MsgBox(0,"GetData5",$Test1) But it still doesn't work. Free Remote Desktop Software For Windows Link to comment Share on other sites More sharing options...
cppman Posted November 3, 2006 Share Posted November 3, 2006 (edited) I Think your going to need to write a wrapper for that in C++, because the actual return value of that function is a structure. LPSTR DLL_EXPORT GETHOSTADDRESS(LPSTR Address) { HOSTENT* MyInfo = gethostbyaddr(Address, sizeof(Address), AF_INET); return (LPSTR)MyInfo->h_name; } maybe something like that.... Edited November 3, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
The Kandie Man Posted November 3, 2006 Share Posted November 3, 2006 Larry, please be more specific. I tried to find this function in the helpfiles, with no luck. I serched the forums and still no luck. I tried this: $Hostent = DllStructCreate("char;char;short;short;char") MsgBox(0,"StructCreateError:",@error) $Test = DllStructGetSize($Hostent) MsgBox(0,"StructSize:",$Test) $pHostent = DllStructGetPtr($Hostent) MsgBox(0,"GetPtrError:",@error) $pHostent = DllCall("WS2_32.DLL","ptr","gethostbyaddr","string","10.1.128.108","int",4,"int","AF_INET") MsgBox(0,"DllCallError:",@error) $Test = DllStructGetSize($Hostent) MsgBox(0,"StructSize:",$Test) $Test1 = DllStructGetData($Hostent,1) MsgBox(0,"GetData1",$Test1) $Test1 = DllStructGetData($Hostent,2) MsgBox(0,"GetData2",$Test1) $Test1 = DllStructGetData($Hostent,3) MsgBox(0,"GetData3",$Test1) $Test1 = DllStructGetData($Hostent,4) MsgBox(0,"GetData4",$Test1) $Test1 = DllStructGetData($Hostent,5) MsgBox(0,"GetData5",$Test1) But it still doesn't work. I believe Larry meant TCPNameToIP(). Not sure though. "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
dv8 Posted November 7, 2006 Author Share Posted November 7, 2006 arcker, did you try anything about this function?I couldn't make it run properly.I need it for my program VNC Control. Now I'm using NBTSTAT.EXE and parsing the output, but it does not work properly on some computers.That's why I need this funcion.Please, anyone, any ideas? Free Remote Desktop Software For Windows Link to comment Share on other sites More sharing options...
Bucione Posted November 7, 2006 Share Posted November 7, 2006 arcker, did you try anything about this function?I couldn't make it run properly.I need it for my program VNC Control. Now I'm using NBTSTAT.EXE and parsing the output, but it does not work properly on some computers.That's why I need this funcion.Please, anyone, any ideas?Have you tried to parse the output from nslookup.exe? You will need a properly configured reverse DNS zone for the IP ranges you are trying to query. ---------Arthur B Link to comment Share on other sites More sharing options...
dv8 Posted November 8, 2006 Author Share Posted November 8, 2006 Have you tried to parse the output from nslookup.exe? You will need a properly configured reverse DNS zone for the IP ranges you are trying to query.I don't want to parse anything. I don't wand to be dependent on other programs. That's why I'm trying to do it using DLLCALL. Free Remote Desktop Software For Windows Link to comment Share on other sites More sharing options...
dv8 Posted November 16, 2006 Author Share Posted November 16, 2006 I still need help on this PLS. Free Remote Desktop Software For Windows Link to comment Share on other sites More sharing options...
/dev/null Posted November 16, 2006 Share Posted November 16, 2006 I still need help on this PLS. did you even try to use the search function of the forum???? Searching for gethostbyaddr gave me this:http://www.autoitscript.com/forum/index.ph...st&p=267014CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
dv8 Posted November 17, 2006 Author Share Posted November 17, 2006 did you even try to use the search function of the forum???? Searching for gethostbyaddr gave me this:http://www.autoitscript.com/forum/index.ph...st&p=267014CheersKurtI tryed, but this post wasn't there when I first started this topic... :"> Thank you for pointing it out!!!I think this will solve my problem. Free Remote Desktop Software For Windows Link to comment Share on other sites More sharing options...
/dev/null Posted November 17, 2006 Share Posted November 17, 2006 I tryed, but this post wasn't there when I first started this topic... :"> Thank you for pointing it out!!!I think this will solve my problem. never mind, maybe piccaso was inspired by your request....CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now