Skip Menu |

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

Report information
The Basics
Id: 113337
Status: open
Priority: 0/
Queue: Win32-SerialPort

People
Owner: Nobody in particular
Requestors: SACAVILIA [...] cpan.org
Cc:
AdminCc:

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



Subject: Does not work on 64-bit Windows
This module does not seem to work on 64-bit Windows at all. Some tests fail during install, and reading or writing data does not work (ports seem to open fine though). Looking at CPAN testers, all 64-bit targets are currently failing and most 32-bit targets pass.
Subject: Re: [rt.cpan.org #113337] Does not work on 64-bit Windows
Date: Fri, 25 Mar 2016 12:59:45 -0400
To: bug-win32-serialport [...] rt.cpan.org
From: Bbirthisel <bbirthisel [...] aol.com>
This module was designed to work with the 32-bit serial driver in the OS. The 64-bit driver is much different and would require a total rewrite. Also, most 64-bit Windows machines do not have serial ports - so there is very little demand. Those needing this functionality have installed a 32-bit perl (with something like the Strawberry portable distribution, both 32 and 64 bit perls can be installed in parallel). -bill Show quoted text
-----Original Message----- From: Stephen A Cavilia via RT <bug-Win32-SerialPort@rt.cpan.org> To: undisclosed-recipients:; Sent: Fri, Mar 25, 2016 11:35 am Subject: [rt.cpan.org #113337] Does not work on 64-bit Windows Fri Mar 25 11:35:01 2016: Request 113337 was acted upon. Transaction: Ticket created by SACAVILIA Queue: Win32-SerialPort Subject: Does not work on 64-bit Windows Broken in: (no value) Severity: (no value) Owner: Nobody Requestors: SACAVILIA@cpan.org Status: new Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=113337 > This module does not seem to work on 64-bit Windows at all. Some tests fail during install, and reading or writing data does not work (ports seem to open fine though). Looking at CPAN testers, all 64-bit targets are currently failing and most 32-bit targets pass.
Virtually all machines being sold are 64-bit now, and OEMs have finally started putting 64-bit OS installs on them (even with EFI! now) (legacy software from silly Windows-based developers who haven't caught up is the only reason modern processors spend any time in 32-bit mode), and serial-port-based equipment still exists, so of course there are plenty of Windows systems with serial ports. I can run a 32-bit Perl when I'm stuck on Windows platforms but am looking for a more long term solution to eventually be able to move out of the dark ages. But anyway, what's different about the 64-bit serial port API? I've worked with C/C++-based software in Windows using serial ports before and have never needed to rewrite any code when switching between 32- and 64-bit compilers. Do you know if the changes have to be made in Win32::SerialPort/Win32API::CommPort or inside Win32::API? On Fri Mar 25 12:59:56 2016, Bbirthisel@aol.com wrote: Show quoted text
> > This module was designed to work with the 32-bit serial driver in the > OS. The 64-bit driver is much different and would require a total > rewrite. Also, most 64-bit Windows machines do not have serial ports - > so there is very little demand. > > > Those needing this functionality have installed a 32-bit perl (with > something like the Strawberry portable distribution, both 32 and 64 > bit perls can be installed in parallel). > > -bill > > > -----Original Message----- > From: Stephen A Cavilia via RT <bug-Win32-SerialPort@rt.cpan.org> > To: undisclosed-recipients:; > Sent: Fri, Mar 25, 2016 11:35 am > Subject: [rt.cpan.org #113337] Does not work on 64-bit Windows > > Fri Mar 25 11:35:01 2016: Request 113337 was acted upon. > Transaction: Ticket created by SACAVILIA > Queue: Win32-SerialPort > Subject: Does not work on 64-bit Windows > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: SACAVILIA@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=113337 > > > > This module does not seem to work on 64-bit Windows at all. Some tests > fail during install, and reading or writing data does not work (ports > seem to open fine though). Looking at CPAN testers, all 64-bit targets > are currently failing and most 32-bit targets pass.
Subject: Re: [rt.cpan.org #113337] Does not work on 64-bit Windows
Date: Sat, 26 Mar 2016 13:42:16 -0400
To: bug-Win32-SerialPort [...] rt.cpan.org
From: Bill Birthisel <bbirthisel [...] aol.com>
Hi Stephen, Almost all the work involved would be inside Win32::CommPort. Win32::API was updated to handle 64-bit stack frames (for driver-specific calls) a while back. I have not determined whether the easiest approach is to add changes to Win32::CommPort or to create a separate Win64::CommPort. If everything goes into Win32::Commport, then Win32::SerialPort, the test suite, and the example code would probably need no changes. There are two good reasons it hasn't been done: 1. I don't have time. I'm already overbooked through most of the rest of this year. 2. I don't have a 64-bit Windows machine at home. I have access to one at work - but I doubt my boss would like me to do a lot of unrelated development work on it. You are welcome to investigate porting it to 64-bit on your own. You might even find others interested in helping. And I could try to answer questions. It would be nice to maintain script compatibility with Device::SerialPort (the un*x and MAC equivalent) at the top level though. -bill On 03/25/2016 02:53 PM, Stephen A Cavilia via RT wrote: Show quoted text
> Queue: Win32-SerialPort > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=113337 > > > Virtually all machines being sold are 64-bit now, and OEMs have finally started putting 64-bit OS installs on them (even with EFI! now) (legacy software from silly Windows-based developers who haven't caught up is the only reason modern processors spend any time in 32-bit mode), and serial-port-based equipment still exists, so of course there are plenty of Windows systems with serial ports. I can run a 32-bit Perl when I'm stuck on Windows platforms but am looking for a more long term solution to eventually be able to move out of the dark ages. > > But anyway, what's different about the 64-bit serial port API? I've worked with C/C++-based software in Windows using serial ports before and have never needed to rewrite any code when switching between 32- and 64-bit compilers. Do you know if the changes have to be made in Win32::SerialPort/Win32API::CommPort or inside Win32::API? > > On Fri Mar 25 12:59:56 2016, Bbirthisel@aol.com wrote:
>> This module was designed to work with the 32-bit serial driver in the >> OS. The 64-bit driver is much different and would require a total >> rewrite. Also, most 64-bit Windows machines do not have serial ports - >> so there is very little demand. >> >> >> Those needing this functionality have installed a 32-bit perl (with >> something like the Strawberry portable distribution, both 32 and 64 >> bit perls can be installed in parallel). >> >> -bill >> >> >> -----Original Message----- >> From: Stephen A Cavilia via RT <bug-Win32-SerialPort@rt.cpan.org> >> To: undisclosed-recipients:; >> Sent: Fri, Mar 25, 2016 11:35 am >> Subject: [rt.cpan.org #113337] Does not work on 64-bit Windows >> >> Fri Mar 25 11:35:01 2016: Request 113337 was acted upon. >> Transaction: Ticket created by SACAVILIA >> Queue: Win32-SerialPort >> Subject: Does not work on 64-bit Windows >> Broken in: (no value) >> Severity: (no value) >> Owner: Nobody >> Requestors: SACAVILIA@cpan.org >> Status: new >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=113337 > >> >> >> This module does not seem to work on 64-bit Windows at all. Some tests >> fail during install, and reading or writing data does not work (ports >> seem to open fine though). Looking at CPAN testers, all 64-bit targets >> are currently failing and most 32-bit targets pass.
> >
Subject: Re: [rt.cpan.org #113337] Does not work on 64-bit Windows
Date: Tue, 20 Dec 2016 00:31:03 +0000
To: "bug-Win32-SerialPort [...] rt.cpan.org" <bug-Win32-SerialPort [...] rt.cpan.org>
From: "Oicles, Christopher" <Christopher.Oicles [...] amd.com>
The only problem with this module on 64-bit windows is the layout of the OVERLAPPED struct. The 32-bit version of this struct has a size of 20 bytes, but the 64-bit version is 32 bytes, because the fields "Internal", "InternalHigh" and "hEvent" are all quadwords instead of doublewords ("Pointer" also becomes a quadword, but it is part of a union which is quadword-sized in both 32- and 64-bit versions, and it is not used in Win32API::CommPort). The fix is trivial, and allows both bitnesses to share the same Perl Module. Here are the edits I made to CommPort.pm which got it working: Line 467 Original: my $OVERLAPPEDformat="LLLLL"; Edited: my $OVERLAPPEDformat = (length pack 'P') * 8 == 32 ? "LLLLL" : "QQLLQ"; # "length pack 'P'" gives you the size of a null pointer, then I multiply by 8 to get a bit count, just for clarity. Lines 768 and 769 Original: $self->{"_R_OVERLAP"} = " "x24; $self->{"_W_OVERLAP"} = " "x24; Edited: $self->{"_R_OVERLAP"} = " "x32; $self->{"_W_OVERLAP"} = " "x32; # These lines populate the fields with some default (and invalid) bytes. It really doesn't look like over-allocating these by a few bytes can cause problems, so I just unconditionally set these to the 64-bit version of the stuct's length (but I didn't test under 32-bit after this change, so someone should verify the exposure). And that's all there is to the 64-bit "port". Thank you for providing this module, COM port communication is still relevant in Windows and I could not find any alternatives for use with Perl. Christopher Oicles
Subject: Re: [rt.cpan.org #113337] Does not work on 64-bit Windows
Date: Mon, 19 Dec 2016 21:33:58 -0500
To: bug-Win32-SerialPort [...] rt.cpan.org
From: Bbirthisel <bbirthisel [...] aol.com>
I still have some 32-bit Perl installs available (and even a 32-bit Windows or two). So I'll try it out. Thanks. -bill Show quoted text
-----Original Message----- From: Oicles, Christopher via RT <bug-Win32-SerialPort@rt.cpan.org> To: undisclosed-recipients:; Sent: Mon, Dec 19, 2016 7:52 pm Subject: Re: [rt.cpan.org #113337] Does not work on 64-bit Windows Queue: Win32-SerialPort Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=113337 > The only problem with this module on 64-bit windows is the layout of the OVERLAPPED struct. The 32-bit version of this struct has a size of 20 bytes, but the 64-bit version is 32 bytes, because the fields "Internal", "InternalHigh" and "hEvent" are all quadwords instead of doublewords ("Pointer" also becomes a quadword, but it is part of a union which is quadword-sized in both 32- and 64-bit versions, and it is not used in Win32API::CommPort). The fix is trivial, and allows both bitnesses to share the same Perl Module. Here are the edits I made to CommPort.pm which got it working: Line 467 Original: my $OVERLAPPEDformat="LLLLL"; Edited: my $OVERLAPPEDformat = (length pack 'P') * 8 == 32 ? "LLLLL" : "QQLLQ"; # "length pack 'P'" gives you the size of a null pointer, then I multiply by 8 to get a bit count, just for clarity. Lines 768 and 769 Original: $self->{"_R_OVERLAP"} = " "x24; $self->{"_W_OVERLAP"} = " "x24; Edited: $self->{"_R_OVERLAP"} = " "x32; $self->{"_W_OVERLAP"} = " "x32; # These lines populate the fields with some default (and invalid) bytes. It really doesn't look like over-allocating these by a few bytes can cause problems, so I just unconditionally set these to the 64-bit version of the stuct's length (but I didn't test under 32-bit after this change, so someone should verify the exposure). And that's all there is to the 64-bit "port". Thank you for providing this module, COM port communication is still relevant in Windows and I could not find any alternatives for use with Perl. Christopher Oicles