[Bug 1676] New: WriteFile threw an exception when calling it with a Timeout set

Wine Bugs wine-bugs at winehq.com
Fri Aug 22 13:04:39 CDT 2003


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 at winehq.com
        ReportedBy: pschranz at 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

-- 
Configure bugmail: http://bugs.winehq.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the wine-bugs mailing list