Updater: stop download if window closed/thread aborted

git-svn-id: svn://svn.code.sf.net/p/processhacker/code@4987 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
dmex
2012-04-16 03:23:49 +00:00
parent 1e63beb1fb
commit 468bfe00d4
+4 -2
View File
@@ -400,7 +400,8 @@ static NTSTATUS DownloadUpdateThreadStart(
while ((nReadFile = InternetReadFile(hRequest, buffer, BUFFER_LEN, &dwBytesRead)))
{
if (dwBytesRead == 0)
// If we get zero bytes or the download thread was closed.
if (dwBytesRead == 0 || !DownloadThreadHandle)
break;
if (!nReadFile)
@@ -442,7 +443,8 @@ static NTSTATUS DownloadUpdateThreadStart(
while ((nReadFile = InternetReadFile(hRequest, buffer, BUFFER_LEN, &dwBytesRead)))
{
if (dwBytesRead == 0)
// If we get zero bytes or the download thread was closed.
if (dwBytesRead == 0 || !DownloadThreadHandle)
break;
if (!nReadFile)