[PATCH] Always pass a variable as lpNumberOfBytesWritten if =

Colin Finck mail at colinfinck.de
Sat May 31 15:44:01 CDT 2008


lpOverlapped is set to NULL.=0A=
Wine currently makes no difference here, but under Windows, the =
application will crash if both parameters are set to NULL.=0A=
=0A=
This behaviour was verified by a test application under Windows XP SP2.=0A=
---=0A=
 dlls/wininet/http.c |    7 +++++--=0A=
 1 files changed, 5 insertions(+), 2 deletions(-)=0A=
=0A=
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c=0A=
index 3980e9a..1e5b17c 100644=0A=
--- a/dlls/wininet/http.c=0A=
+++ b/dlls/wininet/http.c=0A=
@@ -1584,8 +1584,9 @@ static DWORD HTTP_Read(WININETHTTPREQW *req, void =
*buffer, DWORD size, DWORD *re=0A=
 =0A=
     if(req->lpszCacheFile) {=0A=
         BOOL res;=0A=
+        DWORD dwBytesWritten;=0A=
 =0A=
-        res =3D WriteFile(req->hCacheFile, buffer, bytes_read, NULL, =
NULL);=0A=
+        res =3D WriteFile(req->hCacheFile, buffer, bytes_read, =
&dwBytesWritten, NULL);=0A=
         if(!res)=0A=
             WARN("WriteFile failed: %u\n", GetLastError());=0A=
     }=0A=
@@ -1654,7 +1655,9 @@ static DWORD HTTP_ReadChunked(WININETHTTPREQW =
*req, void *buffer, DWORD size, DW=0A=
 =0A=
         if (req->lpszCacheFile)=0A=
         {=0A=
-            if (!WriteFile(req->hCacheFile, p, bytes_read, NULL, NULL))=0A=
+            DWORD dwBytesWritten;=0A=
+=0A=
+            if (!WriteFile(req->hCacheFile, p, bytes_read, =
&dwBytesWritten, NULL))=0A=
                 WARN("WriteFile failed: %u\n", GetLastError());=0A=
         }=0A=
         p +=3D bytes_read;=0A=
-- =0A=
1.4.4.2=0A=
=0A=

------=_NextPart_000_002E_01C8C336.090E6DD0--




More information about the wine-patches mailing list