Jump to content
Sign in to follow this  
pixartist

Complex Dll Call?

Recommended Posts

nfwu

...

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 )

#)

Share this post


Link to post
Share on other sites
pixartist

...

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)

Share this post


Link to post
Share on other sites
SmOke_N

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.

Share this post


Link to post
Share on other sites
pixartist

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 by pixartist

Share this post


Link to post
Share on other sites
pixartist

$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!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×