urlmon: Allow NULL IBindStatusCallback in URLOpenBlockingStream.

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Andrew Eikum 2016-06-21 14:13:05 -05:00 committed by Alexandre Julliard
parent 58e0972c5c
commit 4ac74d1083
2 changed files with 22 additions and 1 deletions

View File

@ -328,6 +328,21 @@ static void test_URLOpenBlockingStreamW(void)
ok(pStream != NULL, "pStream is NULL\n");
if(pStream)
{
buffer[0] = 0;
hr = IStream_Read(pStream, buffer, sizeof(buffer), NULL);
ok(hr == S_OK, "IStream_Read failed with error 0x%08x\n", hr);
ok(!memcmp(buffer, szHtmlDoc, sizeof(szHtmlDoc)-1), "read data differs from file\n");
IStream_Release(pStream);
}
hr = URLOpenBlockingStreamW(NULL, INDEX_HTML, &pStream, 0, NULL);
ok(hr == S_OK, "URLOpenBlockingStreamW failed with error 0x%08x\n", hr);
ok(pStream != NULL, "pStream is NULL\n");
if(pStream)
{
buffer[0] = 0;
hr = IStream_Read(pStream, buffer, sizeof(buffer), NULL);
ok(hr == S_OK, "IStream_Read failed with error 0x%08x\n", hr);
ok(!memcmp(buffer, szHtmlDoc, sizeof(szHtmlDoc)-1), "read data differs from file\n");

View File

@ -122,12 +122,18 @@ static HRESULT WINAPI ProxyBindStatusCallback_OnStopBinding(IBindStatusCallback
static HRESULT WINAPI ProxyBindStatusCallback_GetBindInfo(IBindStatusCallback *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
{
DWORD size = pbindinfo->cbSize;
ProxyBindStatusCallback *This = impl_from_IBindStatusCallback(iface);
if(This->pBSC)
return IBindStatusCallback_GetBindInfo(This->pBSC, grfBINDF, pbindinfo);
return E_INVALIDARG;
memset(pbindinfo, 0, size);
pbindinfo->cbSize = size;
*grfBINDF = 0;
return S_OK;
}
static HRESULT WINAPI ProxyBindStatusCallback_OnDataAvailable(IBindStatusCallback *iface, DWORD grfBSCF,