MuffettsMan Posted January 3, 2008 Posted January 3, 2008 Tryng to learn more about tcp / socket connections the example functions (TCPRecv TCPSend) in the help file work perfectly in 2k however when testing the server on a vista box errors out: Line 80 (File "c:\example_server.au3"): Local $aRet = DLLCall("Ws2_32.dll","int","getpeername","int",$SHOCKET,"ptr",DLLStructGetPtr($sockaddr),"int_ptr",DLLStructGetSize($sockaddr)) Error: "long_ptr", "int_ptr" and "short_ptr: DllCall() types have been deprecated. Use "long*", "int*" and "short*" instead. then crashes.. >.< the function where line 80 is in the example TCPRecv script is: ; Function to return IP Address from a connected socket. ;---------------------------------------------------------------------- Func SocketToIP($SHOCKET) Local $sockaddr = DLLStructCreate("short;ushort;uint;char[8]") Local $aRet = DLLCall("Ws2_32.dll","int","getpeername","int",$SHOCKET, _ "ptr",DLLStructGetPtr($sockaddr),"int_ptr",DLLStructGetSize($sockaddr)) If Not @error And $aRet[0] = 0 Then $aRet = DLLCall("Ws2_32.dll","str","inet_ntoa","int",DLLStructGetData($sockaddr,3)) If Not @error Then $aRet = $aRet[0] Else $aRet = 0 EndIf $sockaddr = 0 Return $aRet EndFunc can you simply replace the dll file ehh modify that function to work with vista's version accordingly lol or reinstall xp >.< Don't let that status fool you, I am no advanced memeber!
MuffettsMan Posted January 4, 2008 Author Posted January 4, 2008 for sanity sake i did test the server (TCPRecv Example) on xp and client (TCPSend Example) on vista and that sends fine which again makes me think that its a difference in the dll's... vista reports: Ws2_32.dll 174kb version: 6.0.6000.16386 xp: 81kb version: 5.1.2600.2180 (xpsp_sp2..... Don't let that status fool you, I am no advanced memeber!
GaryFrost Posted January 4, 2008 Posted January 4, 2008 look in the help file of 3.2.10.0 at dllcall long_ptr needs to be changed to long* and the others respectively This has already been done for the next version for when that is released. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
MuffettsMan Posted January 4, 2008 Author Posted January 4, 2008 wow thanks so soo simple i overlooked the obvious... line 81 is now: "ptr",DLLStructGetPtr($sockaddr),"int*",DLLStructGetSize($sockaddr)) and it works that int_ptr is the only place i could find anything ptr in the func and it now seems to work without error now to disect and abuse it! thx again Don't let that status fool you, I am no advanced memeber!
AdamusTorK Posted January 19, 2008 Posted January 19, 2008 (edited) Hi, I'm new for this (known AutoIt for years but still learning), can anyone help me with a quick dll reading to check Ws2_32.dll's version beacuse I wouldn't really write my code twice, one for Vista one for XP. Or if you have any other idea, please help. Thanks .... /me nub ... what is filegetversion thingie Edited January 19, 2008 by AdamusTorK [quote name='PsaltyDS']so what is your ilegitimate purpose here?[/quote]
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