urlmon: Allow NULL IBindStatusCallback in UrlOpenStream.

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:09 -05:00 committed by Alexandre Julliard
parent 4ac74d1083
commit a4a8693e89
2 changed files with 16 additions and 1 deletions

View File

@ -380,6 +380,9 @@ static void test_URLOpenStreamW(void)
CHECK_CALLED(OnProgress_ENDDOWNLOADDATA); CHECK_CALLED(OnProgress_ENDDOWNLOADDATA);
CHECK_CALLED(OnDataAvailable); CHECK_CALLED(OnDataAvailable);
CHECK_CALLED(OnStopBinding); CHECK_CALLED(OnStopBinding);
hr = URLOpenStreamW(NULL, INDEX_HTML, 0, NULL);
ok(hr == S_OK, "URLOpenStreamW failed with error 0x%08x\n", hr);
} }
START_TEST(stream) START_TEST(stream)

View File

@ -182,8 +182,20 @@ static const IBindStatusCallbackVtbl BlockingBindStatusCallbackVtbl =
static HRESULT WINAPI AsyncBindStatusCallback_GetBindInfo(IBindStatusCallback *iface, DWORD *grfBINDF, BINDINFO *pbindinfo) static HRESULT WINAPI AsyncBindStatusCallback_GetBindInfo(IBindStatusCallback *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
{ {
ProxyBindStatusCallback *This = impl_from_IBindStatusCallback(iface); ProxyBindStatusCallback *This = impl_from_IBindStatusCallback(iface);
HRESULT hr = IBindStatusCallback_GetBindInfo(This->pBSC, grfBINDF, pbindinfo); HRESULT hr = S_OK;
if(This->pBSC)
hr = IBindStatusCallback_GetBindInfo(This->pBSC, grfBINDF, pbindinfo);
else{
DWORD size = pbindinfo->cbSize;
memset(pbindinfo, 0, size);
pbindinfo->cbSize = size;
*grfBINDF = 0;
}
*grfBINDF |= BINDF_PULLDATA | BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE; *grfBINDF |= BINDF_PULLDATA | BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE;
return hr; return hr;
} }