Jacek Caban : urlmon: Correctly handle BINDF_NO_UI in handle_http_error.
Alexandre Julliard
julliard at winehq.org
Wed May 30 13:18:54 CDT 2012
Module: wine
Branch: master
Commit: 45a6619e445cc1b0a1a86811b6ec1e1bbb56b90b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=45a6619e445cc1b0a1a86811b6ec1e1bbb56b90b
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed May 30 16:53:32 2012 +0200
urlmon: Correctly handle BINDF_NO_UI in handle_http_error.
---
dlls/urlmon/http.c | 28 ++++++++++++----------------
1 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c
index e1ac49c..7ec93fc 100644
--- a/dlls/urlmon/http.c
+++ b/dlls/urlmon/http.c
@@ -119,6 +119,9 @@ static HRESULT handle_http_error(HttpProtocol *This, DWORD error)
IWindowForBindingUI *wfb_ui;
IHttpSecurity *http_security;
BOOL security_problem;
+ DWORD dlg_flags;
+ HWND hwnd;
+ DWORD res;
HRESULT hres;
switch(error) {
@@ -183,7 +186,6 @@ static HRESULT handle_http_error(HttpProtocol *This, DWORD error)
hres = IServiceProvider_QueryService(serv_prov, &IID_IWindowForBindingUI, &IID_IWindowForBindingUI,
(void**)&wfb_ui);
if(SUCCEEDED(hres)) {
- HWND hwnd;
const IID *iid_reason;
if(security_problem)
@@ -194,26 +196,20 @@ static HRESULT handle_http_error(HttpProtocol *This, DWORD error)
iid_reason = &IID_IWindowForBindingUI;
hres = IWindowForBindingUI_GetWindow(wfb_ui, iid_reason, &hwnd);
- if(SUCCEEDED(hres) && hwnd)
- {
- DWORD res;
-
- res = InternetErrorDlg(hwnd, This->base.request, error,
- FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS | FLAGS_ERROR_UI_FLAGS_GENERATE_DATA,
- NULL);
-
- if(res == ERROR_INTERNET_FORCE_RETRY || res == ERROR_SUCCESS)
- hres = RPC_E_RETRY;
- else
- hres = E_FAIL;
- }
IWindowForBindingUI_Release(wfb_ui);
+ if(FAILED(hres))
+ hwnd = NULL;
}
IServiceProvider_Release(serv_prov);
- if(hres == RPC_E_RETRY)
- return hres;
+ dlg_flags = FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS | FLAGS_ERROR_UI_FLAGS_GENERATE_DATA;
+ if(This->base.bindf & BINDF_NO_UI)
+ dlg_flags |= FLAGS_ERROR_UI_FLAGS_NO_UI;
+
+ res = InternetErrorDlg(hwnd, This->base.request, error, dlg_flags, NULL);
+ if(res == ERROR_INTERNET_FORCE_RETRY || res == ERROR_SUCCESS)
+ return RPC_E_RETRY;
return internet_error_to_hres(error);
}
More information about the wine-cvs
mailing list