Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of cosimo (4138)

Tuesday February 03, 2009
06:12 PM

Win32::API port to 64-bits

[ #38405 ]

I've been the current maintainer of Win32::API for some years now.

I am proud to be working on such a useful module, at least for Windows people. I even managed once to build it under Linux/winegcc.

Lately, I've been receiving user requests about porting it to 64-bit architectures. While this is something I want to do, I might have some problems. Mainly, my lack of knowledge about porting 32-bit stuff to 64-bits under Windows.

Luckily, there seems to be available information and enough interested users that can provide help, code, hardware and/or licenses.

So, if you are in any way interested in helping out or staying tuned on the 64-bit port of Win32::API, please join the libwin32 mailing list. I'm going to post some more details there.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Is it even possible to build a 64 bit version of Perl on Windows? Ruby 1.8.x won't work because of inline assembler issues and I thought Perl (and probably others) would suffer from this as well:

    http://msdn.microsoft.com/en-us/library/wbk4z78b.aspx [microsoft.com]

    • Core Perl doesn't use inline-assembly, so this is not an issue. A 64-bit version of ActivePerl for Windows has been available since 2006.

      Win32::API however does use inline-assembly and therefore needs to be changed to either move the assembly code into separate files to be processed by an assembler, or needs to use the new intrinsic functions in newer versions of VC++.

      Feel free to join libwin32@perl.org to discuss the details. :)

      • The calling conventions are also very different - Win32 uses a purely stack parameter passing convention, while x64 uses the standard amd64 parameter passing convention - with the first four parameters going into registers if possible.

        For example:

        GetTextFace(dc, sizeof(facename), facename)

        compiles to:

        ; look Ma! No stack!
        lea r8, OFFSET FLAT:facename
        mov edx, 80 ; 00000050H
        mov rcx, QWORD PTR dc
        call QWORD PTR __imp_GetTextFaceA

  • Ok, here's a stoooopid question: Shouldn't this project be writing Win64::API?
    --
    "If you were supposed to understand it, we wouldn't call it code." - FedEx
    • No, it is called the "Win32 API for 64-bit Windows" even by Microsoft. Well, at least it was for a while, now I think it is just called the "Windows API".

      Seriously, changing the module name would be very bad for writing portable scripts because you would then have to import different modules depending on the native size of your pointers. That's something you don't really care about at the Perl level.

      • Whoops. I forgot the smiley. As in: Shouldn't this project be writing Win64::API? :-)
        --
        "If you were supposed to understand it, we wouldn't call it code." - FedEx