inetcomm: Return S_FALSE if no data is returned in IInternetProtocol::Read.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-02-03 18:58:43 +01:00 committed by Alexandre Julliard
parent a8cfe2eeb5
commit 51e1a08893
2 changed files with 11 additions and 1 deletions

View File

@ -564,10 +564,18 @@ static HRESULT WINAPI MimeHtmlProtocol_Resume(IInternetProtocol *iface)
static HRESULT WINAPI MimeHtmlProtocol_Read(IInternetProtocol *iface, void* pv, ULONG cb, ULONG* pcbRead)
{
MimeHtmlProtocol *This = impl_from_IInternetProtocol(iface);
ULONG read = 0;
HRESULT hres;
TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead);
return IStream_Read(This->stream, pv, cb, pcbRead);
hres = IStream_Read(This->stream, pv, cb, &read);
if(pcbRead)
*pcbRead = read;
if(hres != S_OK)
return hres;
return read ? S_OK : S_FALSE;
}
static HRESULT WINAPI MimeHtmlProtocol_Seek(IInternetProtocol *iface, LARGE_INTEGER dlibMove,

View File

@ -1368,6 +1368,8 @@ static HRESULT WINAPI ProtocolSink_ReportData(IInternetProtocolSink *iface, DWOR
buf[read] = 0;
ok(!strcmp(buf, current_binding_test->data), "unexpected data: %s\n", buf);
hres = IInternetProtocol_Read(current_binding_protocol, buf, sizeof(buf), &read);
ok(hres == S_FALSE, "Read failed: %08x\n", hres);
return S_OK;
}