urlmon: Check the return value of ReadFile and return INET_E_DOWNLOAD_FAILURE is it fails.

Initialise *pcbRead to zero, if the parameter is not NULL.
This commit is contained in:
Rob Shearman 2008-02-15 10:09:25 +00:00 committed by Alexandre Julliard
parent 2e99817a40
commit 229e024a53
1 changed files with 5 additions and 1 deletions

View File

@ -229,10 +229,14 @@ static HRESULT WINAPI FileProtocol_Read(IInternetProtocol *iface, void *pv,
TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead);
if (pcbRead)
*pcbRead = 0;
if(!This->file)
return INET_E_DATA_NOT_AVAILABLE;
ReadFile(This->file, pv, cb, &read, NULL);
if (!ReadFile(This->file, pv, cb, &read, NULL))
return INET_E_DOWNLOAD_FAILURE;
if(pcbRead)
*pcbRead = read;