Hans Leidekker : wininet: Keep track of the number of bytes written.
Alexandre Julliard
julliard at winehq.org
Wed Apr 8 10:05:33 CDT 2009
Module: wine
Branch: master
Commit: 0fabf540e74d502a3a51ebc2e5fe90f1e7933cd0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0fabf540e74d502a3a51ebc2e5fe90f1e7933cd0
Author: Hans Leidekker <hans at meelstraat.net>
Date: Wed Apr 8 15:21:28 2009 +0200
wininet: Keep track of the number of bytes written.
---
dlls/wininet/http.c | 10 +++++++++-
dlls/wininet/internet.h | 2 ++
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 7b26070..4216e55 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -1875,9 +1875,14 @@ static DWORD HTTPREQ_ReadFileExW(WININETHANDLEHEADER *hdr, INTERNET_BUFFERSW *bu
static BOOL HTTPREQ_WriteFile(WININETHANDLEHEADER *hdr, const void *buffer, DWORD size, DWORD *written)
{
+ BOOL ret;
LPWININETHTTPREQW lpwhr = (LPWININETHTTPREQW)hdr;
- return NETCON_send(&lpwhr->netConnection, buffer, size, 0, (LPINT)written);
+ *written = 0;
+ if ((ret = NETCON_send(&lpwhr->netConnection, buffer, size, 0, (LPINT)written)))
+ lpwhr->dwBytesWritten += *written;
+
+ return ret;
}
static void HTTPREQ_AsyncQueryDataAvailableProc(WORKREQUEST *workRequest)
@@ -3259,6 +3264,7 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders,
{
sprintfW(contentLengthStr, szContentLength, dwContentLength);
HTTP_HttpAddRequestHeadersW(lpwhr, contentLengthStr, -1L, HTTP_ADDREQ_FLAG_ADD_IF_NEW);
+ lpwhr->dwBytesToWrite = dwContentLength;
}
if (lpwhr->lpHttpSession->lpAppInfo->lpszAgent)
{
@@ -3357,6 +3363,8 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders,
NETCON_send(&lpwhr->netConnection, ascii_req, len, 0, &cnt);
HeapFree( GetProcessHeap(), 0, ascii_req );
+ lpwhr->dwBytesWritten = dwOptionalLength;
+
INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
INTERNET_STATUS_REQUEST_SENT,
&len, sizeof(DWORD));
diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h
index fad69bd..8e92788 100644
--- a/dlls/wininet/internet.h
+++ b/dlls/wininet/internet.h
@@ -198,6 +198,8 @@ typedef struct
LPWSTR lpszStatusText;
DWORD dwContentLength; /* total number of bytes to be read */
DWORD dwContentRead; /* bytes of the content read so far */
+ DWORD dwBytesToWrite;
+ DWORD dwBytesWritten;
HTTPHEADERW *pCustHeaders;
DWORD nCustHeaders;
HANDLE hCacheFile;
More information about the wine-cvs
mailing list