https://bugs.winehq.org/show_bug.cgi?id=54818
Bug ID: 54818 Summary: wininet:internet - test_InternetQueryOptionA() fails in Wine when wpad.my.domain exists Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: wininet Assignee: wine-bugs@winehq.org Reporter: fgouget@codeweavers.com Distribution: ---
wininet:internet - test_InternetQueryOptionA() fails in Wine when wpad.my.domain exists:
internet.c:1305: Test failed: Retrieved flags should've been PROXY_TYPE_PROXY, was: 7 internet.c:1339: Test failed: Retrieved flags should've been PROXY_TYPE_DIRECT, was: 5 internet.c:1369: Test marked todo: Retrieved flags should've been PROXY_TYPE_PROXY | PROXY_TYPE_DIRECT, was: 7 internet.c:1436: Test failed: Retrieved flags should've been PROXY_TYPE_PROXY, was: 7
See https://test.winehq.org/data/patterns.html#wininet:internet
Where: 1 == PROXY_TYPE_DIRECT 2 == PROXY_TYPE_PROXY 4 == PROXY_TYPE_AUTO_PROXY_URL
This is because, when wpad.my.domain exists, url is set in query_global_option() so it automatically adds the DIRECT + AUTO_PROXY_URL flags:
if (url) /* native includes PROXY_TYPE_DIRECT even if PROXY_TYPE_PROXY is set */ optionW->Value.dwValue |= PROXY_TYPE_DIRECT|PROXY_TYPE_AUTO_PROXY_URL;
url comes from get_proxy_autoconfig_url() which in my case gets it from detect_proxy_autoconfig_url_dns(). That's normal given the way my DNS server is configured.
However on the same network Windows 10 does not add these flags and the tests succeed. So Wine is doing something wrong there.
Also note that, in my case, although wpad.my.domain exists, http://wpad.my.domain/wpad.dat returns 404. Also InternetQueryOptionA(... INTERNET_OPTION_PROXY ...) returns lpszProxy == NULL and lpszProxyBypass == NULL. So in practice there is no proxy.
Maybe the issue is that query_global_option() does not look that far.