Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/wininet/dialogs.c | 36 ++++++++++++++++++++++++++++++-
dlls/wininet/tests/internet.c | 40 +++++------------------------------
2 files changed, 40 insertions(+), 36 deletions(-)
diff --git a/dlls/wininet/dialogs.c b/dlls/wininet/dialogs.c
index 25ed1f2a651..b58b7e27f3c 100644
--- a/dlls/wininet/dialogs.c
+++ b/dlls/wininet/dialogs.c
@@ -514,11 +514,17 @@ DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest,
}
break;
}
+
+ case ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED:
+ if(!req)
+ return ERROR_INVALID_PARAMETER;
+ /* fall through */
case ERROR_INTERNET_SEC_CERT_ERRORS:
case ERROR_INTERNET_SEC_CERT_CN_INVALID:
case ERROR_INTERNET_SEC_CERT_DATE_INVALID:
case ERROR_INTERNET_INVALID_CA:
case ERROR_INTERNET_SEC_CERT_REV_FAILED:
+ case ERROR_INTERNET_SEC_CERT_WEAK_SIGNATURE:
if( dwFlags & FLAGS_ERROR_UI_FLAGS_NO_UI ) {
res = ERROR_CANCELLED;
break;
@@ -530,13 +536,41 @@ DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest,
res = DialogBoxParamW( WININET_hModule, MAKEINTRESOURCEW( IDD_INVCERTDLG ),
hWnd, WININET_InvalidCertificateDialog, (LPARAM) ¶ms );
break;
+
+ case ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION:
+ if( dwFlags & FLAGS_ERROR_UI_FLAGS_NO_UI ) {
+ res = ERROR_HTTP_COOKIE_DECLINED;
+ break;
+ }
+ FIXME("Need to display dialog for error %d\n", dwError);
+ break;
+
+ case ERROR_INTERNET_INSERT_CDROM:
+ if(!req)
+ return ERROR_INVALID_PARAMETER;
+ /* fall through */
+ case ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION:
+ case ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT:
+ case ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT:
+ case ERROR_INTERNET_MIXED_SECURITY:
+ case ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR:
+ if( dwFlags & FLAGS_ERROR_UI_FLAGS_NO_UI ) {
+ res = ERROR_CANCELLED;
+ break;
+ }
+ /* fall through */
case ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR:
+ case ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR:
+ case ERROR_INTERNET_CHG_POST_IS_NON_SECURE:
case ERROR_INTERNET_POST_IS_NON_SECURE:
FIXME("Need to display dialog for error %d\n", dwError);
res = ERROR_SUCCESS;
break;
+
default:
- res = ERROR_CANCELLED;
+ if (!(dwFlags & FLAGS_ERROR_UI_FILTER_FOR_ERRORS))
+ res = ERROR_CANCELLED;
+ break;
}
if(req)
diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c
index e83b142e998..8513aabe174 100644
--- a/dlls/wininet/tests/internet.c
+++ b/dlls/wininet/tests/internet.c
@@ -1566,29 +1566,14 @@ static void test_InternetErrorDlg(void)
break;
}
- todo_wine_if(i == ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION ||
- i == ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR ||
- i == ERROR_INTERNET_CHG_POST_IS_NON_SECURE)
- ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i);
+ ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i);
/* Same thing with NULL hwnd */
res = InternetErrorDlg(NULL, req, i, FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
- todo_wine_if(i == ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION ||
- i == ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR ||
- i == ERROR_INTERNET_CHG_POST_IS_NON_SECURE)
- ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i);
+ ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i);
res = InternetErrorDlg(NULL, req, i, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
- todo_wine_if(i != ERROR_INTERNET_INCORRECT_PASSWORD && i != ERROR_INTERNET_SEC_CERT_DATE_INVALID &&
- i != ERROR_INTERNET_SEC_CERT_CN_INVALID && i != ERROR_INTERNET_INVALID_CA &&
- i != ERROR_INTERNET_SEC_CERT_ERRORS && i != ERROR_INTERNET_SEC_CERT_REV_FAILED &&
- i != ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR && i != ERROR_INTERNET_POST_IS_NON_SECURE &&
- i != ERROR_INTERNET_MIXED_SECURITY &&
- i != ERROR_INTERNET_POST_IS_NON_SECURE && i != ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED &&
- i != ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR && i != ERROR_INTERNET_INSERT_CDROM &&
- i != ERROR_INTERNET_SEC_CERT_WEAK_SIGNATURE && i != ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT &&
- i != ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT && i != ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION)
- ok(res == expected2, "Got %d, expected %d (%d)\n", res, expected2, i);
+ ok(res == expected2, "Got %d, expected %d (%d)\n", res, expected2, i);
/* With a null req */
if(test_flags & FLAG_NEEDREQ)
@@ -1598,31 +1583,16 @@ static void test_InternetErrorDlg(void)
}
res = InternetErrorDlg(hwnd, NULL, i, FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
- todo_wine_if(i == ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION ||
- i == ERROR_INTERNET_INSERT_CDROM ||
- i == ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED ||
- i == ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR ||
- i == ERROR_INTERNET_CHG_POST_IS_NON_SECURE)
- ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i);
+ ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i);
res = InternetErrorDlg(NULL, NULL, i, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
- todo_wine_if(i != ERROR_INTERNET_SEC_CERT_DATE_INVALID && i != ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR &&
- i != ERROR_INTERNET_SEC_CERT_CN_INVALID && i != ERROR_INTERNET_INVALID_CA &&
- i != ERROR_INTERNET_SEC_CERT_ERRORS && i != ERROR_INTERNET_SEC_CERT_REV_FAILED &&
- i != ERROR_INTERNET_MIXED_SECURITY && i != ERROR_INTERNET_POST_IS_NON_SECURE &&
- i != ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR && i != ERROR_INTERNET_INCORRECT_PASSWORD &&
- i != ERROR_INTERNET_SEC_CERT_WEAK_SIGNATURE && i != ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT &&
- i != ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT &&
- i != ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION)
- ok(res == expected2, "Got %d, expected %d (%d)\n", res, expected2, i);
+ ok(res == expected2, "Got %d, expected %d (%d)\n", res, expected2, i);
}
res = InternetErrorDlg(NULL, req, 0xdeadbeef, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
-todo_wine
ok(res == ERROR_SUCCESS, "Got %d, expected ERROR_SUCCESS\n", res);
res = InternetErrorDlg(NULL, NULL, 0xdeadbeef, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
-todo_wine
ok(res == ERROR_SUCCESS, "Got %d, expected ERROR_SUCCESS\n", res);
res = InternetCloseHandle(req);
--
2.31.1