I have a win32 dll built using _cdecl calling convention which exported one function as :
extern __declspec(dllexport) char* myfunc(char* param1, char* param2, char* param3, int param4, int param5)
I am calling this function from perl script like this:
sub call_dll {
.....
....
my $api = Win32::API->new( 'my.dll', 'myfunc', 'PPPII', 'P', '_cdecl' );
my $return = $api->Call( $param1, $param2, $param3, $param4, $param5);
....
}
This call is working fine and I am successfully getting return value.
Now, when I am trying to call this "call_dll" function in a perl mutithreaded implementation,the script crashes every time.
I am using active perl 5.16 on Windows7
What can be the reason for this crash? Can't we use win32::api for a threaded implementation?