Skip Menu |

This queue is for tickets about the Win32-API CPAN distribution.

Report information
The Basics
Id: 55660
Status: resolved
Worked: 3 hours (180 min)
Priority: 0/
Queue: Win32-API

People
Owner: BULKDD [...] cpan.org
Requestors: RIVY [...] cpan.org
SBennett [...] accelrys.com
steven.bauer [...] amd.com
Cc: KENTNL [...] cpan.org
kmx [...] cpan.org
ROBINS [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)

Attachments


Subject: Version of Win32::API for 64-bit Windows
Date: Thu, 22 Jan 2009 13:17:38 -0600
To: <bug-Win32-API [...] rt.cpan.org>
From: "Bauer, Steven" <steven.bauer [...] amd.com>
Download image001.gif
image/gif 8.8k
image001.gif
My apologies if this is the wrong forum for posting this request. Please let me know if there's a more appropriate forum. We have a variety of perl programs running under Activestate Perl for 32-bit Windows. We want to move our code base to 64-bit Perl to run on 64-bit Windows. Win32::API is not available in the 64-bit environment form either ActiveState or CPAN from what we can see. We've tried compiling in the 64-bit environment and the inline assembly in API.xs will not compile because the MS 64 bit compiler will not support inline assembly. Have you worked on a 64-bit port of this module? Steven Bauer Client Analysis Senior Software Engineer; Performance CoE 7171 Southwest Pkwy., M/S B400.1B Austin, TX 78735 T (512) 602-3155
Hi Steven, thanks for contacting me. Yes, that's true. There is still no version ready for 64-bit. The "plan" is to add support for 64-bit architecture but the problem is that I don't have access to a x64 XP/Vista machine and I don't have a license for the 64-bit MSVC compiler. All the development work for Win32::API is done on my own laptop...
Cosimo, "Commencing this month (12-2008), Microsoft will be providing every CPAN author with free access to a centrally-hosted virtual machine environment containing every major version of Windows." For more info "http://use.perl.org/~Alias/journal/38036". Giuseppe "Jr." On Thu Jan 22 18:45:46 2009, COSIMO wrote: Show quoted text
> Hi Steven, > > thanks for contacting me. > Yes, that's true. There is still no version ready for 64-bit. > > The "plan" is to add support for 64-bit architecture but the problem is > that I don't have access to a x64 XP/Vista machine and I don't have a > license for the 64-bit MSVC compiler. > > All the development work for Win32::API is done on my own laptop... >
Subject: RE: [rt.cpan.org #42685] Version of Win32::API for 64-bit Windows
Date: Thu, 22 Jan 2009 20:24:12 -0600
To: <bug-Win32-API [...] rt.cpan.org>
From: "Bauer, Steven" <steven.bauer [...] amd.com>
Giuseppe and Cosimo, I was about to recommend that I think we can work out some kind of arrangement to get the work done via the systems/licenses I have available. I'd be willing to have either myself or one of my team work on getting the 64 bit version working. Steve Show quoted text
-----Original Message----- From: Giuseppe J. C. via RT [mailto:bug-Win32-API@rt.cpan.org] Sent: Thursday, January 22, 2009 8:18 PM To: Bauer, Steven Subject: [rt.cpan.org #42685] Version of Win32::API for 64-bit Windows <URL: https://rt.cpan.org/Ticket/Display.html?id=42685 > Cosimo, "Commencing this month (12-2008), Microsoft will be providing every CPAN author with free access to a centrally-hosted virtual machine environment containing every major version of Windows." For more info "http://use.perl.org/~Alias/journal/38036". Giuseppe "Jr." On Thu Jan 22 18:45:46 2009, COSIMO wrote:
> Hi Steven, > > thanks for contacting me. > Yes, that's true. There is still no version ready for 64-bit. > > The "plan" is to add support for 64-bit architecture but the problem is > that I don't have access to a x64 XP/Vista machine and I don't have a > license for the 64-bit MSVC compiler. > > All the development work for Win32::API is done on my own laptop... >
On Gio. 22 Gen. 2009 23:14:38, steven.bauer@amd.com wrote: Show quoted text
> I was about t
o recommend that I think we can Show quoted text
> work out some kind of arrangement to get the work done via the > systems/licenses I have available.
That would be cool. Can you provide ssh access to a test system? In the meantime, since I knew about Adam's blog post, I mailed him asking for updates. Show quoted text
> I'd be willing to have either > myself or one of my team work on getting the 64 bit version working.
Thanks. I know I will need some help with the 64 bit inline assembly.
Subject: RE: [rt.cpan.org #42685] Version of Win32::API for 64-bit Windows
Date: Sat, 24 Jan 2009 09:59:42 -0600
To: <bug-Win32-API [...] rt.cpan.org>
From: "Bauer, Steven" <steven.bauer [...] amd.com>
I don't know what's available through the developer center, but with cutbacks, etc. It may be limited. I'll look into it on Monday. The point where we decided to contact you is when we learned that the Microsoft 64 bit compiler doesn't support inline assembly. The docmentation says to use intrinsic functions instead. Also, from what I understand, the calling conventions (stack frame, etc) are different for 64 bit routine vs 32 bit. It may not be a straightforward port. The code will need to know if the target is 32 or 64 bit. Sent from my Windows MobileĀ® phone. Show quoted text
-----Original Message----- From: Cosimo Streppone via RT <bug-Win32-API@rt.cpan.org> Sent: Saturday, January 24, 2009 8:39 AM To: steven.bauer@amd.com <steven.bauer@amd.com> Subject: [rt.cpan.org #42685] Version of Win32::API for 64-bit Windows <URL: https://rt.cpan.org/Ticket/Display.html?id=42685 > On Gio. 22 Gen. 2009 23:14:38, steven.bauer@amd.com wrote:
> I was about t
o recommend that I think we can
> work out some kind of arrangement to get the work done via the > systems/licenses I have available.
That would be cool. Can you provide ssh access to a test system? In the meantime, since I knew about Adam's blog post, I mailed him asking for updates.
> I'd be willing to have either > myself or one of my team work on getting the 64 bit version working.
Thanks. I know I will need some help with the 64 bit inline assembly.
Subject: RE: [rt.cpan.org #42685] Version of Win32::API for 64-bit Windows
Date: Mon, 26 Jan 2009 15:23:50 -0600
To: <bug-Win32-API [...] rt.cpan.org>
From: "Bauer, Steven" <steven.bauer [...] amd.com>
Cosmio, I looked at Adam's blog post, and Vista64 isn't on the list, and it looks like a straight testing environment, no development tools. Perhaps I misunderstood. I talked to my manager about the possibility of setting up a machine and the response was, "It's possible, but we don't really want to go through the hassle" Is there a time when you and I as well as Giuseppe could talk via Skype or something like it? Steve Show quoted text
-----Original Message----- From: Cosimo Streppone via RT [mailto:bug-Win32-API@rt.cpan.org] Sent: Saturday, January 24, 2009 8:39 AM To: Bauer, Steven Subject: [rt.cpan.org #42685] Version of Win32::API for 64-bit Windows <URL: https://rt.cpan.org/Ticket/Display.html?id=42685 > On Gio. 22 Gen. 2009 23:14:38, steven.bauer@amd.com wrote:
> I was about t
o recommend that I think we can
> work out some kind of arrangement to get the work done via the > systems/licenses I have available.
That would be cool. Can you provide ssh access to a test system? In the meantime, since I knew about Adam's blog post, I mailed him asking for updates.
> I'd be willing to have either > myself or one of my team work on getting the 64 bit version working.
Thanks. I know I will need some help with the 64 bit inline assembly.
On Lun. 26 Gen. 2009 16:27:19, steven.bauer@amd.com wrote: Show quoted text
> > I looked at Adam's blog post, and Vista64 isn't on the > list, and it looks like a straight testing environment, no development > tools. Perhaps I misunderstood.
I don't think so. I'm in touch with Adam, and he should have a final update on this in a few days. Show quoted text
> I talked to my manager about the > possibility of setting up a machine and the response was, "It's > possible, but we don't really want to go through the hassle"
Mmh... Show quoted text
> Is there a time when you and I as well as Giuseppe could > talk via Skype or something like it?
Sure. I'm sending you details by mail. Cheers,
1) I know Adam has 2003_x64 and 2008_x64 machines in the VM farm. 2) We just hit this when compiling Strawberry-64, FYI. (Linking to this from RT 55336, by the way.) Show quoted text
cpan> install Win32::API
CPAN::SQLite not installed, trying to work without Going to read 'C:\vanilla\cpan\sources\authors\01mailrc.txt.gz' ............................................................................DONE Going to read 'C:\vanilla\cpan\sources\modules\02packages.details.txt.gz' Database was generated on Mon, 08 Mar 2010 05:37:30 GMT ............................................................................DONE Going to read 'C:\vanilla\cpan\sources\modules\03modlist.data.gz' ............................................................................DONE Running install for module 'Win32::API' Running make for C/CO/COSIMO/Win32-API-0.59.tar.gz Checksum for C:\vanilla\cpan\sources\authors\id\C\CO\COSIMO\Win32-API-0.59.tar.gz ok Scanning cache C:\vanilla\cpan\build for sizes ............................................................................DONE CPAN.pm: Going to build C/CO/COSIMO/Win32-API-0.59.tar.gz Checking if your kit is complete... Looks good Writing Makefile for Win32::API::Callback Writing Makefile for Win32::API cp Type.pm blib\lib\Win32/API/Type.pm cp Callback.pm blib\lib\Win32/API/Callback.pm cp Test.pm blib\lib\Win32/API/Test.pm cp Struct.pm blib\lib\Win32/API/Struct.pm cp API.pm blib\lib\Win32/API.pm C:\vanilla\perl\bin\perl.exe C:\vanilla\perl\lib\ExtUtils\xsubpp -typemap C:\vanilla\perl\lib\ExtUtils\typemap Callbac k.xs > Callback.xsc && C:\vanilla\perl\bin\perl.exe -MExtUtils::Command -e "mv" -- Callback.xsc Callback.c gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DWIN64 -DCONSERVATIVE -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPE RL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX -s -O2 -DVERSION=\"0.59\" -DXS_VER SION=\"0.59\" "-IC:\vanilla\perl\lib\CORE" Callback.c Callback.xs: In function 'CallbackMakeStruct': Callback.xs:250: warning: cast from pointer to integer of different size Callback.xs: In function 'CallbackTemplate': Callback.xs:305: warning: cast to pointer from integer of different size Callback.xs:313: warning: cast to pointer from integer of different size Callback.xs: In function 'CallbackCreate': Callback.xs:581: warning: cast from pointer to integer of different size Callback.xs:596: warning: cast from pointer to integer of different size Callback.xs:597: warning: cast from pointer to integer of different size Callback.xs:637: warning: cast from pointer to integer of different size Callback.xs:687: warning: cast from pointer to integer of different size Callback.xs:738: warning: cast from pointer to integer of different size Callback.xs: In function 'XS_Win32__API__Callback_CallbackCreate': Callback.xs:868: warning: cast from pointer to integer of different size Callback.xs: In function 'XS_Win32__API__Callback_PushSelf': Callback.xs:896: warning: cast from pointer to integer of different size Running Mkbootstrap for Win32::API::Callback () C:\vanilla\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 Callback.bs C:\vanilla\perl\bin\perl.exe -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"Win32::API::Callback\", 'DLBASE' => 'Callback', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMP ORTS' => { }, 'DL_VARS' => []);" dlltool --def Callback.def --output-exp dll.exp g++ -o ..\blib\arch\auto\Win32\API\Callback\Callback.dll -Wl,--base-file -Wl,dll.base -mdll -s -L"C:\vanilla\perl\lib\CO RE" -L"C:\vanilla\c\lib" Callback.o -Wl,--image-base,0x21000000 C:\vanilla\perl\lib\CORE\libperl511.a -lmoldname -lkern el32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lw inmm -lversion -lodbc32 -lodbccp32 -lcomctl32 dll.exp dlltool --def Callback.def --base-file dll.base --output-exp dll.exp g++ -o ..\blib\arch\auto\Win32\API\Callback\Callback.dll -mdll -s -L"C:\vanilla\perl\lib\CORE" -L"C:\vanilla\c\lib" Call back.o -Wl,--image-base,0x21000000 C:\vanilla\perl\lib\CORE\libperl511.a -lmoldname -lkernel32 -luser32 -lgdi32 -lwinsp ool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodb ccp32 -lcomctl32 dll.exp C:\vanilla\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 755 ..\blib\arch\auto\Win32\API\Callback\Callback.dll C:\vanilla\perl\bin\perl.exe -MExtUtils::Command -e "cp" -- Callback.bs ..\blib\arch\auto\Win32\API\Callback\Callback.bs C:\vanilla\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 ..\blib\arch\auto\Win32\API\Callback\Callback.bs C:\vanilla\perl\bin\perl.exe C:\vanilla\perl\lib\ExtUtils\xsubpp -typemap C:\vanilla\perl\lib\ExtUtils\typemap -typemap typemap API.xs > API.xsc && C:\vanilla\perl\bin\perl.exe -MExtUtils::Command -e "mv" -- API.xsc API.c gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DWIN64 -DCONSERVATIVE -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPE RL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX -s -O2 -DVERSION=\"0.59\" -DXS_VER SION=\"0.59\" "-IC:\vanilla\perl\lib\CORE" API.c API.xs: In function 'XS_Win32__API_GetProcAddress': API.xs:127: warning: cast from pointer to integer of different size API.xs: In function 'XS_Win32__API_PointerTo': API.xs:206: warning: cast from pointer to integer of different size API.xs: In function 'XS_Win32__API_ReadMemory': API.xs:223: warning: cast to pointer from integer of different size C:\Users\Curtis\AppData\Local\Temp\ccaSXrib.s: Assembler messages: C:\Users\Curtis\AppData\Local\Temp\ccaSXrib.s:3043: Error: suffix or operands invalid for `push' C:\Users\Curtis\AppData\Local\Temp\ccaSXrib.s:3046: Error: suffix or operands invalid for `push' dmake.EXE: Error code 129, while making 'API.o' COSIMO/Win32-API-0.59.tar.gz C:\vanilla\c\bin\dmake.EXE -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Failed during this command: COSIMO/Win32-API-0.59.tar.gz : make NO 3) ActiveState's PPM build farm has hit this, too. http://ppm4.activestate.com/MSWin32-x64/5.10/1000/C/CO/COSIMO/Win32-API-0.59.d/log-20090706T033449.txt
Subject: [PATCH] Partial win64 support for Win32::API
Date: Wed, 17 Mar 2010 14:07:23 +0000
To: "bug-Win32-API [...] rt.cpan.org" <bug-Win32-API [...] rt.cpan.org>
From: Stephen Bennett <SBennett [...] accelrys.com>
The attached three patches (against Win32-API-0.59) implement initial support for 64-bit Windows in Win32-API. I didn't attempt to port Win32::API::Callback. It looks like considerably more effort than Win32::API itself, and as our application doesn't need it I couldn't justify the paid time to spend on it. This is, however, sufficient for Win32::API tests to pass against a 64-bit ActivePerl 5.8.9. At present, only MSVC++ toolchains will work, as its assembly dialect is different from GNU. I don't have a gcc-based build of Perl to work with to port it, but it should only require a straightforward translation of call_asm_x64_msvc.asm into call_asm_x64_gnu.asm. The required changes to Makefile.PL are also somewhat hackish, purely because I don't know of a better way to detect what architecture we're targeting. Accelrys Limited (http://accelrys.com) Registered office: 334 Cambridge Science Park, Cambridge, CB4 0WN, UK Registered in England: 2326316

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

RT-Send-CC: libwin32 [...] perl.org, csjewell [...] cpan.org, adamk [...] cpan.org
Il Mer 17 Mar 2010 10:09:53, SBennett@accelrys.com ha scritto: Show quoted text
> The attached three patches (against Win32-API-0.59) implement initial > support for 64-bit Windows in Win32-API. > > I didn't attempt to > port Win32::API::Callback. It looks like considerably more effort > than Win32::API itself, and as our application doesn't need it I > couldn't justify the paid time to spend on it. This is, however, > sufficient for Win32::API tests to pass against a 64-bit ActivePerl > 5.8.9. > > At present, only MSVC++ toolchains will work, as its > assembly dialect is different from GNU. I don't have a gcc-based > build of Perl to work with to port it, but it should only require a > straightforward translation of call_asm_x64_msvc.asm into > call_asm_x64_gnu.asm. > > The required changes to Makefile.PL are > also somewhat hackish, purely because I don't know of a better way > to detect what architecture we're targeting.
Hi Stephen, fantastic news! Thank you and your company for this. I will try to get things moving by getting this code in and releasing Win32::API 0.60 as-is. Then I can start working on gcc x86-64 support. It will definitely be easier now that you opened the way. Great stuff! -- Cosimo
RT-Send-CC: adamk [...] cpan.org, libwin32 [...] perl.org, csjewell [...] cpan.org
Hi Stephen, thanks for your great work again. I had some CRLF troubles incorporating your patch, but then I switched to a Linux machine and I managed to. The repository on github is updated. http://github.com/cosimo/perl5-win32-api/ This is the commit with all the changes. http://github.com/cosimo/perl5-win32-api/ commit/641b4fefc365e094ab13c6f4d86902eeb71deb77 I haven't tested it yet...
CC: <libwin32 [...] perl.org>, <SBennett [...] accelrys.com>
Subject: Re: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Fri, 2 Apr 2010 16:10:22 +1100
To: <bug-Win32-API [...] rt.cpan.org>
From: "Sisyphus" <sisyphus1 [...] optusnet.com.au>
Show quoted text
----- Original Message ----- From: "Cosimo Streppone via RT" <bug-Win32-API@rt.cpan.org> Cc: <adamk@cpan.org>; <libwin32@perl.org>; <csjewell@cpan.org> Sent: Friday, April 02, 2010 12:05 AM Subject: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
> <URL: https://rt.cpan.org/Ticket/Display.html?id=55660 > > > Hi Stephen, > > thanks for your great work again. > I had some CRLF troubles incorporating your patch, but then I switched > to a Linux machine and I managed to. > > The repository on github is updated. >
I've just done a git clone git://github.com/cosimo/perl5-win32-api.git win32-api and then tried to build Win32::API from those sources on Vista64. I'm running the w64 version of ActivePerl-5.10.1 (build 1007), and I'm using the same compiler that built that ActivePerl (afaik) - namely, the Microsoft Platform SDK for Windows Server 2003 R2. The compiling of API.c terminates with the following: ################################### API.xs(235) : warning C4101: 'words_pushed' : unreferenced local variable ml -c call_asm_x64_msvc.asm 'ml' is not recognized as an internal or external command, operable program or batch file. NMAKE : fatal error U1077: 'ml' : return code '0x1' Stop. ################################### Apparently I need an ml.exe. If I can't get one that works with this compiler, I guess that means I need to use a different compiler. I did try using the one that comes with my 32-bit MSVC++ 7.0, but that leads to numerous errors in call_asm_x64_msvc.asm (that appear to be syntactical). They begin with: ################################### Assembling: call_asm_x64_msvc.asm call_asm_x64_msvc.asm(1) : error A2013: .MODEL must precede this directive call_asm_x64_msvc.asm(4) : error A2034: must be in segment block : Call_x64_real call_asm_x64_msvc.asm(7) : error A2034: must be in segment block call_asm_x64_msvc.asm(8) : error A2034: must be in segment block call_asm_x64_msvc.asm(9) : error A2034: must be in segment block call_asm_x64_msvc.asm(10) : error A2034: must be in segment block call_asm_x64_msvc.asm(12) : error A2034: must be in segment block call_asm_x64_msvc.asm(13) : error A2034: must be in segment block call_asm_x64_msvc.asm(14) : error A2008: syntax error : . etc., etc. ################################### I'll try and get hold of a suitable ml.exe. Cheers, Rob
CC: <libwin32 [...] perl.org>, <SBennett [...] accelrys.com>
Subject: Re: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Fri, 2 Apr 2010 16:42:36 +1100
To: <bug-Win32-API [...] rt.cpan.org>
From: "Sisyphus" <sisyphus1 [...] optusnet.com.au>
Show quoted text
----- Original Message ----- From: "Sisyphus" <sisyphus1@optusnet.com.au>
> > I'll try and get hold of a suitable ml.exe. >
Duh - I already have one. But it's called ml64.exe, not ml.exe. Anyway, renaming ml64.exe to ml.exe (temporarily) allows the build to complete. For me, There are some failing tests (including a couple of segfaults): ############################### Test Summary Report ------------------- t/00_API.t (Wstat: 1280 Tests: 11 Failed: 0) Non-zero exit status: 5 Parse errors: Bad plan. You planned 25 tests but ran 11. t/01_Struct.t (Wstat: 1280 Tests: 5 Failed: 0) Non-zero exit status: 5 Parse errors: Bad plan. You planned 7 tests but ran 5. Files=6, Tests=53, 19 wallclock secs ( 0.17 usr + 0.11 sys = 0.28 CPU) Result: FAIL Failed 2/6 test programs. 0/53 subtests failed. NMAKE : fatal error U1077: 'C:\_64\perl1007\bin\perl.exe' : return code '0xff' Stop. ############################### Is that as anticipated ? Now ... to try and find out why ml.exe is being called, instead of ml64.exe. Cheers, Rob
CC: "libwin32 [...] perl.org" <libwin32 [...] perl.org>
Subject: RE: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Mon, 26 Apr 2010 23:01:06 +0100
To: Sisyphus <sisyphus1 [...] optusnet.com.au>, "bug-Win32-API [...] rt.cpan.org" <bug-Win32-API [...] rt.cpan.org>
From: Stephen Bennett <SBennett [...] accelrys.com>
Apologies for the delayed reply -- I was rather busy at the time and then subsequently just forgot about this. Show quoted text
> ############################### > Test Summary Report > ------------------- > t/00_API.t (Wstat: 1280 Tests: 11 Failed: 0) > Non-zero exit status: 5 > Parse errors: Bad plan. You planned 25 tests but ran 11. > t/01_Struct.t (Wstat: 1280 Tests: 5 Failed: 0) > Non-zero exit status: 5 > Parse errors: Bad plan. You planned 7 tests but ran 5. > Files=6, Tests=53, 19 wallclock secs ( 0.17 usr + 0.11 sys = 0.28 CPU) > Result: FAIL > Failed 2/6 test programs. 0/53 subtests failed. > NMAKE : fatal error U1077: 'C:\_64\perl1007\bin\perl.exe' : return code > '0xff' > Stop. > ############################### > > Is that as anticipated ?
No; the Win32::API tests should pass (and do on my build). Can you find out which tests exactly are failing? That looks somewhat like the testsuite is crashing perl; in which test? Show quoted text
> Now ... to try and find out why ml.exe is being called, instead of ml64.exe.
That sounds like your environment is set up for the 32-bit MSVC++ toolchain, instead of the x64 one. Assuming you're using the vcvars batch file to set up your environment for NMAKE, are you giving it the right arguments for an x64 build? Accelrys Limited (http://accelrys.com) Registered office: 334 Cambridge Science Park, Cambridge, CB4 0WN, UK Registered in England: 2326316
CC: <libwin32 [...] perl.org>
Subject: Re: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Wed, 28 Apr 2010 17:19:51 +1000
To: "Stephen Bennett" <SBennett [...] accelrys.com>, <bug-Win32-API [...] rt.cpan.org>
From: "Sisyphus" <sisyphus1 [...] optusnet.com.au>
Show quoted text
----- Original Message ----- From: "Stephen Bennett" <SBennett@accelrys.com> To: "Sisyphus" <sisyphus1@optusnet.com.au>; <bug-Win32-API@rt.cpan.org> Cc: <libwin32@perl.org> Sent: Tuesday, April 27, 2010 8:01 AM Subject: RE: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
> Apologies for the delayed reply -- I was rather busy at the time and then > subsequently just forgot about this. >
>> ############################### >> Test Summary Report >> ------------------- >> t/00_API.t (Wstat: 1280 Tests: 11 Failed: 0) >> Non-zero exit status: 5 >> Parse errors: Bad plan. You planned 25 tests but ran 11. >> t/01_Struct.t (Wstat: 1280 Tests: 5 Failed: 0) >> Non-zero exit status: 5 >> Parse errors: Bad plan. You planned 7 tests but ran 5. >> Files=6, Tests=53, 19 wallclock secs ( 0.17 usr + 0.11 sys = 0.28 CPU) >> Result: FAIL >> Failed 2/6 test programs. 0/53 subtests failed. >> NMAKE : fatal error U1077: 'C:\_64\perl1007\bin\perl.exe' : return code >> '0xff' >> Stop. >> ############################### >> >> Is that as anticipated ?
> > No; the Win32::API tests should pass (and do on my build). Can you find > out which tests exactly are failing? That looks somewhat like the > testsuite is crashing perl; in which test?
It's test 12 that crashes. When I clear the pop-up the test script aborts - no more tests get run in that script. Here's the output: C:\cygwin\home\Rob\GIT\win32-api>perl -Mblib t/00_API.t 1..25 ok 1 - use Win32::API; ok 2 - use Win32::API::Test; ok 3 - use Win32; ok 4 - loaded # API test dll found at (API_test64.dll) ok 5 - found API test dll ok 6 - GetCurrentProcessId() function found ok 7 - GetCurrentProcessId() result ok ok 8 - GetCurrentProcessId() result ok ok 9 - Import of GetCurrentProcessId() function from kernel32.dll ok 10 - GetCurrentProcessId() result ok ok 11 - sum_integers() function defined It's the '$function->Call(2, 3)' that causes the crash - which I guess means that the dll being accessed ("our own DLL") is not to my compiler's liking.
>
>> Now ... to try and find out why ml.exe is being called, instead of >> ml64.exe.
> > That sounds like your environment is set up for the 32-bit MSVC++ > toolchain, instead of the x64 one. Assuming you're using the vcvars batch > file to set up your environment for NMAKE, are you giving it the right > arguments for an x64 build?
I'm using the Microsoft Platform SDK for Windows Server 2003 R2 compiler (same as ActiveState use to build x64 ActivePerl) and, to set up the environment I run: SetEnv.cmd /XP64 /RETAIL That's the correct thing to do, afaik, and I've been getting good mileage out of it. I notice, however, that 'nmake /P' lists: AS = ml instead of the expected 'AS = ml64' - so, I guess either it's a bug in nmake, or it's an nmake that expects a 32-bit environment. (I've checked, and there's no 'nmake64.exe' or anything like that.) As a fix, I've simply created a copy of ml64.exe named ml.exe in the same folder. (The 32-bit ml.exe is in a folder that's not in my path.) Cheers, Rob
CC: <libwin32 [...] perl.org>
Subject: Re: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Wed, 28 Apr 2010 17:30:43 +1000
To: "Stephen Bennett" <SBennett [...] accelrys.com>, <bug-Win32-API [...] rt.cpan.org>
From: "Sisyphus" <sisyphus1 [...] optusnet.com.au>
Show quoted text
----- Original Message ----- From: "Sisyphus" <sisyphus1@optusnet.com.au>
> which I guess means that the dll being accessed ("our own DLL") is not to > my compiler's liking.
Sorry - just so that there's no doubt, the dll that's being accessed is API_test64.dll (though you probably deduced as much from the test output I posted :-) Cheers, Rob
CC: "libwin32 [...] perl.org" <libwin32 [...] perl.org>
Subject: RE: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Wed, 28 Apr 2010 09:50:34 +0100
To: Sisyphus <sisyphus1 [...] optusnet.com.au>, "bug-Win32-API [...] rt.cpan.org" <bug-Win32-API [...] rt.cpan.org>
From: Stephen Bennett <SBennett [...] accelrys.com>
Show quoted text
> Sorry - just so that there's no doubt, the dll that's being accessed is > API_test64.dll (though you probably deduced as much from the test output I > posted :-)
Is it possible that that DLL got garbled in the passage through patches, RT, etc? I'd try rebuilding it locally, if you can. Accelrys Limited (http://accelrys.com) Registered office: 334 Cambridge Science Park, Cambridge, CB4 0WN, UK Registered in England: 2326316
CC: <libwin32 [...] perl.org>
Subject: Re: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Wed, 28 Apr 2010 19:41:41 +1000
To: "Stephen Bennett" <SBennett [...] accelrys.com>, <bug-Win32-API [...] rt.cpan.org>
From: "Sisyphus" <sisyphus1 [...] optusnet.com.au>
Show quoted text
----- Original Message ----- From: "Stephen Bennett" <SBennett@accelrys.com> To: "Sisyphus" <sisyphus1@optusnet.com.au>; <bug-Win32-API@rt.cpan.org> Cc: <libwin32@perl.org> Sent: Wednesday, April 28, 2010 6:50 PM Subject: RE: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
>> Sorry - just so that there's no doubt, the dll that's being accessed is >> API_test64.dll (though you probably deduced as much from the test output >> I >> posted :-)
> > Is it possible that that DLL got garbled in the passage through patches, > RT, etc? I'd try rebuilding it locally, if you can.
Here are some digest values for that file (which was downloaded from the Win32-API git repo): MD5: e83d79cbbed32588a0d897e829a03726 SHA1: d71457f0dc3ad356241d644ce8bcc479d1cee1b9 SHA256: ba2c3e1966977805c04e0a8a55b0eba6c2b9a4867d567638eca81b0583d9fd2c Is your file the same ? In any case, I'll try to rebuild the API_test64.dll when I get the time - as that will probably fix the problem, irrespective of the cause. (I'll get back when I've tested that out.) Cheers, Rob
On Thu Apr 01 15:05:06 2010, COSIMO wrote: Show quoted text
> This is the commit with all the changes. > > http://github.com/cosimo/perl5-win32-api/ > commit/641b4fefc365e094ab13c6f4d86902eeb71deb77
I have just tested this commit on Strawberry Perl 5.12.0 x64. It fails. I guess it was not expected to work, but I guess it should be mentioned anyway. C:\Users\robin\perl\perl5-win32-api>perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for Win32::API::Callback Writing Makefile for Win32::API C:\Users\robin\perl\perl5-win32-api>dmake cp Type.pm blib\lib\Win32/API/Type.pm cp Callback.pm blib\lib\Win32/API/Callback.pm cp Test.pm blib\lib\Win32/API/Test.pm cp Struct.pm blib\lib\Win32/API/Struct.pm cp API.pm blib\lib\Win32/API.pm C:\Programs\strawberry-perl\perl\bin\perl.exe C:\Programs\strawberry-perl\perl\lib\ExtUtils\xsubpp -typemap C:\Programs\strawberry-perl\perl\lib\ExtUtils\typemap Callback.xs > Callback.xsc && C:\Programs\strawberry-perl\perl\bin\perl.exe -MExtUtils::Command -e "mv" -- Callback.xsc Callback.c gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DWIN64 -DCONSERVATIVE -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX -s -O2 -DVERSION=\"0.60_64\" -DXS_VERSION=\"0.60_64\" "-IC:\Programs\strawberry-perl\perl\lib\CORE" Callback.c Callback.xs: In function 'CallbackMakeStruct': Callback.xs:250: warning: cast from pointer to integer of different size Callback.xs: In function 'CallbackTemplate': Callback.xs:305: warning: cast to pointer from integer of different size Callback.xs:313: warning: cast to pointer from integer of different size Callback.xs: In function 'CallbackCreate': Callback.xs:581: warning: cast from pointer to integer of different size Callback.xs:596: warning: cast from pointer to integer of different size Callback.xs:597: warning: cast from pointer to integer of different size Callback.xs:637: warning: cast from pointer to integer of different size Callback.xs:687: warning: cast from pointer to integer of different size Callback.xs:738: warning: cast from pointer to integer of different size Callback.xs: In function 'XS_Win32__API__Callback_CallbackCreate': Callback.xs:868: warning: cast from pointer to integer of different size Callback.xs: In function 'XS_Win32__API__Callback_PushSelf': Callback.xs:896: warning: cast from pointer to integer of different size Running Mkbootstrap for Win32::API::Callback () C:\Programs\strawberry-perl\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 Callback.bs C:\Programs\strawberry-perl\perl\bin\perl.exe -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"Win32::API::Callback\", 'DLBASE' => 'Callback', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => []);" dlltool --def Callback.def --output-exp dll.exp g++ -o ..\blib\arch\auto\Win32\API\Callback\Callback.dll -Wl,--base-file -Wl,dll.base -mdll -s -L"C:\Programs\strawberry-perl\perl\lib\CORE" -L"C:\Programs\strawberry-perl\c\lib" Callback.o -Wl,--image-base,0x21000000 C:\Programs\strawberry-perl\perl\lib\CORE\libperl511.a -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 dll.exp dlltool --def Callback.def --base-file dll.base --output-exp dll.exp g++ -o ..\blib\arch\auto\Win32\API\Callback\Callback.dll -mdll -s -L"C:\Programs\strawberry-perl\perl\lib\CORE" -L"C:\Programs\strawberry-perl\c\lib" Callback.o -Wl,--image-base,0x21000000 C:\Programs\strawberry-perl\perl\lib\CORE\libperl511.a -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 dll.exp C:\Programs\strawberry-perl\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 755 ..\blib\arch\auto\Win32\API\Callback\Callback.dll C:\Programs\strawberry-perl\perl\bin\perl.exe -MExtUtils::Command -e "cp" -- Callback.bs ..\blib\arch\auto\Win32\API\Callback\Callback.bs C:\Programs\strawberry-perl\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 ..\blib\arch\auto\Win32\API\Callback\Callback.bs C:\Programs\strawberry-perl\perl\bin\perl.exe C:\Programs\strawberry-perl\perl\lib\ExtUtils\xsubpp -typemap C:\Programs\strawberry-perl\perl\lib\ExtUtils\typemap -typemap typemap API.xs > API.xsc && C:\Programs\strawberry-perl\perl\bin\perl.exe -MExtUtils::Command -e "mv" -- API.xsc API.c gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DWIN64 -DCONSERVATIVE -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX -s -O2 -DVERSION=\"0.60_64\" -DXS_VERSION=\"0.60_64\" "-IC:\Programs\strawberry-perl\perl\lib\CORE" API.c In file included from API.xs:47: call_x86_64.h: In function 'Call_asm': call_x86_64.h:53: warning: assignment makes integer from pointer without a cast call_x86_64.h:73: warning: assignment makes integer from pointer without a cast call_x86_64.h:97: warning: assignment makes pointer from integer without a cast API.xs: In function 'XS_Win32__API_GetProcAddress': API.xs:108: warning: cast from pointer to integer of different size API.xs: In function 'XS_Win32__API_PointerTo': API.xs:187: warning: cast from pointer to integer of different size API.xs: In function 'XS_Win32__API_ReadMemory': API.xs:204: warning: cast to pointer from integer of different size Running Mkbootstrap for Win32::API () C:\Programs\strawberry-perl\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 API.bs C:\Programs\strawberry-perl\perl\bin\perl.exe -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"Win32::API\", 'DLBASE' => 'API', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => []);" dlltool --def API.def --output-exp dll.exp g++ -o blib\arch\auto\Win32\API\API.dll -Wl,--base-file -Wl,dll.base -mdll -s -L"C:\Programs\strawberry-perl\perl\lib\CORE" -L"C:\Programs\strawberry-perl\c\lib" API.o call_asm_x64_gnu.o -Wl,--image-base,0x253c0000 C:\Programs\strawberry-perl\perl\lib\CORE\libperl511.a -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 dll.exp g++: call_asm_x64_gnu.o: No such file or directory dmake: Error code 129, while making 'blib\arch\auto\Win32\API\API.dll'
Subject: RE: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Wed, 5 May 2010 11:48:28 +0100
To: "bug-Win32-API [...] rt.cpan.org" <bug-Win32-API [...] rt.cpan.org>
From: Stephen Bennett <SBennett [...] accelrys.com>
Show quoted text
> I have just tested this commit on Strawberry Perl 5.12.0 x64. It fails. > I guess it was not expected to work, but I guess it should be mentioned > anyway.
Quite so. At the time I did this, I couldn't find an x64 Strawberry build anywhere, so I was only able to test with ActivePerl and MSVC compilers. Show quoted text
> g++: call_asm_x64_gnu.o: No such file or directory > dmake: Error code 129, while making 'blib\arch\auto\Win32\API\API.dll'
Since the assembly syntaxes used by Visual Studio's ml64 and GNU's assembler are so different, it's not feasible to have one file that can use both. To fix this, someone will have to write the equivalent Call_x64_real function for GCC to do the same that the MSVC assembly one does. It should be slightly easier, since (IIRC) GCC on x64 still supports inline assembly, where MSVC doesn't. Accelrys Limited (http://accelrys.com) Registered office: 334 Cambridge Science Park, Cambridge, CB4 0WN, UK Registered in England: 2326316
CC: <libwin32 [...] perl.org>
Subject: Re: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Sun, 9 May 2010 22:49:19 +1000
To: "Stephen Bennett" <SBennett [...] accelrys.com>, <bug-Win32-API [...] rt.cpan.org>
From: "Sisyphus" <sisyphus1 [...] optusnet.com.au>
Show quoted text
----- Original Message ----- From: "Sisyphus" <sisyphus1@optusnet.com.au>
> In any case, I'll try to rebuild the API_test64.dll when I get the time - > as that will probably fix the problem, irrespective of the cause. (I'll > get back when I've tested that out.)
Yes, I think that fixes the problem. The only test script that now fails is 01_Struct.t. I built the API_test64.dll manually by running: cl -c API_test.cpp cl /LD API_test.obj API_test.def bufferoverflowU.lib I then renamed the API_test.dll that was produced, to API_test64.dll. For that to work, in API_test.h, I had to first change: #ifdef API_TEST_EXPORTS #define API_TEST_API __declspec(dllexport) #else #define API_TEST_API __declspec(dllimport) #endif to: #ifdef API_TEST_EXPORTS #define API_TEST_API /* __declspec(dllexport) */ #else #define API_TEST_API /* __declspec(dllimport) */ #endif Otherwise, when trying to compile the obj file, I got errors of the type: API_test.cpp(31) : error C2491: 'nAPI_test' : definition of dllimport data not allowed API_test.cpp(33) : error C2491: 'sum_integers' : definition of dllimport function not allowed API_test.cpp(37) : error C2491: 'sum_integers_ref' : definition of dllimport function not allowed [and more similar] I suspect that we need to build the API_test64.dll as part of the Win32::API build procedure (rather than supply a pre-built API_test64.dll). Cheers, Rob
On Sun May 09 08:50:52 2010, sisyphus1@optusnet.com.au wrote: Show quoted text
> > ----- Original Message ----- > From: "Sisyphus" <sisyphus1@optusnet.com.au> >
> > In any case, I'll try to rebuild the API_test64.dll when I get the
> time - > > Yes, I think that fixes the problem. The only test script that now > fails is > 01_Struct.t. > > I built the API_test64.dll manually by running: > > cl -c API_test.cpp > cl /LD API_test.obj API_test.def bufferoverflowU.lib > I then renamed the API_test.dll that was produced, to API_test64.dll.
Excellent. Please send me your API_test64.dll. I'll include it in the distribution. I know that's not optimal, but at least we can move forward. Show quoted text
> For that to work, in API_test.h, I had to first change: > > #ifdef API_TEST_EXPORTS > #define API_TEST_API __declspec(dllexport) > #else > #define API_TEST_API __declspec(dllimport) > #endif > > to: > > #ifdef API_TEST_EXPORTS > #define API_TEST_API /* __declspec(dllexport) */ > #else > #define API_TEST_API /* __declspec(dllimport) */ > #endif > > Otherwise, when trying to compile the obj file, I got errors of the > type: > > API_test.cpp(31) : error C2491: 'nAPI_test' : definition of dllimport > data > not allowed > API_test.cpp(33) : error C2491: 'sum_integers' : definition of > dllimport > function not allowed > API_test.cpp(37) : error C2491: 'sum_integers_ref' : definition of > dllimport > function not allowed > [and more similar]
That's strange. I don't understand. I'm trying to get access to a x64 environment with a working MSVC, to test this. It's not so easy atm. Thanks guys for your contribution on this.
Subject: Re: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Mon, 10 May 2010 22:17:35 +1000
To: <bug-Win32-API [...] rt.cpan.org>, <libwin32 [...] perl.org>
From: "Sisyphus" <sisyphus1 [...] optusnet.com.au>
Show quoted text
----- Original Message ----- From: "Cosimo Streppone via RT" <bug-Win32-API@rt.cpan.org>
> > Please send me your API_test64.dll.
Sure - I'll send it to you offlist. (Anyone else wants one just let me know.)
>> >> Otherwise, when trying to compile the obj file,
(by which I meant that when I ran 'cl -c API_test.cpp')
>> I got errors of the >> type: >> >> API_test.cpp(31) : error C2491: 'nAPI_test' : definition of dllimport >> data >> not allowed >> API_test.cpp(33) : error C2491: 'sum_integers' : definition of >> dllimport >> function not allowed >> API_test.cpp(37) : error C2491: 'sum_integers_ref' : definition of >> dllimport >> function not allowed >> [and more similar]
> > That's strange. I don't understand.
Yes, seems odd to me that the existing source is (apparently) legal for some MS compilers, but not others.
> I'm trying to get access to a x64 environment with a working MSVC, to > test this.
The compiler I'm using (which is the same compiler that ActiveState used to build their x64 perl) is not strictly an MSVC++ compiler - it's the "Microsoft Platform SDK for Windows Server 2003 R2". Jan reckons it's still freely available, and he's probably right. But I can no longer find a link to the damn thing - every link I come up with morphs into a download of "Microsoft Platform SDK for Windows Server 2008", which (I think) is not the same thing. Cheers, Rob
Subject: RE: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Mon, 10 May 2010 09:41:26 -0700
To: "'Sisyphus'" <sisyphus1 [...] optusnet.com.au>, <bug-Win32-API [...] rt.cpan.org>, <libwin32 [...] perl.org>
From: "Jan Dubois" <jand [...] activestate.com>
On Mon, 10 May 2010, Sisyphus wrote: Show quoted text
> The compiler I'm using (which is the same compiler that ActiveState used to > build their x64 perl) is not strictly an MSVC++ compiler - it's the > "Microsoft Platform SDK for Windows Server 2003 R2". > > Jan reckons it's still freely available, and he's probably right. But I can > no longer find a link to the damn thing - every link I come up with morphs > into a download of "Microsoft Platform SDK for Windows Server 2008", which > (I think) is not the same thing.
You are probably always clicking on the DVD/ISO or Web Setup links that follow the "Note: this SDK has been replaced by the Windows Server 2008 SDK" entry. Those do indeed go to the newer SDK. The actual download links are at the very bottom of the original page: ISO image download: http://www.microsoft.com/downloads/details.aspx?FamilyId=E15438AC-60BE-41BD-AA14-7F1E0F19CA0D&displaylang=en Web setup: http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en Full download: http://www.microsoft.com/downloads/details.aspx?FamilyId=484269E2-3B89-47E3-8EB7-1F2BE6D7123A&displaylang=en#filelist Cheers, -Jan
On Mon May 10 08:19:17 2010, sisyphus1@optusnet.com.au wrote: Show quoted text
> ----- Original Message ----- > From: "Cosimo Streppone via RT" <bug-Win32-API@rt.cpan.org> >
> > Please send me your API_test64.dll.
> > Sure - I'll send it to you offlist. (Anyone else wants one just let me > know.)
Thanks to Rob, the 64-bits version of the test library is now available in the Win32::API git repository here: http://github.com/cosimo/perl5-win32-api/blob/master/API_test64.dll -- Cosimo
RT-Send-CC: adamk [...] cpan.org, sisyphus1 [...] optusnet.com.au, csjewell [...] cpan.org
Hi cosimo,

please cosider applying my patch for building Win32::API with 64bit GNU compiler/assembler (e.g. strawberry perl).

Look at: http://github.com/kmx/perl5-win32-api (I have just sent you pull request via github)

With this patch Win32::API builds fine on 64strawberry perl; however there are still 2 failing tests:
t/01_Struct.t - test 5 (perl.exe crashes)
t/03_undef.t - test 3

--
kmx
On Sun Jul 04 16:34:38 2010, KMX wrote: Show quoted text
> please cosider applying my patch for building Win32::API with 64bit > GNU compiler/assembler (e.g. strawberry perl).
Thanks, applied. I really need to get a hold of a 64 bit machine, or I'll never be able to test this...
Subject: RE: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Fri, 9 Jul 2010 09:15:13 +0100
To: "bug-Win32-API [...] rt.cpan.org" <bug-Win32-API [...] rt.cpan.org>
From: Stephen Bennett <SBennett [...] accelrys.com>
Another two patches: First, don't build or test the Callback module on x86_64, since it doesn't work. Second, add support for the DWORD_PTR type, which is different sizes on 32- and 64-bit Windows. A patch I'm about to write for Win32::SystemInfo needs this second change, even if nothing else does. The second patch again includes rebuilt DLLs; somebody may want to check these and see if they suffer from the same mangling that my previous attempt did. Accelrys Limited (http://accelrys.com) Registered office: 334 Cambridge Science Park, Cambridge, CB4 0WN, UK Registered in England: 2326316

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

On Fri Jul 09 05:26:39 2010, SBennett@accelrys.com wrote: Show quoted text
> Another two patches: First, don't build or test the Callback module on > x86_64, since it doesn't work. Second, add support for the DWORD_PTR > type, which is different sizes on 32- and 64-bit Windows.
Hi Stephen, do you have a github account? I just added KMX to the perl5-win32-api repository and I could add you too. I don't want to be a bottleneck for the great work you're doing. http://github.com/cosimo/perl5-win32-api/ I will apply the patches you sent by this week.
Subject: RE: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Fri, 9 Jul 2010 16:00:29 +0100
To: "bug-Win32-API [...] rt.cpan.org" <bug-Win32-API [...] rt.cpan.org>
From: Stephen Bennett <SBennett [...] accelrys.com>
Show quoted text
> Hi Stephen, > > do you have a github account?
I do now -- spb. Accelrys Limited (http://accelrys.com) Registered office: 334 Cambridge Science Park, Cambridge, CB4 0WN, UK Registered in England: 2326316
On Fri Jul 09 11:00:45 2010, SBennett@accelrys.com wrote: Show quoted text
> > Hi Stephen, > > > > do you have a github account?
> > I do now -- spb.
Cool. You and KMX have now full power over http://github.com/cosimo/perl5-win32- api/
RT-Send-CC: SBennett [...] accelrys.com
Hi Stephen,

I have just notice you patches commited to github.

I completely agree with the patch fixing pointer length but as for the changes in Types.pm we have also to fixed the following items which have sizeof(<item>) == 4 on Win32 however sizeof(<item>) == 8 on Win64 (not all of them are technically pointers):

HACCEL HANDLE HBITMAP HBRUSH HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP HENHMETAFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HIMC HINSTANCE HKEY HKL HLOCAL HMENU HMETAFILE HMODULE HPALETTE HPEN HRGN HRSRC HSZ HWINSTA HWND LPARAM LRESULT SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SIZE_T SSIZE_T UINT_PTR WPARAM
We should probably introduce another type "nickname" e.g. _L for 64 bit "long long" (just proposal following your convention "P" vs. "_P")

--
kmx
Subject: RE: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Mon, 12 Jul 2010 16:52:33 +0100
To: "bug-Win32-API [...] rt.cpan.org" <bug-Win32-API [...] rt.cpan.org>
From: Stephen Bennett <SBennett [...] accelrys.com>
Ah yes, I'd forgotten about those. However, I'd suggest they can probably just use the _P name as DWORD_PTR does -- MSDN lists them all as being equivalent either to a HANDLE (hence PVOID) or a *_PTR type (hence pointer sized)[1]. The argument in favour of having separate _P and _L size markers would be future-proofing, but experience suggests there's absolutely no telling what the Win32 API will look like for any possible future architecture, so I'd rather handle the current possibilities in the simplest manner possible. So yes, they're not technically pointers but are all defined as being the same size as a pointer. [1]: http://msdn.microsoft.com/en-us/library/aa383751(VS.85).aspx Accelrys Limited (http://accelrys.com) Registered office: 334 Cambridge Science Park, Cambridge, CB4 0WN, UK Registered in England: 2326316
CC: <KENTNL [...] cpan.org>, <ROBINS [...] cpan.org>, <kmx [...] cpan.org>
Subject: RE: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Mon, 12 Jul 2010 18:03:19 +0200
To: <bug-Win32-API [...] rt.cpan.org>
From: kmx <kmx [...] volny.cz>
Show quoted text
> However, I'd suggest they can probably just use > the _P name as DWORD_PTR does -- MSDN lists them > all as being equivalent either to a HANDLE (hence > PVOID) or a *_PTR type (hence pointer sized)[1]. The > argument in favour of having separate _P and _L size > markers would be future-proofing, but experience > suggests there's absolutely no telling what the Win32 API > will look like for any possible future architecture, so I'd > rather handle the current possibilities in the simplest > manner possible.
OK, I agree. -- kmx So yes, they're not technically pointers but are all defined as being the same size as a pointer. [1]: http://msdn.microsoft.com/en-us/library/aa383751(VS.85).aspx Accelrys Limited (http://accelrys.com) Registered office: 334 Cambridge Science Park, Cambridge, CB4 0WN, UK Registered in England: 2326316
I have just commited some changes to github repo.

Now the only failing test seems to be t/03_undef.t (test 3) - which is related to another RT 39730 (reopened by me a minute ago).

--
kmx
RT-Send-CC: SBennett [...] accelrys.com
Latest progress with Win32::API

1/ I have commited another set of small changes fixing 64bit-pointer-size issues

2/ we have still t/03_undef.t failing sometimes (surprisingly on ActivePerl not on Strawberry Perl - at least on my Win7 box)

3/ a new issue appeared in Struct.pm - after Stephen added another DWORD_PTR item in testing structure it turned out that implemented alignment in C struct packing (see "sub getPack" in Struct.pm) does not work properly as the algorithm aligns all stuct items to the size of the biggest one - which is simply not correct (but works in some cases). My investigation revealed that C struct alignment is kind of "dark magic" (now you can observe this on failing tests 6-7 in t/01_Struct.t - just on32bit!!; on 64bit the alignment is "accidentally" calculated correctly)

That is all from me. For a while I will not be able to work on this RT (all I have done is either commited in github or described here).

--
kmx
From: temp1002 [...] debusschere.com
Thanks for working on this port. I just ran the tests with 2 fails, have not had time to work through them. Using This is perl 5, version 12, subversion 0 (v5.12.0) built for MSWin32-x64-multi-thread gcc version 4.4.3 (GCC) t/00_API.t .......... 1/25 # API test dll found at (API_test64.dll) # Failed test 'sum_integers() function defined' # at t/00_API.t line 86. Can't call method "Call" on an undefined value at t/00_API.t line 88. # Looks like you planned 25 tests but ran 11. # Looks like you failed 1 test of 11 run. # Looks like your test exited with 5 just after 11. t/00_API.t .......... Dubious, test returned 5 (wstat 1280, 0x500) Failed 15/25 subtests t/01_Struct.t ....... 1/7 # Failed test 'mangle_simple_struct() function' # at t/01_Struct.t line 52. # $^E=Access is denied Can't call method "Call" on an undefined value at t/01_Struct.t line 55. # Looks like you planned 7 tests but ran 5. # Looks like you failed 1 test of 5 run. # Looks like your test exited with 5 just after 5. t/01_Struct.t ....... Dubious, test returned 5 (wstat 1280, 0x500) Failed 3/7 subtests t/02_GetProcess.t ... 1/3 # $result=3032 # $$=3032 t/02_GetProcess.t ... ok t/03_undef.t ........ # Win32::API 0.60_64 t/03_undef.t ........ 1/3 # Import: The handle is invalid t/03_undef.t ........ ok t/04_rt_48006.t ..... 1/3 # Size is 296. Should be 296 t/04_rt_48006.t ..... ok t/05_more_struct.t .. ok Test Summary Report ------------------- t/00_API.t (Wstat: 1280 Tests: 11 Failed: 1) Failed test: 11 Non-zero exit status: 5 Parse errors: Bad plan. You planned 25 tests but ran 11. t/01_Struct.t (Wstat: 1280 Tests: 5 Failed: 1) Failed test: 5 Non-zero exit status: 5 Parse errors: Bad plan. You planned 7 tests but ran 5. Files=6, Tests=53, 1 wallclock secs ( 0.05 usr + 0.03 sys = 0.08 CPU) Result: FAIL Failed 2/6 test programs. 2/53 subtests failed. dmake.exe: Error code 255, while making 'test_dynamic'
At this point, this is a duplicate of ticket 55660 and should be merged into it.
Any hope of progress on this? -Max
From: jain_vipin_swm [...] yahoo.com
On Wed Mar 17 10:09:53 2010, SBennett@accelrys.com wrote: Show quoted text
> The attached three patches (against Win32-API-0.59) implement initial > support for 64-bit Windows in Win32-API. > > I didn't attempt to > port Win32::API::Callback. It looks like considerably more effort > than Win32::API itself, and as our application doesn't need it I > couldn't justify the paid time to spend on it. This is, however, > sufficient for Win32::API tests to pass against a 64-bit ActivePerl > 5.8.9. > > At present, only MSVC++ toolchains will work, as its > assembly dialect is different from GNU. I don't have a gcc-based > build of Perl to work with to port it, but it should only require a > straightforward translation of call_asm_x64_msvc.asm into > call_asm_x64_gnu.asm. > > The required changes to Makefile.PL are > also somewhat hackish, purely because I don't know of a better way > to detect what architecture we're targeting. > > Accelrys Limited > (http://accelrys.com) > Registered office: 334 Cambridge Science > Park, Cambridge, CB4 0WN, UK > Registered in England: 2326316
It seems that call_x64_real assembly function has a bug. It causes a perl crash if we call a Windows API needing more than 4 parameters. Ex. Win32::DriveInfo::GetFreeDiskSpace,Win32::DriveInfo::GetFreeDiskSpaceEx. These APIs expect more than 4 parameter, so some of the parameters (nstack = nparams - available_registers) are copied from copystack block of assembly code. This code has a bug which I fixed. I attached a patch for this. Basically, we were subtracting before testing for zero, this resulted into non-zero value when rax = 0 and instruction "sub rax 1" executed. -Vipin
Subject: mylog
diff --git a/call_asm_x64_msvc.asm b/call_asm_x64_msvc.asm index 7f8b2b0..43e8941 100755 --- a/call_asm_x64_msvc.asm +++ b/call_asm_x64_msvc.asm @@ -38,12 +38,11 @@ Call_x64_real PROC FRAME ; Except not if there isn't any test rax, rax jz docall - sub rax, 1 copystack: + sub rax, 1 mov r10, qword ptr [rsi+8*rax] push r10 - sub rax, 1 test rax, rax jnz copystack
From: jain_vipin_swm [...] yahoo.com
On Wed Mar 17 10:09:53 2010, SBennett@accelrys.com wrote: Show quoted text
> The attached three patches (against Win32-API-0.59) implement initial > support for 64-bit Windows in Win32-API. > > I didn't attempt to > port Win32::API::Callback. It looks like considerably more effort > than Win32::API itself, and as our application doesn't need it I > couldn't justify the paid time to spend on it. This is, however, > sufficient for Win32::API tests to pass against a 64-bit ActivePerl > 5.8.9. > > At present, only MSVC++ toolchains will work, as its > assembly dialect is different from GNU. I don't have a gcc-based > build of Perl to work with to port it, but it should only require a > straightforward translation of call_asm_x64_msvc.asm into > call_asm_x64_gnu.asm. > > The required changes to Makefile.PL are > also somewhat hackish, purely because I don't know of a better way > to detect what architecture we're targeting. > > Accelrys Limited > (http://accelrys.com) > Registered office: 334 Cambridge Science > Park, Cambridge, CB4 0WN, UK > Registered in England: 2326316
I attached a patch to fix a bug when Windows API is used which requires Show quoted text
> 4 parameters.
-Vipin
Subject: 0004-Add-a-x64-bug-fix-call_x64_real-func.txt
diff --git a/call_asm_x64_msvc.asm b/call_asm_x64_msvc.asm index 7f8b2b0..43e8941 100755 --- a/call_asm_x64_msvc.asm +++ b/call_asm_x64_msvc.asm @@ -38,12 +38,11 @@ Call_x64_real PROC FRAME ; Except not if there isn't any test rax, rax jz docall - sub rax, 1 copystack: + sub rax, 1 mov r10, qword ptr [rsi+8*rax] push r10 - sub rax, 1 test rax, rax jnz copystack
Subject: RE: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Thu, 20 Jan 2011 09:54:46 +0000
To: "bug-Win32-API [...] rt.cpan.org" <bug-Win32-API [...] rt.cpan.org>
From: Stephen Bennett <Stephen.Bennett [...] accelrys.com>
Show quoted text
> I attached a patch to fix a bug when Windows API is used which requires
> > 4 parameters.
> > -Vipin
This is fixed in git for both ASM dialects; thanks. I remember now noticing this a few months back and forgetting about it before I had time to investigate whether it really was wrong -- apparently this code path isn't often hit. Accelrys Limited (http://accelrys.com) Registered office: 334 Cambridge Science Park, Cambridge, CB4 0WN, UK Registered in England: 2326316
On Thu Jan 20 04:55:09 2011, Stephen.Bennett@accelrys.com wrote: Show quoted text
> > I attached a patch to fix a bug when Windows API is used which
> requires
> > > 4 parameters.
> > > > -Vipin
> > This is fixed in git for > both ASM dialects; thanks. > > I remember now noticing this a few > months back and forgetting about it before I had time to investigate > whether it really was wrong -- apparently this code path isn't often > hit.
I'd say this is worth a new release on CPAN. I could pack things up for 0.60. What you guys think? -- Cosimo
Show quoted text
> I'd say this is worth a new release on CPAN.
> I could pack things up for 0.60.
> What you guys think?

The current github version on strawberry perl x64 has the only issue - t\03_undef.t crashes (I think it is more about broken test that broken Win32::API). This has to be fixed before release.

Apart from that I do not have a good feeling about struct alignment on x64 (which I was hacking in July/2010) - it may be broken for some specific corner cases. But I would not consider this a show stopper.

--
kmx
Subject: RE: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Tue, 25 Jan 2011 10:11:14 +0000
To: "bug-Win32-API [...] rt.cpan.org" <bug-Win32-API [...] rt.cpan.org>
From: Stephen Bennett <Stephen.Bennett [...] accelrys.com>
Show quoted text
> The current github version on strawberry perl x64 has the only issue - > t\03_undef.t crashes (I think it is more about broken test that broken > Win32::API). This has to be fixed before release.
This also fails on ActivePerl x64 (but doesn't crash): # Win32::API 0.60_64 # Import: The handle is invalid # PeekNamedPipe: The handle is invalid # Failed test '(RT \#39730) sample API (PeekNamedPipe) works with undef values' # at t/03_undef.t line 60. # Looks like you failed 1 test of 3. I've not had a chance to investigate properly, and likely won't for a while. Accelrys Limited (http://accelrys.com) Registered office: 334 Cambridge Science Park, Cambridge, CB4 0WN, UK Registered in England: 2326316
RT-Send-CC: steven.bauer [...] amd.com
This is now a duplicate of #55660, so rejecting (no way to file as duplicate?)
Ticket was supposed to be merged, not rejected.
Subject: Re: [rt.cpan.org #42685] Version of Win32::API for 64-bit Windows
Date: Fri, 18 Feb 2011 08:28:37 +1100
To: bug-Win32-API [...] rt.cpan.org
From: "Cosimo Streppone" <cosimo [...] streppone.it>
On Fri, 18 Feb 2011 04:41:42 +1100, Jan Dubois via RT <bug-Win32-API@rt.cpan.org> wrote: Show quoted text
> Ticket was supposed to be merged, not rejected.
Sorry, but I have no idea how to do that. I might be a bit stupid, but the user interface doesn't help me very much. -- Cosimo
RT-Send-CC: AZAWAWI [...] cpan.org, chorny [...] cpan.org, adamk [...] cpan.org, libwin32 [...] perl.org, cosimo [...] streppone.it
Any chance to push v0.60? I'm trying to install Padre, which depends on Win32::API. I seem to have the same error with "operands invalid for 'push'" (log attached).

--
Dan Dascalescu
Subject: win32_api_build_failure.txt
--> Working on Win32::API Fetching http://search.cpan.org/CPAN/authors/id/C/CO/COSIMO/Win32-API-0.59.tar.gz -> OK Unpacking Win32-API-0.59.tar.gz Entering Win32-API-0.59 Configuring Win32-API-0.55 Running Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for Win32::API::Callback Writing Makefile for Win32::API -> OK Finding PREREQ from Makefile ... Checking if you have Win32 0 ... Yes (0.39) Building and testing Win32-API-0.55 cp Type.pm blib\lib\Win32/API/Type.pm cp Callback.pm blib\lib\Win32/API/Callback.pm cp Test.pm blib\lib\Win32/API/Test.pm cp Struct.pm blib\lib\Win32/API/Struct.pm cp API.pm blib\lib\Win32/API.pm C:\strawberry\perl\bin\perl.exe C:\strawberry\perl\lib\ExtUtils\xsubpp -typemap C:\strawberry\perl\lib\ExtUtils\typemap Callback.xs > Callback.xsc && C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "mv" -- Callback.xsc Callback.c gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DWIN64 -DCONSERVATIVE -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX -s -O2 -DVERSION=\"0.59\" -DXS_VERSION=\"0.59\" "-IC:\strawberry\perl\lib\CORE" Callback.c Callback.xs: In function 'CallbackMakeStruct': Callback.xs:250: warning: cast from pointer to integer of different size Callback.xs: In function 'CallbackTemplate': Callback.xs:305: warning: cast to pointer from integer of different size Callback.xs:313: warning: cast to pointer from integer of different size Callback.xs: In function 'CallbackCreate': Callback.xs:581: warning: cast from pointer to integer of different size Callback.xs:596: warning: cast from pointer to integer of different size Callback.xs:597: warning: cast from pointer to integer of different size Callback.xs:637: warning: cast from pointer to integer of different size Callback.xs:687: warning: cast from pointer to integer of different size Callback.xs:738: warning: cast from pointer to integer of different size Callback.xs: In function 'XS_Win32__API__Callback_CallbackCreate': Callback.xs:868: warning: cast from pointer to integer of different size Callback.xs: In function 'XS_Win32__API__Callback_PushSelf': Callback.xs:896: warning: cast from pointer to integer of different size Running Mkbootstrap for Win32::API::Callback () C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 Callback.bs C:\strawberry\perl\bin\perl.exe -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"Win32::API::Callback\", 'DLBASE' => 'Callback', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => []);" dlltool --def Callback.def --output-exp dll.exp g++ -o ..\blib\arch\auto\Win32\API\Callback\Callback.dll -Wl,--base-file -Wl,dll.base -mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib" Callback.o -Wl,--image-base,0x21000000 C:\strawberry\perl\lib\CORE\libperl512.a -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 dll.exp dlltool --def Callback.def --base-file dll.base --output-exp dll.exp g++ -o ..\blib\arch\auto\Win32\API\Callback\Callback.dll -mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib" Callback.o -Wl,--image-base,0x21000000 C:\strawberry\perl\lib\CORE\libperl512.a -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 dll.exp C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 755 ..\blib\arch\auto\Win32\API\Callback\Callback.dll C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "cp" -- Callback.bs ..\blib\arch\auto\Win32\API\Callback\Callback.bs C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 ..\blib\arch\auto\Win32\API\Callback\Callback.bs C:\strawberry\perl\bin\perl.exe C:\strawberry\perl\lib\ExtUtils\xsubpp -typemap C:\strawberry\perl\lib\ExtUtils\typemap -typemap typemap API.xs > API.xsc && C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "mv" -- API.xsc API.c gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DWIN64 -DCONSERVATIVE -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX -s -O2 -DVERSION=\"0.59\" -DXS_VERSION=\"0.59\" "-IC:\strawberry\perl\lib\CORE" API.c API.xs: In function 'XS_Win32__API_GetProcAddress': API.xs:127: warning: cast from pointer to integer of different size API.xs: In function 'XS_Win32__API_PointerTo': API.xs:206: warning: cast from pointer to integer of different size API.xs: In function 'XS_Win32__API_ReadMemory': API.xs:223: warning: cast to pointer from integer of different size C:\Users\A\AppData\Local\Temp\ccyvhME8.s: Assembler messages: C:\Users\A\AppData\Local\Temp\ccyvhME8.s:3129: Error: suffix or operands invalid for `push' C:\Users\A\AppData\Local\Temp\ccyvhME8.s:3132: Error: suffix or operands invalid for `push' dmake.exe: Error code 129, while making 'API.o'
On Wed Mar 02 17:44:18 2011, dandv wrote: Show quoted text
> Any chance to push v0.60? I'm trying to install Padre, which depends
on Win32::API Show quoted text
> I seem to have the same error with "operands invalid for 'push'" (log
attached). Hi there, does the current github version work for you? http://github.com/cosimo/perl5-win32-api/ That would be pushed as 0.60, but several problems have been reported already, last one by Jan Dubois. You can read about it in this same ticket history.
From: mcrose [...] gmail.com
On Wed Mar 02 21:13:14 2011, COSIMO wrote: Show quoted text
> On Wed Mar 02 17:44:18 2011, dandv wrote: >
> > Any chance to push v0.60? I'm trying to install Padre, which depends
> on Win32::API
> > I seem to have the same error with "operands invalid for 'push'" (log
> attached). > > Hi there, > > does the current github version work for you? > > http://github.com/cosimo/perl5-win32-api/ > > That would be pushed as 0.60, but several problems have been reported > already, last one by Jan Dubois. You can read about it in this same > ticket history.
I've pulled the latest ver. It builds, but perl crashes running tests: C:\strawberry\cpan\build\Win32-API-0.60\cosimo-perl5-win32-api-6ec0306>dmake Skip blib\lib\Win32/API/Type.pm (unchanged) Skip blib\lib\Win32/API/Test.pm (unchanged) Skip blib\lib\Win32/API/Struct.pm (unchanged) Skip blib\lib\Win32/API.pm (unchanged) gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DWIN64 -DCONSERVATIVE -DUSE_SITECUSTOMIZE -DPERL_I MPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX -s -O2 -DVERSION=\"0.60_64\" -DXS_VERSION=\"0.60_64\" "-IC:\strawberry\perl\lib\CORE" API.c as call_asm_x64_gnu.s -o call_asm_x64_gnu.o Running Mkbootstrap for Win32::API () C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 API.bs dlltool --def API.def --output-exp dll.exp g++ -o blib\arch\auto\Win32\API\API.dll -Wl,--base-file -Wl,dll.base -mdll -s -L"C:\strawberry\perl\ lib\CORE" -L"C:\strawberry\c\lib" API.o call_asm_x64_gnu.o -Wl,--image-base,0x253c0000 C:\strawberr y\perl\lib\CORE\libperl512.a -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 dll.exp dlltool --def API.def --base-file dll.base --output-exp dll.exp g++ -o blib\arch\auto\Win32\API\API.dll -mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\ lib" API.o call_asm_x64_gnu.o -Wl,--image-base,0x253c0000 C:\strawberry\perl\lib\CORE\libperl512.a -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 dll.exp C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 755 blib\arch\auto\Win32\API\API.d ll C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "cp" -- API.bs blib\arch\auto\Win32\API\API.b s C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 blib\arch\auto\Win32\API\API.b s C:\strawberry\cpan\build\Win32-API-0.60\cosimo-perl5-win32-api-6ec0306>dmake test C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\ar ch')" t/*.t t/00_API.t .......... 1/25 # API test dll found at (API_test64.dll) Argument "japh" isn't numeric in pack at C:\strawberry\cpan\build\Win32-API-0.60\cosimo-perl5-win32- api-6ec0306\blib\lib/Win32/API/Type.pm line 211. t/00_API.t .......... ok t/01_Struct.t ....... 1/7 # $^E= t/01_Struct.t ....... ok t/02_GetProcess.t ... 1/3 # $result=5080 # $$=5080 t/02_GetProcess.t ... ok t/03_undef.t ........ # Win32::API 0.60_64 t/03_undef.t ........ 1/3 # Import: The handle is invalid Faulting application name: perl.exe, version: 0.0.0.0, time stamp: 0x4c5228ad Faulting module name: API.dll, version: 0.0.0.0, time stamp: 0x4d76d74e Exception code: 0xc0000005 Fault offset: 0x0000000000002f06 Faulting process id: 0x10dc Faulting application start time: 0x01cbddf90c7dbc0e Faulting application path: C:\STRAWB~1\perl\bin\perl.exe Faulting module path: C:\strawberry\cpan\build\Win32-API-0.60\cosimo-perl5-win32-api-6ec0306\blib\arch\auto\Win32\API\API.dll Report Id: 4b551f57-49ec-11e0-9979-005056c00008
From: mcrose [...] gmail.com
On Tue Mar 08 20:33:47 2011, Oesor wrote: Show quoted text
> On Wed Mar 02 21:13:14 2011, COSIMO wrote:
> > On Wed Mar 02 17:44:18 2011, dandv wrote: > >
> > > Any chance to push v0.60? I'm trying to install Padre, which
> depends
> > on Win32::API
> > > I seem to have the same error with "operands invalid for 'push'"
> (log
> > attached). > > > > Hi there, > > > > does the current github version work for you? > > > > http://github.com/cosimo/perl5-win32-api/ > > > > That would be pushed as 0.60, but several problems have been
> reported
> > already, last one by Jan Dubois. You can read about it in this same > > ticket history.
> > I've pulled the latest ver. It builds, but perl crashes running tests: > > C:\strawberry\cpan\build\Win32-API-0.60\cosimo-perl5-win32-api-
> 6ec0306>dmake
> Skip blib\lib\Win32/API/Type.pm (unchanged) > Skip blib\lib\Win32/API/Test.pm (unchanged) > Skip blib\lib\Win32/API/Struct.pm (unchanged) > Skip blib\lib\Win32/API.pm (unchanged) > gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DWIN64 > -DCONSERVATIVE > -DUSE_SITECUSTOMIZE -DPERL_I > MPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing > -mms-bitfields > -DPERL_MSVCRT_READFIX -s -O2 > -DVERSION=\"0.60_64\" -DXS_VERSION=\"0.60_64\" > "-IC:\strawberry\perl\lib\CORE" > API.c > as call_asm_x64_gnu.s -o call_asm_x64_gnu.o > Running Mkbootstrap for Win32::API () > C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 > API.bs > dlltool --def API.def --output-exp dll.exp > g++ -o blib\arch\auto\Win32\API\API.dll -Wl,--base-file -Wl,dll.base > -mdll -s -L"C:\strawberry\perl\ > lib\CORE" -L"C:\strawberry\c\lib" API.o call_asm_x64_gnu.o > -Wl,--image-base,0x253c0000 C:\strawberr > y\perl\lib\CORE\libperl512.a -lmoldname -lkernel32 -luser32 -lgdi32 > -lwinspool -lcomdlg32 -ladvapi32 > -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm > -lversion -lodbc32 -lodbccp32 > -lcomctl32 dll.exp > dlltool --def API.def --base-file dll.base --output-exp dll.exp > g++ -o blib\arch\auto\Win32\API\API.dll -mdll -s > -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\ > lib" API.o call_asm_x64_gnu.o -Wl,--image-base,0x253c0000 > C:\strawberry\perl\lib\CORE\libperl512.a > -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 > -ladvapi32 > -lshell32 -lole32 -loleaut32 > -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 > -lodbccp32 > -lcomctl32 dll.exp > C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 755 > blib\arch\auto\Win32\API\API.d > ll > C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "cp" -- API.bs > blib\arch\auto\Win32\API\API.b > s > C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 > blib\arch\auto\Win32\API\API.b > s > > C:\strawberry\cpan\build\Win32-API-0.60\cosimo-perl5-win32-api-
> 6ec0306>dmake
> test > C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" > "test_harness(0, 'blib\lib', 'blib\ar > ch')" t/*.t > t/00_API.t .......... 1/25 # API test dll found at (API_test64.dll) > Argument "japh" isn't numeric in pack at > C:\strawberry\cpan\build\Win32-API-0.60\cosimo-perl5-win32- > api-6ec0306\blib\lib/Win32/API/Type.pm line 211. > t/00_API.t .......... ok > t/01_Struct.t ....... 1/7 # $^E= > t/01_Struct.t ....... ok > t/02_GetProcess.t ... 1/3 # $result=5080 > # $$=5080 > t/02_GetProcess.t ... ok > t/03_undef.t ........ # Win32::API 0.60_64 > t/03_undef.t ........ 1/3 # Import: The handle is invalid > > > Faulting application name: perl.exe, version: 0.0.0.0, time stamp: > 0x4c5228ad > Faulting module name: API.dll, version: 0.0.0.0, time stamp: > 0x4d76d74e > Exception code: 0xc0000005 > Fault offset: 0x0000000000002f06 > Faulting process id: 0x10dc > Faulting application start time: 0x01cbddf90c7dbc0e > Faulting application path: C:\STRAWB~1\perl\bin\perl.exe > Faulting module path: > C:\strawberry\cpan\build\Win32-API-0.60\cosimo-perl5-win32-api- > 6ec0306\blib\arch\auto\Win32\API\API.dll > Report Id: 4b551f57-49ec-11e0-9979-005056c00008 > >
oh, heh, this is mentioned above as well.
Subject: Fwd: [rt.cpan.org #55660] Fwd: CPAN Upload: C/CO/COSIMO/Win32-API-0.60.tar.gz
Date: Sat, 19 Mar 2011 13:46:12 +1100
To: "bug-Win32-API [...] rt.cpan.org" <bug-Win32-API [...] rt.cpan.org>
From: "Cosimo Streppone" <cosimo [...] streppone.it>
I decided to push 0.60 on CPAN by temporarily disabling the 03_undef.t test case. Github source is tagged "CPAN-v0.60". Show quoted text
------- Forwarded message ------- From: PAUSE <upload@pause.perl.org> To: "Cosimo Streppone" <cosimo@streppone.it> Subject: CPAN Upload: C/CO/COSIMO/Win32-API-0.60.tar.gz Date: Sat, 19 Mar 2011 10:48:00 +1100 The uploaded file Win32-API-0.60.tar.gz has entered CPAN as file: $CPAN/authors/id/C/CO/COSIMO/Win32-API-0.60.tar.gz size: 302060 bytes md5: 750e5aa784822a2a9d88f5b9f5bf03d9 No action is required on your part Request entered by: COSIMO (Cosimo Streppone) Request entered on: Fri, 18 Mar 2011 23:46:44 GMT Request completed: Fri, 18 Mar 2011 23:48:00 GMT Thanks, -- Cosimo
Subject: Re: Fwd: [rt.cpan.org #55660] Fwd: CPAN Upload: C/CO/COSIMO/Win32-API-0.60.tar.gz
Date: Mon, 21 Mar 2011 09:13:30 +0100
To: bug-Win32-API [...] rt.cpan.org
From: kmx <kmx [...] volny.cz>
Hi Cosimo, Win32-API-0.60 unfortunately fails to build on strawberry perl on 32bit API.xs:49:23: call_i686.h: No such file or directory on 64bit API.xs:47:25: error: call_x86_64.h: No such file or directory -- kmx Writing Makefile for Win32::API CPAN: Module::CoreList loaded ok (v2.36) cp Type.pm blib\lib\Win32/API/Type.pm cp Test.pm blib\lib\Win32/API/Test.pm cp Struct.pm blib\lib\Win32/API/Struct.pm cp API.pm blib\lib\Win32/API.pm D:\strawberry64\perl\bin\perl.exe D:\strawberry64\perl\lib\ExtUtils\xsubpp -typemap D:\strawberry64\perl\lib\ExtUtils\typemap -typemap typemap API.xs Show quoted text
> API.xsc && D:\strawberry64\perl\bin\perl.exe -MExtUtils::Command -e "mv"
-- API.xsc API.c gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DWIN64 -DCONSERVATIVE -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX -s -O2 -DVERSION=\"0.60\" -DXS_VERSION=\"0.60\" "-ID:\strawberry64\perl\lib\CORE" API.c API.xs:47:25: error: call_x86_64.h: No such file or directory dmake.EXE: Error code 129, while making 'API.o' LOCAL/Win32-API-0.60.tar.gz D:\strawberry64\c\bin\dmake.EXE -- NOT OK CPAN: YAML loaded ok (v0.71) Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible
CC: libwin32 [...] perl.org
Subject: Re: Fwd: [rt.cpan.org #55660] Fwd: CPAN Upload: C/CO/COSIMO/Win32-API-0.60.tar.gz
Date: Tue, 22 Mar 2011 11:04:58 +1100
To: bug-Win32-API [...] rt.cpan.org
From: "Cosimo Streppone" <cosimo [...] streppone.it>
On Mon, 21 Mar 2011 19:13:41 +1100, kmx via RT <bug-Win32-API@rt.cpan.org> wrote: Show quoted text
> Queue: Win32-API > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=55660 > > > Hi Cosimo, > > Win32-API-0.60 unfortunately fails to build on strawberry perl > > on 32bit > API.xs:49:23: call_i686.h: No such file or directory > > on 64bit > API.xs:47:25: error: call_x86_64.h: No such file or directory
Sorry, my bad. Should be fixed in 0.61, hitting CPAN as we speak. Keep the feedback coming, please! I *want* Win32::API to build and run on Strawberry 64 bit. -- Cosimo
Subject: Re: Fwd: [rt.cpan.org #55660] Fwd: CPAN Upload: C/CO/COSIMO/Win32-API-0.60.tar.gz
Date: Tue, 22 Mar 2011 16:44:00 +0100
To: bug-Win32-API [...] rt.cpan.org
From: kmx <kmx [...] volny.cz>
Show quoted text
> Sorry, my bad. > Should be fixed in 0.61, hitting CPAN as we speak. > > Keep the feedback coming, please! > I *want* Win32::API to build and run on Strawberry 64 bit. >
Unfortunately there are still some issues: 1/ cosmetics - META.yml contains wrong version see http://cpansearch.perl.org/src/COSIMO/Win32-API-0.61/META.yml 2/ 32bit Strawberry Perl (both 5.10, 5.12) crashes during t/03_Jim_Shaw.t 3/ 32bit Active Perl (all 5.8, 5.10, 5.12) fails (no crash) during t/03_Jim_Shaw.t Good news - 64bit Strawberry Perl 5.12 and 64bit Active perl 5.12 PASS (as callback part is disabled on 64bit). -- kmx
CC: "libwin32 [...] perl.org" <libwin32 [...] perl.org>
Subject: Re: Fwd: [rt.cpan.org #55660] Fwd: CPAN Upload: C/CO/COSIMO/Win32-API-0.60.tar.gz
Date: Wed, 23 Mar 2011 09:41:33 +1100
To: bug-Win32-API [...] rt.cpan.org
From: "Cosimo Streppone" <cosimo [...] streppone.it>
On Wed, 23 Mar 2011 02:44:16 +1100, kmx via RT <bug-Win32-API@rt.cpan.org> wrote: Show quoted text
> Tue Mar 22 11:44:15 2011: Request 55660 was acted upon. > Transaction: Correspondence added by kmx@volny.cz > Queue: Win32-API > Subject: Re: Fwd: [rt.cpan.org #55660] Fwd: CPAN Upload: > C/CO/COSIMO/Win32-API-0.60.tar.gz > Broken in: (no value) > Severity: (no value) > Owner: COSIMO > Requestors: RIVY@cpan.org, SBennett@accelrys.com, steven.bauer@amd.com > Status: open > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=55660 > >
>> Sorry, my bad. >> Should be fixed in 0.61, hitting CPAN as we speak. >> >> Keep the feedback coming, please! >> I *want* Win32::API to build and run on Strawberry 64 bit.
> > Unfortunately there are still some issues:
Show quoted text
> 1/ cosmetics - META.yml contains wrong version > 2/ 32bit Strawberry Perl (both 5.10, 5.12) crashes during t/03_Jim_Shaw.t > 3/ 32bit Active Perl (all 5.8, 5.10, 5.12) fails (no crash) during > t/03_Jim_Shaw.t
That's a new test that was missing from the manifest. I'll make sure it is skipped until we understand a bit more. Show quoted text
> Good news - 64bit Strawberry Perl 5.12 and 64bit Active perl 5.12 PASS > (as callback part is disabled on 64bit).
\o/ I'll try to address these problems asap and push 0.62. We could end up with 0.64 to have proper 64 bits support :) -- Cosimo
RT-Send-CC: adamk [...] cpan.org, kmx [...] cpan.org, kmx [...] volny.cz, ROBINS [...] cpan.org, Stephen.Bennett [...] accelrys.com, jain_vipin_swm [...] yahoo.com, SBennett [...] accelrys.com, temp1002 [...] debusschere.com, jand [...] activestate.com, chorny [...] cpan.org, mcrose [...] gmail.com, libwin32 [...] perl.org, sisyphus1 [...] optusnet.com.au, steven.bauer [...] amd.com, KENTNL [...] cpan.org, csjewell [...] cpan.org, AZAWAWI [...] cpan.org
All issues mentioned in this ticket should be addressed in the current CPAN version of Win32::API. I'm closing this ticket as resolved. Adam/Curtis, are you applying some patch/fix to build Strawberry on 64 bits? Thanks to all of you for contributing to this ticket. Please open new ones if there's still issues with 64 bits support.
CC: adamk [...] cpan.org, kmx [...] cpan.org, kmx [...] volny.cz, ROBINS [...] cpan.org, Stephen.Bennett [...] accelrys.com, jain_vipin_swm [...] yahoo.com, SBennett [...] accelrys.com, temp1002 [...] debusschere.com, jand [...] activestate.com, chorny [...] cpan.org, mcrose [...] gmail.com, libwin32 [...] perl.org, sisyphus1 [...] optusnet.com.au, steven.bauer [...] amd.com, KENTNL [...] cpan.org, csjewell [...] cpan.org, AZAWAWI [...] cpan.org
Subject: Re: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API
Date: Thu, 8 Sep 2011 07:13:43 +1000
To: bug-Win32-API [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
I haven't heard much of anything from Curtis recently, and our last few releases are very late or missing. I'll look at getting more involved again in development and look at a new release. Adam K On 29 August 2011 06:06, Cosimo Streppone via RT <bug-Win32-API@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=55660 > > > All issues mentioned in this ticket should be addressed in the current > CPAN version of Win32::API. > > I'm closing this ticket as resolved. Adam/Curtis, are you applying some > patch/fix to build Strawberry on 64 bits? > > Thanks to all of you for contributing to this ticket. > Please open new ones if there's still issues with 64 bits support. > >
From: bulk88(1) [...] hotmail.com
On Wed Mar 17 10:09:53 2010, SBennett@accelrys.com wrote: Show quoted text
> The attached three patches (against Win32-API-0.59) implement initial > support for 64-bit Windows in Win32-API. > > I didn't attempt to > port Win32::API::Callback. It looks like considerably more effort > than Win32::API itself, and as our application doesn't need it I > couldn't justify the paid time to spend on it. This is, however, > sufficient for Win32::API tests to pass against a 64-bit ActivePerl > 5.8.9. > > At present, only MSVC++ toolchains will work, as its > assembly dialect is different from GNU. I don't have a gcc-based > build of Perl to work with to port it, but it should only require a > straightforward translation of call_asm_x64_msvc.asm into > call_asm_x64_gnu.asm. > > The required changes to Makefile.PL are > also somewhat hackish, purely because I don't know of a better way > to detect what architecture we're targeting. > > Accelrys Limited > (http://accelrys.com) > Registered office: 334 Cambridge Science > Park, Cambridge, CB4 0WN, UK > Registered in England: 2326316
Your (IDK if you will get this from CPAN's web interface) asm is broken. RSI register is non-volatile. https://rt.cpan.org/Public/Bug/Display.html?id=77677
From: bulk88(1) [...] hotmail.com
On Sun Jul 04 16:34:38 2010, KMX wrote: Show quoted text
> Hi cosimo, > > please cosider applying my patch for building Win32::API with 64bit > GNU > compiler/assembler (e.g. strawberry perl). > > Look at: http://github.com/kmx/perl5-win32-api (I have just sent you > pull > request via github) > > With this patch Win32::API builds fine on 64strawberry perl; however > there are > still 2 failing tests: > t/01_Struct.t - test 5 (perl.exe crashes) > t/03_undef.t - test 3 > > -- > kmx
Your GCC asm code will crash if there are more than 4 parameters. See https://rt.cpan.org/Public/Bug/Display.html?id=77677
RT-Send-CC: adamkennedybackup [...] gmail.com, adamk [...] cpan.org, kmx [...] cpan.org, kmx [...] volny.cz, Stephen.Bennett [...] accelrys.com, jain_vipin_swm [...] yahoo.com, bulk88 [...] hotmail.com, SBennett [...] accelrys.com, temp1002 [...] debusschere.com, jand [...] activestate.com, chorny [...] cpan.org, mcrose [...] gmail.com, sisyphus1 [...] optusnet.com.au, libwin32 [...] perl.org, steven.bauer [...] amd.com, cosimo [...] streppone.it, KENTNL [...] cpan.org, csjewell [...] cpan.org, AZAWAWI [...] cpan.org
In https://rt.cpan.org/Ticket/Display.html?id=77677 I identified problems with the x64 support, basically if > 4 params, usually a crash on GCC, and theoretical but not seen in practice crash on VC. Both problems were identified and fixed in Win32::API 0.70, so I am closing this bug. If you all are still having problems, reply and this ticket will reopen itself.