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);