in reply to c style Win32::API interface

There is a bug in the prototype definition. The quickest solution is to patch the Win32::API module by 'voiding' the custom prototype.

... my $f = Win32::API->new("winmm", "long mciSendString(LPSTR a, LPSTR b, + long c, long d)"); delete $f->{proto}; delete $f->{intypes}; ...

This will force Win32::API to behave the same as
Win32::API->new("winmm", "PPNN", "N");


It is often useful to turn on the internal debugging of Win32::API to work out what is the prototype parser doing. Turn on debugging with $Win32::API::DEBUG = 1;. This shows that in your first prototype, the char * was interpreted as char. Win32::API was not doing a good job at parsing char *. (grin...)