https://bugs.winehq.org/show_bug.cgi?id=37115
Bug ID: 37115 Summary: Calling ReadFile from WINBASEAPI (WinBase.h) with zero read length causes hang Product: Wine Version: unspecified Hardware: x86 OS: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: robw@sagatech.ca
Our software connects to a serial device using USB-serial adapters. In the process of attempting to create a wrapper for use on OSx, I discovered a hang when I attempted to connect to the device under Wine that does not occur under Windows.
I have tracked it down to the WINBASEAPI ReadFile. Under Windows, if a zero value is passed as the length to read, it handles and returns zero. Under Wine, it causes a "black box" (meaning I can't trace it) hang.
I have worked around this in my code by including a return on zero value for the length, however believe it may be responsible for other serial issues I have seen in researching this problem.