Aug 30, 2010, 1:16 PM
Post #1 of 1
I'm new to perl. I'm sure I'm just doing something silly. I hope someone will be kind enough to point out what I'm doing wrong.
Perl error when calling native dll
Here's my perl code:
my $reprise = Win32::API->new('rlm', 'rlm_init', 'P', 'N');
my $handle = $reprise->Call('.');
Here is the method I'm trying to call:
extern struct rlm_handle * rlm_init(const char *, const char *,
const char *);
I've tried passing one parameter, two, all three...same output.
When it runs the "Call" line I get an event log entry like this:
Faulting application name: perl.exe, version: 18.104.22.1684, time stamp: 0x48bef0d8
Faulting module name: perl510.dll, version: 22.214.171.1244, time stamp: 0x48bef0d7
Exception code: 0xc0000005
Fault offset: 0x00047daa
Faulting process id: 0xe80
Faulting application start time: 0x01cb487c07ea0010
If I try to debug using Visual Studio it gives me this:
Unhandled exception at 0x28047daa in perl.exe: 0xC0000005: Access violation writing location 0x00000004.
The publisher of the dll I'm calling has never used it from perl and is unable to provide assistance. What am I doing wrong?