http://bugs.winehq.com/show_bug.cgi?id=1676
Summary: WriteFile threw an exception when calling it with a Timeout set Product: Wine Version: 20030813 Platform: Other OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-files AssignedTo: wine-bugs@winehq.com ReportedBy: pschranz@caracal-tech.com
This Win32 call:
WriteFile( m_handle, (VOID *) buf, len, &byteswritten, NULL );
generated an exception. I opened the port this way:
(hport = CreateFile( port, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ) where port is COM1. This is synchronous I/O (not overlapped). I set a timeout for the port:
if ( SetCommTimeouts( hPort, &m_tmo ) == 0)
In the wine file .../wine/files/file.c the method BOOL WINAPI WriteFile(...) does not set the local pointer PLARGE_INTEGER poffset under the above circumstances since its not overlapped. When the kernel method NtWriteFile is called this pointer is passed in and accessed since a timeout has been set. Here's the logic for that in .../wine/dlls/ntdll/file.c in the method NTSTATUS WINAPI NtWriteFile(...)
if ( flags & (FD_FLAG_OVERLAPPED|FD_FLAG_TIMEOUT)) { --snip-- ovp->offset = offset->s.LowPart; --snip-- }
Since offset is NULL this throws an exception. I believe this is a bug.
Paul