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.
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.
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...
Only for simple data types. Sth. like
struct TheHellOfALotData {
// content goes here
};
int foo ( TheHellOfALotData*);
it'll come up with 'a pointer' at best...
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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your time.
>>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 :-(