Jacek Caban : wininet: Set dwError to 0 in first INTERNET_STATUS_REQUEST_COMPLETE notification.

Alexandre Julliard julliard at winehq.org
Thu Jan 22 08:41:49 CST 2009


Module: wine
Branch: master
Commit: e13781a3158e776f8263127ce82fcbbeccfd6225
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e13781a3158e776f8263127ce82fcbbeccfd6225

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Jan 22 13:48:23 2009 +0100

wininet: Set dwError to 0 in first INTERNET_STATUS_REQUEST_COMPLETE notification.

---

 dlls/wininet/http.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 0dd68fa..ac42f96 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -1636,20 +1636,22 @@ static DWORD HTTPREQ_SetOption(WININETHANDLEHEADER *hdr, DWORD option, void *buf
     return ERROR_INTERNET_INVALID_OPTION;
 }
 
-static void HTTP_ReceiveRequestData(WININETHTTPREQW *req)
+static void HTTP_ReceiveRequestData(WININETHTTPREQW *req, BOOL first_notif)
 {
     INTERNET_ASYNC_RESULT iar;
     BYTE buffer[4096];
+    int available;
     BOOL res;
 
     TRACE("%p\n", req);
 
     res = NETCON_recv(&req->netConnection, buffer,
                 min(sizeof(buffer), req->dwContentLength - req->dwContentRead),
-                MSG_PEEK, (int *)&iar.dwError);
+                MSG_PEEK, &available);
 
     if(res) {
         iar.dwResult = (DWORD_PTR)req->hdr.hInternet;
+        iar.dwError = first_notif ? 0 : available;
     }else {
         iar.dwResult = 0;
         iar.dwError = INTERNET_GetLastError();
@@ -1936,7 +1938,7 @@ static void HTTPREQ_AsyncQueryDataAvailableProc(WORKREQUEST *workRequest)
 {
     WININETHTTPREQW *req = (WININETHTTPREQW*)workRequest->hdr;
 
-    HTTP_ReceiveRequestData(req);
+    HTTP_ReceiveRequestData(req, FALSE);
 }
 
 static DWORD HTTPREQ_QueryDataAvailable(WININETHANDLEHEADER *hdr, DWORD *available, DWORD flags, DWORD_PTR ctx)
@@ -3552,7 +3554,7 @@ lend:
 
     if(lpwhr->lpHttpSession->lpAppInfo->hdr.dwFlags & INTERNET_FLAG_ASYNC) {
         if(bSuccess) {
-            HTTP_ReceiveRequestData(lpwhr);
+            HTTP_ReceiveRequestData(lpwhr, TRUE);
         }else {
             iar.dwResult = (DWORD_PTR)lpwhr->hdr.hInternet;
             iar.dwError = INTERNET_GetLastError();




More information about the wine-cvs mailing list