- Do not omit mandatory argument to WriteFile. Fixes crash in qmgr_winetest:job

svn path=/trunk/; revision=68739
This commit is contained in:
Thomas Faber 2015-08-17 14:21:13 +00:00
parent db8269be53
commit 5e606558ad

View file

@ -365,6 +365,7 @@ static BOOL transfer_file_http(BackgroundCopyFileImpl *file, URL_COMPONENTSW *uc
DWORD flags = (uc->nScheme == INTERNET_SCHEME_HTTPS) ? WINHTTP_FLAG_SECURE : 0;
char buf[4096];
BOOL ret = FALSE;
DWORD written;
transitionJobState(job, BG_JOB_STATE_QUEUED, BG_JOB_STATE_CONNECTING);
@ -397,7 +398,7 @@ static BOOL transfer_file_http(BackgroundCopyFileImpl *file, URL_COMPONENTSW *uc
break;
}
if (!file->read_size) break;
if (!(ret = WriteFile(handle, buf, file->read_size, NULL, NULL))) break;
if (!(ret = WriteFile(handle, buf, file->read_size, &written, NULL))) break;
EnterCriticalSection(&job->cs);
file->fileProgress.BytesTransferred += file->read_size;