--- See also https://bugs.winehq.org/show_bug.cgi?id=54818
-- v2: wininet/tests: Add more proxy tests. wininet: Add constants for DetectAutoProxyUrl().
From: Francois Gouget fgouget@codeweavers.com
--- include/wininet.h | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/include/wininet.h b/include/wininet.h index f1c4e312281..158b005d36c 100644 --- a/include/wininet.h +++ b/include/wininet.h @@ -1776,6 +1776,9 @@ typedef BOOL (CALLBACK *pfnInternetGetProxyInfo)(LPCSTR, DWORD, LPSTR, DWORD, LP typedef BOOL (CALLBACK *pfnInternetInitializeAutoProxyDll)(DWORD, LPSTR, LPSTR, AutoProxyHelperFunctions *, LPAUTO_PROXY_SCRIPT_BUFFER);
+#define PROXY_AUTO_DETECT_TYPE_DHCP 1 +#define PROXY_AUTO_DETECT_TYPE_DNS_A 2 + BOOL WINAPI InternetInitializeAutoProxyDll(DWORD); BOOL WINAPI DetectAutoProxyUrl(LPSTR, DWORD, DWORD);
From: Francois Gouget fgouget@codeweavers.com
--- See also https://bugs.winehq.org/show_bug.cgi?id=54818
Note: the todo_wine() is because Wine's DetectAutoProxyUrl() returns ERROR_ERROR_CALL_NOT_IMPLEMENTED instead of ERROR_WINHTTP_AUTODETECTION_FAILED. We could probably make it return the latter though the difference probably does not matter. --- dlls/wininet/tests/internet.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c index fde1b65f5d2..7cd21efcd36 100644 --- a/dlls/wininet/tests/internet.c +++ b/dlls/wininet/tests/internet.c @@ -49,6 +49,11 @@ static BOOL (WINAPI *pInternetGetCookieExW)(LPCWSTR,LPCWSTR,LPWSTR,LPDWORD,DWORD static BOOL (WINAPI *pInternetGetConnectedStateExA)(LPDWORD,LPSTR,DWORD,DWORD); static BOOL (WINAPI *pInternetGetConnectedStateExW)(LPDWORD,LPWSTR,DWORD,DWORD);
+#ifndef ERROR_WINHTTP_AUTODETECTION_FAILED +#define ERROR_WINHTTP_AUTODETECTION_FAILED 12180 +#endif + + /* ############################### */
static void test_InternetCanonicalizeUrlA(void) @@ -163,11 +168,27 @@ static void test_InternetQueryOptionA(void) { HINTERNET hinet,hurl; DWORD len, val; + INTERNET_PROXY_INFOA *pi; DWORD err; static const char useragent[] = {"Wininet Test"}; + char proxy[256]; char *buffer; - int retval; - BOOL res; + BOOL retval, res; + + SetLastError(0xdeadfeed); + memset(proxy, 0, sizeof(proxy)); + res = DetectAutoProxyUrl(proxy, sizeof(proxy), PROXY_AUTO_DETECT_TYPE_DHCP); + todo_wine ok((res && proxy[0]) || + (!res && GetLastError() == ERROR_WINHTTP_AUTODETECTION_FAILED && !proxy[0]), + "unexpected DHCP proxy result: %d gle %lu proxy %s\n", res, GetLastError(), proxy); + + SetLastError(0xdeadfeed); + memset(proxy, 0, sizeof(proxy)); + res = DetectAutoProxyUrl(proxy, sizeof(proxy), PROXY_AUTO_DETECT_TYPE_DNS_A); + todo_wine ok((res && proxy[0]) || + (!res && GetLastError() == ERROR_WINHTTP_AUTODETECTION_FAILED && !proxy[0]) || + broken(!res && GetLastError() == ERROR_NOT_FOUND && !proxy[0]), + "unexpected DNS proxy result: %d gle %lu proxy %s\n", res, GetLastError(), proxy);
SetLastError(0xdeadbeef); len = 0xdeadbeef; @@ -175,6 +196,12 @@ static void test_InternetQueryOptionA(void) ok(!retval && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got wrong error %x(%lu)\n", retval, GetLastError()); ok(len >= sizeof(INTERNET_PROXY_INFOA) && len != 0xdeadbeef,"len = %lu\n", len);
+ pi = HeapAlloc(GetProcessHeap(), 0, len); + retval = InternetQueryOptionA(NULL, INTERNET_OPTION_PROXY, pi, &len); + ok(retval, "Failed (%lu)\n", GetLastError()); + ok(len >= sizeof(INTERNET_PROXY_INFOA) && len != 0xdeadbeef, "len = %lu\n", len); + HeapFree(GetProcessHeap(), 0, pi); + hinet = InternetOpenA(useragent,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL, 0); ok((hinet != 0x0),"InternetOpen Failed\n");
v2: Take into account the error code returned by Windows 7, 8 and 10 1507.
On Thu Apr 13 15:59:31 2023 +0000, **** wrote:
Marvin replied on the mailing list:
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details: The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=131863 Your paranoid android. === w7u_2qxl (32 bit report) === wininet: internet.c:188: Test failed: unexpected DNS proxy result: 0 gle 1168 proxy === w7u_adm (32 bit report) === wininet: internet.c:188: Test failed: unexpected DNS proxy result: 0 gle 1168 proxy === w7u_el (32 bit report) === wininet: internet.c:188: Test failed: unexpected DNS proxy result: 0 gle 1168 proxy === w8 (32 bit report) === wininet: internet.c:188: Test failed: unexpected DNS proxy result: 0 gle 1168 proxy === w8adm (32 bit report) === wininet: internet.c:188: Test failed: unexpected DNS proxy result: 0 gle 1168 proxy === w864 (32 bit report) === wininet: internet.c:188: Test failed: unexpected DNS proxy result: 0 gle 1168 proxy === w1064v1507 (32 bit report) === wininet: internet.c:188: Test failed: unexpected DNS proxy result: 0 gle 1168 proxy === w7pro64 (64 bit report) === wininet: internet.c:188: Test failed: unexpected DNS proxy result: 0 gle 1168 proxy === w864 (64 bit report) === wininet: internet.c:188: Test failed: unexpected DNS proxy result: 0 gle 1168 proxy === w1064v1507 (64 bit report) === wininet: internet.c:188: Test failed: unexpected DNS proxy result: 0 gle 1168 proxy
Theses failures should be fixed by v2.
This merge request was approved by Jacek Caban.