https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c33584a490ea75e9b2435…
commit c33584a490ea75e9b2435a2d7618c4535eb796d4
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Mon Jun 4 03:57:53 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Mon Jun 4 03:57:53 2018 +0100
[WININET_WINETEST] Sync with Wine Staging 3.9. CORE-14656
---
modules/rostests/winetests/wininet/http.c | 15 +++++-
modules/rostests/winetests/wininet/internet.c | 72 ++++++++++++++++++++++++++-
2 files changed, 83 insertions(+), 4 deletions(-)
diff --git a/modules/rostests/winetests/wininet/http.c
b/modules/rostests/winetests/wininet/http.c
index 6edb8ffe41..1f61b9218a 100644
--- a/modules/rostests/winetests/wininet/http.c
+++ b/modules/rostests/winetests/wininet/http.c
@@ -5876,11 +5876,22 @@ typedef struct {
} cert_struct_test_t;
static const cert_struct_test_t test_winehq_org_cert = {
+ "US\r\n"
+ "55114\r\n"
+ "MN\r\n"
+ "Saint Paul\r\n"
+ "Ste 120\r\n"
+ "700 Raymond Ave\r\n"
+ "CodeWeavers\r\n"
+ "IT\r\n"
+ "Secure Link SSL Wildcard\r\n"
"*.winehq.org",
"US\r\n"
- "GeoTrust Inc.\r\n"
- "RapidSSL SHA256 CA"
+ "VA\r\n"
+ "Herndon\r\n"
+ "Network Solutions L.L.C.\r\n"
+ "Network Solutions OV Server CA 2"
};
static const cert_struct_test_t test_winehq_com_cert = {
diff --git a/modules/rostests/winetests/wininet/internet.c
b/modules/rostests/winetests/wininet/internet.c
index b4bbe0f5f2..39c698f5db 100644
--- a/modules/rostests/winetests/wininet/internet.c
+++ b/modules/rostests/winetests/wininet/internet.c
@@ -1168,6 +1168,9 @@ static void test_InternetSetOption(void)
ret = InternetSetOptionA(req, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0);
ok(ret == TRUE, "InternetSetOption should've succeeded\n");
+ ret = InternetSetOptionA(con, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0);
+ ok(ret == TRUE, "InternetSetOption should've succeeded\n");
+
ret = InternetSetOptionA(ses, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0);
ok(ret == TRUE, "InternetSetOption should've succeeded\n");
@@ -1176,8 +1179,13 @@ static void test_InternetSetOption(void)
SetLastError(0xdeadbeef);
ret = InternetSetOptionA(req, INTERNET_OPTION_REFRESH, NULL, 0);
- todo_wine ok(ret == FALSE, "InternetSetOption should've failed\n");
- todo_wine ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
"GetLastError() = %x\n", GetLastError());
+ ok(ret == FALSE, "InternetSetOption should've failed\n");
+ ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() =
%u\n", GetLastError());
+
+ SetLastError(0xdeadbeef);
+ ret = InternetSetOptionA(con, INTERNET_OPTION_REFRESH, NULL, 0);
+ ok(ret == FALSE, "InternetSetOption should've failed\n");
+ ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() =
%u\n", GetLastError());
ret = InternetCloseHandle(req);
ok(ret == TRUE, "InternetCloseHandle failed: 0x%08x\n", GetLastError());
@@ -1811,6 +1819,65 @@ todo_wine
ok(!buffer[0], "Expected 0 bytes, got %u\n", lstrlenW(buffer));
}
+static void test_format_message(HMODULE hdll)
+{
+ DWORD ret;
+ CHAR out[0x100];
+
+ /* These messages come from wininet and not the system. */
+ ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM , NULL, ERROR_INTERNET_TIMEOUT,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out),
NULL);
+ ok(ret == 0, "FormatMessageA returned %d\n", ret);
+
+ ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_TIMEOUT,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out),
NULL);
+ ok(ret != 0, "FormatMessageA returned %d\n", ret);
+
+ ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll,
ERROR_INTERNET_INTERNAL_ERROR,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out),
NULL);
+ ok(ret != 0, "FormatMessageA returned %d\n", ret);
+
+ ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_INVALID_URL,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out),
NULL);
+ ok(ret != 0, "FormatMessageA returned %d\n", ret);
+
+ ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll,
ERROR_INTERNET_UNRECOGNIZED_SCHEME,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out),
NULL);
+ ok(ret != 0, "FormatMessageA returned %d\n", ret);
+
+ ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll,
ERROR_INTERNET_NAME_NOT_RESOLVED,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out),
NULL);
+ ok(ret != 0, "FormatMessageA returned %d\n", ret);
+
+ ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll,
ERROR_INTERNET_INVALID_OPERATION,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out),
NULL);
+ ok(ret != 0 || broken(!ret) /* XP, w2k3 */, "FormatMessageA returned %d\n",
ret);
+
+ ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll,
ERROR_INTERNET_OPERATION_CANCELLED,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out),
NULL);
+ ok(ret != 0, "FormatMessageA returned %d\n", ret);
+
+ ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll,
ERROR_INTERNET_ITEM_NOT_FOUND,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out),
NULL);
+ ok(ret != 0, "FormatMessageA returned %d\n", ret);
+
+ ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll,
ERROR_INTERNET_CANNOT_CONNECT,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out),
NULL);
+ ok(ret != 0, "FormatMessageA returned %d\n", ret);
+
+ ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll,
ERROR_INTERNET_CONNECTION_ABORTED,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out),
NULL);
+ ok(ret != 0, "FormatMessageA returned %d\n", ret);
+
+ ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll,
ERROR_INTERNET_SEC_CERT_DATE_INVALID,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out),
NULL);
+ ok(ret != 0, "FormatMessageA returned %d\n", ret);
+
+ ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll,
ERROR_INTERNET_SEC_CERT_CN_INVALID,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out),
NULL);
+ ok(ret != 0, "FormatMessageA returned %d\n", ret);
+}
+
/* ############################### */
START_TEST(internet)
@@ -1877,4 +1944,5 @@ START_TEST(internet)
test_InternetSetOption();
test_end_browser_session();
+ test_format_message(hdll);
}