Subject: | Using of prototypes causes perl to crash |
The 2-parameter version of Import/new fails, but the 4-parameter version of Import/new succeeds. If I patch API.pm to not set $self->{proto} to 1, then the 2-parameter version of Import/new seems to work exactly like the 4-parameter version for my purposes. I don't think this is the appropriate fix, but I don't understand perlguts well enough to debug API.xs.
Here's the 2-parameter test that crashes:
C:\> perl -we "use Win32::API;my $gfp = ' 'x5000; use strict; Win32::API->Import('shell32.dll', 'int SHGetFolderPath(int hwndOwner,int nFolder,int nToken,int dwFlags,LPTSTR pszPath)'); SHGetFolderPath(0,5,0,0,$gfp);$gfp =~ s/\0.*$//;print $gfp"
And the corresponding 4-parameter test that works fine:
C:\> perl -we "use Win32::API;my $gfp = ' 'x5000; use strict; Win32::API->Import('shell32.dll', 'SHGetFolderPath','NINNP','N'); SHGetFolderPath(0,5,0,0,$gfp);$gfp =~ s/\0.*$//;print $gfp"
Other potentially useful information:
Dell D810 laptop running Windows XP SP2
ActiveState Perl v5.8.4
Binary build 810 provided by ActiveState Corp. http://www.ActiveState.com
ActiveState is a division of Sophos.
Built Jun 1 2004 11:52:21