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.
https://bugs.winehq.org/show_bug.cgi?id=54818
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |hans@meelstraat.net Keywords| |source, testcase
https://bugs.winehq.org/show_bug.cgi?id=54818
--- Comment #1 from Hans Leidekker hans@meelstraat.net --- (In reply to François Gouget from comment #0)
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.
Is that Windows machine configured to be part of my.domain?
https://bugs.winehq.org/show_bug.cgi?id=54818
--- Comment #2 from François Gouget fgouget@codeweavers.com --- It gets its configuration from the same DHCP server. So its "Primary DNS suffix" setting (and also "Connection-specific DNS Suffix" and "DNS Suffix earch List" in the ipconfig output) matches the "domain" and "search" lines of the Debian machine's /etc/resolv.conf file.
But to be sure there's no confusion, it's not part of a Windows domain.
https://bugs.winehq.org/show_bug.cgi?id=54818
--- Comment #3 from Hans Leidekker hans@meelstraat.net --- (In reply to François Gouget from comment #2)
It gets its configuration from the same DHCP server. So its "Primary DNS suffix" setting (and also "Connection-specific DNS Suffix" and "DNS Suffix earch List" in the ipconfig output) matches the "domain" and "search" lines of the Debian machine's /etc/resolv.conf file.
Right, otherwise Windows can't be expected to try wpad.my.domain. Perhaps something else is needed to trigger proxy URL detection, or perhaps it shouldn't be reported in this case as you suggested.
https://bugs.winehq.org/show_bug.cgi?id=54818
--- Comment #4 from François Gouget fgouget@codeweavers.com --- Created attachment 74322 --> https://bugs.winehq.org/attachment.cgi?id=74322 wininet/tests: Add more proxy tests and traces.
So with the wpad DNS entry in place, a wpad.dat file on the web server and the attached patch Windows 10 gives me:
internet.c:181: DHCP: res=0 gle 12180 proxy= internet.c:189: DNS: res=1 gle 0 proxy=http://ns.vmbr/wpad.dat internet.c:197: proxy: retval=0 len=12 internet.c:203: proxy: retval=1 len=12 internet.c:204: proxy=(null) bypass=(null) internet.c:1681: Internet Connection: Flags 0x12 - Name 'LAN Connection' [...]
Which means: * Windows does detect my wpad configuration. * Only with the IPROXY_AUTO_DETECT_TYPE_DNS_A option, which I guess makes sense since I did not do anything on the DHCP side. * InternetQueryOptionA(NULL, INTERNET_OPTION_PROXY) still claims there is no proxying by default. Not sure why. * InternetQueryOptionW() + INTERNET_PER_CONN_FLAGS still does not add DIRECT+AUTO_PROXY_URL, which I guess is consistent with the previous result.