urlmon: Better pending read handling.

This commit is contained in:
Jacek Caban 2006-05-25 18:40:47 +02:00 committed by Alexandre Julliard
parent 8b69bf72da
commit 27b5c54f56

View File

@ -333,6 +333,7 @@ static HRESULT WINAPI ProtocolStream_Read(IStream *iface, void *pv,
{
ProtocolStream *This = STREAM_THIS(iface);
DWORD read = 0, pread = 0;
HRESULT hres;
TRACE("(%p)->(%p %ld %p)\n", This, pv, cb, pcbRead);
@ -354,9 +355,14 @@ static HRESULT WINAPI ProtocolStream_Read(IStream *iface, void *pv,
return S_OK;
}
IInternetProtocol_Read(This->protocol, (PBYTE)pv+read, cb-read, &pread);
hres = IInternetProtocol_Read(This->protocol, (PBYTE)pv+read, cb-read, &pread);
*pcbRead = read + pread;
if(hres == E_PENDING)
return E_PENDING;
else if(FAILED(hres))
FIXME("Read failed: %08lx\n", hres);
return read || pread ? S_OK : S_FALSE;
}