Commit e7ea2d3b authored by Thomas Mullaly's avatar Thomas Mullaly Committed by Alexandre Julliard

urlmon: Improve handling of error codes being returned from client OnStartBinding callback.

parent 39c38cf0
......@@ -1494,7 +1494,10 @@ static HRESULT start_binding(IMoniker *mon, Binding *binding_ctx, IUri *uri, IBi
hres = IBindStatusCallback_OnStartBinding(binding->callback, 0, &binding->IBinding_iface);
if(FAILED(hres)) {
WARN("OnStartBinding failed: %08x\n", hres);
stop_binding(binding, hres == E_ABORT ? hres : INET_E_DOWNLOAD_FAILURE, NULL);
if(hres != E_ABORT && hres != E_NOTIMPL)
hres = INET_E_DOWNLOAD_FAILURE;
stop_binding(binding, hres, NULL);
IBinding_Release(&binding->IBinding_iface);
return hres;
}
......
......@@ -198,6 +198,7 @@ static IBinding *current_binding;
static HANDLE complete_event, complete_event2;
static HRESULT binding_hres;
static HRESULT onsecurityproblem_hres;
static HRESULT abort_hres;
static BOOL have_IHttpNegotiate2, use_bscex, is_async_prot;
static BOOL test_redirect, use_cache_file, callback_read, no_callback, test_abort;
static WCHAR cache_file_name[MAX_PATH];
......@@ -1562,8 +1563,8 @@ static HRESULT WINAPI statusclb_OnStartBinding(IBindStatusCallbackEx *iface, DWO
ok(hres == E_NOINTERFACE, "Could not get IID_IWinInetHttpInfo: %08x\n", hres);
if(abort_start) {
binding_hres = E_ABORT;
return E_ABORT;
binding_hres = abort_hres;
return abort_hres;
}
return S_OK;
......@@ -2850,7 +2851,7 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t)
ok(hres == E_FAIL, "Got %08x\n", hres);
CHECK_CALLED(OnStopBinding);
} else if(abort_start)
ok(hres == E_ABORT, "IMoniker_BindToStorage failed: %08x, expected E_ABORT\n", hres);
ok(hres == abort_hres, "IMoniker_BindToStorage failed: %08x, expected %08x\n", hres, abort_hres);
else if(abort_progress)
ok(hres == MK_S_ASYNCHRONOUS, "IMoniker_BindToStorage failed: %08x\n", hres);
else if(no_callback) {
......@@ -3634,7 +3635,12 @@ START_TEST(url)
trace("http test (short response, to object)...\n");
test_BindToObject(HTTP_TEST, 0);
trace("http test (abort start binding)...\n");
trace("http test (abort start binding E_NOTIMPL)...\n");
abort_hres = E_NOTIMPL;
test_BindToStorage(HTTP_TEST, BINDTEST_ABORT_START, TYMED_FILE);
trace("http test (abort start binding E_ABORT)...\n");
abort_hres = E_ABORT;
test_BindToStorage(HTTP_TEST, BINDTEST_ABORT_START, TYMED_FILE);
trace("http test (abort progress)...\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment