[QMGR]
authorThomas Faber <thomas.faber@reactos.org>
Mon, 17 Aug 2015 14:21:13 +0000 (14:21 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Mon, 17 Aug 2015 14:21:13 +0000 (14:21 +0000)
- Do not omit mandatory argument to WriteFile. Fixes crash in qmgr_winetest:job

svn path=/trunk/; revision=68739

reactos/dll/win32/qmgr/file.c

index cb4c3a4..f3f1b29 100644 (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 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);
 
 
     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;
             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;
 
         EnterCriticalSection(&job->cs);
         file->fileProgress.BytesTransferred += file->read_size;