From ef79c38e766d16cacafdc212717ce1684dd73893 Mon Sep 17 00:00:00 2001 From: Martin Wilck Date: Tue, 23 Apr 2002 19:27:51 +0000 Subject: [PATCH] Avoid segfault with overlapped WriteFile() calls. --- files/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/file.c b/files/file.c index 07ea93a607c..2ca5e7415e4 100644 --- a/files/file.c +++ b/files/file.c @@ -1740,9 +1740,9 @@ static BOOL FILE_WriteFileEx(HANDLE hFile, LPCVOID buffer, DWORD bytesToWrite, goto error; } - ovp->async.ops = &fileio_async_ops; + ovp->async.ops = ( lpCompletionRoutine ? &fileio_async_ops : &fileio_nocomp_async_ops ); ovp->async.handle = hFile; - ovp->async.fd = FILE_GetUnixHandle( hFile, GENERIC_WRITE ); + ovp->async.fd = fd; ovp->async.type = ASYNC_TYPE_WRITE; ovp->async.func = FILE_AsyncWriteService; ovp->lpOverlapped = overlapped;