Link to home
Start Free TrialLog in
Avatar of PastorDwayne
PastorDwayne

asked on

DLL function parameters

Good-day,

I am attempting to load and run a function from a DLL using LoadLibrary and GetProcAddress.  I am able to find out the name of the functions within the DLL using Dependency Walker; but I am unable to find out the number of parameters and the type of parameters that each functions takes (ie float, UINT…).  How would I find out this info?

Thanks.
Avatar of jkr
jkr
Flag of Germany image

>>but I am unable to find out the number of parameters and the type of parameters
>>that each functions takes (ie float, UINT…).  How would I find out this info?

Without a header file or any kind of documentation, there is hardly any chance to find out what arguments the functions take. Bad luck :-(

Avatar of Member_2_1001466
Member_2_1001466

Depends on whether the DLL as C++ mangled names. But if the function name has C++ mangling dependency walker will show you the function parameters automatically unless you see only the mangled name. Try hitting the C++ button. Otherwise accept jkr comment, no other chance.
>>But if the function name has C++ mangling dependency walker will show you the function parameters

Only for simple data types. Sth. like

struct TheHellOfALotData {

// content goes here

};

int foo ( TheHellOfALotData*);

it'll come up with 'a pointer' at best...
Avatar of PastorDwayne

ASKER

Alright; Assuming one of the parameters is an array, how could this be passed to GetProcAddress? For an UINT I use

typedef UINT (CALLBACK* LPFNDLLFUNC1)(UINT);

What would the typedef be for an array on integers? Would a pointer have to be passed instead?
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for your time.