pixartist Posted April 6, 2006 Posted April 6, 2006 i'd like to call this function http://www.winpcap.org/docs/docs31/html/gr...pfunc.html#ga55from autoit, but i have no idea how to create the needed structs and datatypes in autoit!help me please !thx
nfwu Posted April 6, 2006 Posted April 6, 2006 ... A simple call in my point of view $auth = DLLStructCreate("int;char[100];char[100]") $alldevs = DLLStructCreate("ptr", DLLStructGetPtr(DLLStructCreate("ptr;char[100];char[100];ptr;uint"))) DLLCall("name_of_dll", "int", "pcap_findalldevs_ex", "str", $source, "ptr", DLLStructGetPtr($auth), "ptr", DLLStructGetPtr($alldevs), "str", $errorbuff ) #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode()
pixartist Posted April 6, 2006 Author Posted April 6, 2006 ... A simple call in my point of view $auth = DLLStructCreate("int;char[100];char[100]") $alldevs = DLLStructCreate("ptr", DLLStructGetPtr(DLLStructCreate("ptr;char[100];char[100];ptr;uint"))) DLLCall("name_of_dll", "int", "pcap_findalldevs_ex", "str", $source, "ptr", DLLStructGetPtr($auth), "ptr", DLLStructGetPtr($alldevs), "str", $errorbuff ) #)im using the new beta.. C:\Dokumente und Einstellungen\FFS\Desktop\AU3scripts\pcap.au3(3,50) : ERROR: DLLStructCreate(): undefined function. $auth = DLLStructCreate("int;char[100];char[100]") ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Dokumente und Einstellungen\FFS\Desktop\AU3scripts\pcap.au3(4,102) : ERROR: DLLStructGetPtr(): undefined function. $alldevs = DLLStructCreate("ptr", DLLStructGetPtr(DLLStructCreate("ptr;char[100];char[100];ptr;uint")) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~^ C:\Dokumente und Einstellungen\FFS\Desktop\AU3scripts\pcap.au3 - 2 error(s), 0 warning(s)
Moderators SmOke_N Posted April 6, 2006 Moderators Posted April 6, 2006 Doesn't look like your using Beta... make sure if your using SciTe your using Alt+F5 to run it. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
pixartist Posted April 7, 2006 Author Posted April 7, 2006 (edited) Doesn't look like your using Beta... make sure if your using SciTe your using Alt+F5 to run it.thx, that works now .. but when i create a struct like this DLLStructCreate("ptr", DLLStructGetPtr(DLLStructCreate("ptr;char[100];char[100];ptr;uint"))) how do i access the "ptr;char[100];char[100];ptr;uint" stuff? so how do i get the data of the object referenced by the pointer? this does not work : $source = "rpcap://"; $err = ""; $auth = DLLStructCreate("int;char[100];char[100]") $devs = DLLStructCreate("ptr;char[100];char[100];ptr;uint") $alldevs = DLLStructCreate("ptr", DLLStructGetPtr($devs)) DLLCall("wpcap.dll", "int", "pcap_findalldevs_ex", "str", $source, "ptr", DLLStructGetPtr($auth), "ptr", DLLStructGetPtr($alldevs), "str", $err ) MsgBox(0,$err, DllStructGetData ( $devs, 3)) Edited April 7, 2006 by pixartist
pixartist Posted April 7, 2006 Author Posted April 7, 2006 $source = "rpcap://"; $err = ""; $auth = DLLStructCreate("int;char[100];char[100]") $devs = DLLStructCreate("ptr;char[100];char[100];ptr;uint") $alldevs = DLLStructCreate("ptr", DLLStructGetPtr($devs)) DLLCall("wpcap.dll", "int", "pcap_findalldevs_ex", "str", $source, "ptr", DLLStructGetPtr($auth), "ptr", DLLStructGetPtr($alldevs), "str", $err ) $name = DllStructGetData ( $devs, 3) MsgBox(0,$err, $name) well, as DllStructGetData ( $devs, 3) is a char[100] it should return as a string...but the message box just displays nothing!
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