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:
parent
2e99817a40
commit
229e024a53
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue