wine and asyncronous file i/o

Martin Wilck Martin.Wilck at Fujitsu-Siemens.com
Fri Nov 22 05:07:54 CST 2002


Hi Martin,

> I've attached the interesting section of the resulting trace file.
> Maybe you see, what's going on.
> The programs reads a file with 21517 bytes length.
> After fetching five blocks of 4096 bytes correctly, it reads the remaining 
> 1037 bytes. But it does not stop! It reads this last file block continuously.

EOF conditions are nasty. Seems we got it wrong... Please try the
following patch (it should solve your problem). However I guess it needs
regression testing because it changes overlapped ReadFile() semantics
drastically. If this condition turns out to be right, we may actually be
able to get rid of the special treatment of sockets in
FILE_AsyncReadService().

Martin

Index: files/file.c
===================================================================
RCS file: /home/wine/wine/files/file.c,v
retrieving revision 1.170
diff -u -r1.170 file.c
--- files/file.c	21 Nov 2002 03:45:03 -0000	1.170
+++ files/file.c	22 Nov 2002 11:00:47 -0000
@@ -1697,6 +1697,11 @@
         r = FILE_GetNtStatus ();
         goto async_end;
     }
+    else if ( result == 0 )
+    {
+        r = STATUS_END_OF_FILE;
+        goto async_end;
+    }
 
     lpOverlapped->InternalHigh += result;
     TRACE("read %d more bytes %ld/%d so far\n",result,lpOverlapped->InternalHigh,fileio->count);

-- 
Martin Wilck                Phone: +49 5251 8 15113
Fujitsu Siemens Computers   Fax:   +49 5251 8 20409
Heinz-Nixdorf-Ring 1	    mailto:Martin.Wilck at Fujitsu-Siemens.com
D-33106 Paderborn           http://www.fujitsu-siemens.com/primergy








More information about the wine-devel mailing list