EV_RXFLAG emulation

Valentine Sinitsyn Valentine.Sinitsyn at usu.ru
Mon Jul 9 02:33:24 CDT 2007

Hi all,

I spent the last couple of days trying to run one program in Wine. The
program (Easy Wireless Net, end-user tool to control many CDMA modems, if
you are interested in) extensively use EV_RXFLAG event which is
currently unimplemented in Wine. I've made a simplest implementation
possible (fire EV_RXLAG every time you have something in the serial
port input buffer - all the messages come in once anyway) and it
worked just fine with the aforementioned program, so I have two
questions now:

1. Would the patch with such "implementation" for EV_RXFLAG be
accepted to the mainline Wine (my take is having some sort of support
for the feature is always better that not having support at all) ?

2. Of course, a proper implementation of the feature is desirable - i.e.
one should look after EventChar in WaitCommEvent
(ntdll/serial.c:wait_for_event(), to be precise) but unfortunately
this lead to a trouble (I guess it's the reason why EV_RXFLAG is still
unimplemented): you need to "peek" into a buffer or read the data
twice: first time in WaitCommEvent to look for eventchar, and second -
in NtReadFile to actually obtain the data. And of course, it's not
possible, so some sort of buffering must be implemented. Alas, WINE's
architecture doesn't imply any buffering between Unix and Windows
layer as Developer's Guide states. My proposed solution is to read
data in serial.c:wait_comm_event() and store it somewhere; then, in
NtReadFile() one should check whether fd corresponds to serial file
and, if so, look in the corresponding buffer before doing actual read. Does this fit
nicely into WINE's design ? Or there are some other (more correct) approaches to perform
this task?

Thank you in advance.


More information about the wine-devel mailing list