Commit 229e024a authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

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.
parent 2e99817a
...@@ -229,10 +229,14 @@ static HRESULT WINAPI FileProtocol_Read(IInternetProtocol *iface, void *pv, ...@@ -229,10 +229,14 @@ static HRESULT WINAPI FileProtocol_Read(IInternetProtocol *iface, void *pv,
TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead); TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead);
if (pcbRead)
*pcbRead = 0;
if(!This->file) if(!This->file)
return INET_E_DATA_NOT_AVAILABLE; 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) if(pcbRead)
*pcbRead = read; *pcbRead = read;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment