Mon Nov 25 11:31:32 2013: Request 90597 was acted upon. Transaction: Correspondence added by eduard1...@gmail.com Queue: Win32-API Subject: Re: [rt.cpan.org #90597] module Win::API (0.75) installation failed Broken in: (no value) Severity: (no value) Owner: Nobody Requestors: eduard1...@gmail.com Status: patched Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=90597 >
Hi, new() returns undef example of the C prototype: *int JtagWriteReg(unsigned long uiRegister, unsigned long ulValue ) * We're using the module Win32::API with 64-bit windows, but with 32-bit Cygwin. It works perfect On Mon, Nov 25, 2013 at 6:09 PM, Daniel Dragan via RT < bug-win32-...@rt.cpan.org> wrote: > <URL: https://rt.cpan.org/Ticket/Display.html?id=90597 > > > On Mon Nov 25 04:29:47 2013, eduard1...@gmail.com wrote: > > I downloaded the updated version of the the Win32::Api module. All > > tests > > are passed. But I faced other problem. This fragment of the perl code > > does > > not work now: > > > > *$jtagConnect = new Win32::API('jtagvsdll', 'jtagConnect','I', 'I', > > '_cdecl');* > > *$jtagDisConnect = new Win32::API('jtagvsdll', 'jtagDisConnect','', > > 'V');#, > > '_cdecl'* > > *$JtagReadMem = new Win32::API('jtagvsdll', 'JtagReadMem','NNP','I', > > '_cdecl');* > > *$JtagWriteMem = new Win32::API('jtagvsdll', 'JtagWriteMem','NNP','I', > > '_cdecl');* > > *$JtagWriteReg = new Win32::API('jtagvsdll', 'JtagWriteReg','NN','I', > > '_cdecl' );* > > *$JtagReadReg = new Win32::API('jtagvsdll', 'JtagReadReg','N','N', > > '_cdecl' > > );* > > *$JtagRun = new Win32::API('jtagvsdll', 'JtagRun', '', '', '_cdecl' > > );* > > *$JtagStep = new Win32::API('jtagvsdll', 'JtagStep', '', '', '_cdecl' > > );* > > > > But it works perfect in the Cygwin 32-bit environment , with your > > module > > (releases 72,73,74,75). > > What are the C prototypes from headers of those functions? What are > precise symptoms of "does not work"? new() returns undef? Crash? C function > returns failure value (false or non-zero error code)? > > Common mistakes are, loading 32 bit DLL into 64 bit process (forbidden by > windows), improper pack()ing of structs or machine values for 'P' letter, > 'I' (32 bit always) instead of 'N' (32 or 64 bit, AKA pointer size), 'N' > instead of 'I' (high 32 bits are not zero). _cdecl has no effect on 64 bit > os, because 64 bit Windows has 1 calling convention. Visual C treats all > the different 32 bit calling convention as the 1 and only 64 bit calling > convention. > -- Best regards, Eduard