Am Mon, 2002-06-10 um 04.26 schrieb Vincent Béron:
Yeah, DWORD is an unsigned type. The patch below should fix it. Actually, if we trust our own implementation of read and write, we might as well drop that case distinction altogether and simply return fileio->count - fileio->lpOverlapped->InternalHigh.
Martin
--- files/file.c.orig Mon Jun 10 12:52:00 2002 +++ files/file.c Mon Jun 10 12:59:11 2002 @@ -131,8 +131,8 @@ static DWORD fileio_get_async_count (const struct async_private *ovp) { async_fileio *fileio = (async_fileio*) ovp; - DWORD ret = fileio->count - fileio->lpOverlapped->InternalHigh; - return (ret < 0 ? 0 : ret); + return ( fileio->count <= fileio->lpOverlapped->InternalHigh ? + 0 : fileio->count - fileio->lpOverlapped->InternalHigh ); }
static void CALLBACK fileio_call_completion_func (ULONG_PTR data)