Module: wine Branch: master Commit: 31907e0c964f2edd67b149b41534adb8539ead79 URL: http://source.winehq.org/git/wine.git/?a=commit;h=31907e0c964f2edd67b149b415...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Jun 7 16:32:56 2012 +0200
urlmon: Improved ERROR_INTERNET_SEC_CERT_REV_FAILED error handling.
---
dlls/urlmon/http.c | 61 ++++++++++++++++++++++++++++++--------------------- 1 files changed, 36 insertions(+), 25 deletions(-)
diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c index a030d0b..d5f2b33 100644 --- a/dlls/urlmon/http.c +++ b/dlls/urlmon/http.c @@ -193,35 +193,46 @@ static HRESULT handle_http_error(HttpProtocol *This, DWORD error) } }
- hres = IServiceProvider_QueryService(serv_prov, &IID_IWindowForBindingUI, &IID_IWindowForBindingUI, - (void**)&wfb_ui); - if(SUCCEEDED(hres)) { - const IID *iid_reason; - - if(security_problem) - iid_reason = &IID_IHttpSecurity; - else if(error == ERROR_INTERNET_INCORRECT_PASSWORD) - iid_reason = &IID_IAuthenticate; - else - iid_reason = &IID_IWindowForBindingUI; + switch(error) { + case ERROR_INTERNET_SEC_CERT_REV_FAILED: + if(hres == S_FALSE) { + hres = internet_error_to_hres(error); + }else { + /* Silently ignore the error. We will get more detailed error from wininet anyway. */ + set_security_flag(This, SECURITY_FLAG_IGNORE_REVOCATION); + hres = RPC_E_RETRY; + } + break;
- hres = IWindowForBindingUI_GetWindow(wfb_ui, iid_reason, &hwnd); - IWindowForBindingUI_Release(wfb_ui); - if(FAILED(hres)) - hwnd = NULL; - } + default: + hres = IServiceProvider_QueryService(serv_prov, &IID_IWindowForBindingUI, &IID_IWindowForBindingUI, (void**)&wfb_ui); + if(SUCCEEDED(hres)) { + const IID *iid_reason; + + if(security_problem) + iid_reason = &IID_IHttpSecurity; + else if(error == ERROR_INTERNET_INCORRECT_PASSWORD) + iid_reason = &IID_IAuthenticate; + else + iid_reason = &IID_IWindowForBindingUI; + + hres = IWindowForBindingUI_GetWindow(wfb_ui, iid_reason, &hwnd); + IWindowForBindingUI_Release(wfb_ui); + if(FAILED(hres)) + hwnd = NULL; + }
- IServiceProvider_Release(serv_prov);
- 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; + 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; + res = InternetErrorDlg(hwnd, This->base.request, error, dlg_flags, NULL); + hres = res == ERROR_INTERNET_FORCE_RETRY || res == ERROR_SUCCESS ? RPC_E_RETRY : internet_error_to_hres(error); + }
- return internet_error_to_hres(error); + IServiceProvider_Release(serv_prov); + return hres; }
static ULONG send_http_request(HttpProtocol *This)