Always pass a variable as lpNumberOfBytesWritten if =

Colin Finck mail at colinfinck.de
Mon Jun 16 01:05:20 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 b973a79..79e3511 100644=0A=
--- a/dlls/wininet/http.c=0A=
+++ b/dlls/wininet/http.c=0A=
@@ -1619,8 +1619,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=
@@ -1688,7 +1689,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_0026_01C8D1A1.FB833900--




More information about the wine-patches mailing list