Archive: call dll function


call dll function
hello guys,

at the moment I make a script that installs special drivers and I want to call a DLL-function, which gives me some information about the driver.

In a C++ Header file the function is defined like this:

...
// typedefs
typedef struct
{
unsigned long Version;
unsigned char DevCount;
unsigned char DevIndexes[7];
} StructDriverInfo;

//functions
int GPxi3216_GetDriverInfo(StructDriverInfo* DriverInfo);
...

Now I want the information about the <Version>. But I don't know the way to call that function right, because there is a struct defintion.
I do this in such a way, because there is no other way to get the version information by the NSIS-function "GetDLLVersion '*.sys/*.dll'" etc.

I tried something like that:

...
System::Call '$TEMP\driverA.dll::driverA_GetDriverInfo(*i .r0) i .r1'
DetailPrint '$0 / $1' ;content of $0 should be 1.22.1.0 or 12210 or ...
...

But I have never called before a function with <struct> definition.
Or is there no way to do that?
I'm thankful for every help.

bye shavo


try this:

System::Call "*(i,c,c)i.r0"
System::Call "$TEMP\driverA.dll::driverA_GetDriverInfo(i r0)i.r1"
DetailPrint "*$0(i .r1, c .n, c .n)"
System::Free $0


it works, but the content of $0 is wrong. i will take this as a basic. please tell me if someone has an other idea.
thx commander.

shavo


nooo, $0 contains only rhe pointer to the structure.
$1 should contain your value.