comm port fix for serial tx: wine/dlls/ntdll/file.c

Hamish hamish_nospam at yahoo.com
Mon Nov 8 20:41:03 CST 2004


Hi,

In regards to this email:
  http://article.gmane.org/gmane.comp.emulators.wine.devel/24835

quoted here:
============================================================
From: Eric Pouech <pouech-eric <at> wanadoo.fr>
Subject: Re: comm brokenness -- any plans to fix?
Newsgroups: gmane.comp.emulators.wine.devel
Date: Fri, 08 Oct 2004 21:25:48 +0200

Kuba Ober a écrit :
> Hi,
> 
> is there anyone willing to fix the serial port borkedness (data going 
> out, but not coming back in)?
you just need to copy the 'if (flags & FD_FLAG_TIMEOUT) {...}' block at 
the top of NtReadFile to the same position in NtWriteFile.
That should to the trick.
A+
============================================================

I didn't see this submitted, so here it is.

This fixes lockups for me outgoing; I'm still having some serial port 
problems but am not sure my tree is clean, etc. so won't complain too 
much now (but please test serial comms if you can!).

I am trying to get some proprietary scientific interface software to run
under wine, but I've been using Bray Terminal as my serial port guinea
pig software:  http://bray.velenje.cx/avr/terminal/
To more generally log a 4800bps NMEA stream from a GPS. (Rx only)


thanks,
Hamish



Here's the patch:
 (against wine-20041019 snapshot; no changes in CVS since Oct 7)


--- wine-20041019/dlls/ntdll/file.c.ORIG        2004-11-09 15:00:12.000000000 +1300
+++ wine-20041019/dlls/ntdll/file.c     2004-11-09 15:01:33.000000000 +1300
@@ -628,6 +628,23 @@
         return STATUS_PIPE_DISCONNECTED;
     }

+    if (flags & FD_FLAG_TIMEOUT)
+    {
+        if (hEvent)
+        {
+            /* this shouldn't happen, but check it */
+            FIXME("NIY-hEvent\n");
+            wine_server_release_fd( hFile, unix_handle );
+            return STATUS_NOT_IMPLEMENTED;
+        }
+        io_status->u.Status = NtCreateEvent(&hEvent, SYNCHRONIZE, NULL, 0, 0);
+        if (io_status->u.Status)
+        {
+            wine_server_release_fd( hFile, unix_handle );
+            return io_status->u.Status;
+        }
+    }
+
     if (flags & (FD_FLAG_OVERLAPPED|FD_FLAG_TIMEOUT))
     {
         async_fileio*   ovp;





More information about the wine-patches mailing list