https://bugs.winehq.org/show_bug.cgi?id=40598
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|regression |download CC| |focht@gmx.net URL|content.warframe.com/dl/War |http://content.warframe.com |frame.msi |/dl/Warframe.msi Summary|Warframe launcher |Warframe 'launcher.exe' |connection timeout |reports 'update failed' | |('InternetCrackUrlW' must | |resize buffer when URL | |canonicalization fails due | |to insufficient buffer)
--- Comment #11 from Anastasius Focht focht@gmx.net --- Hello folks,
revisiting, still present.
--- snip --- $ pwd /home/focht/.wine/drive_c/users/focht/Local Settings/Application Data/Warframe/Downloaded/Dev/Tools
$ WINEDEBUG=+seh,+relay,+wininet,+shell wine ./Launcher.exe >>log.txt 2>&1 ... 0058:trace:wininet:InternetCrackUrlW (L"http://origin.warframe.com" 0 10000000 0x1ed538) 0058:trace:wininet:InternetCanonicalizeUrlW (L"http://origin.warframe.com", 0xafcd648, 0xfb2fd3c, 0x30000000) buffer length: 27 0058:trace:shell:UrlCanonicalizeW (L"http://origin.warframe.com", 0xafcd648, 0xfb2fd3c, 0x90000000) *pcchCanonicalized: 27 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"ht"> 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"htt"> 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"http"> 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"http:"> 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"http://%22%3E 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"http://origin.warframe.com/%22%3E 0058:trace:shell:UrlUnescapeW (L"http://origin.warframe.com/", (nil), 0xfb2f9b4, 0x00100000) 0058:trace:shell:UrlUnescapeW result L"http://origin.warframe.com/" 0058:trace:wininet:InternetConnectW (0x1, L"", 0, L"", 0x1ed138, 3, 0, 0) 0058:trace:wininet:WININET_AddRef 0xafc6380 -> refcount = 2 0058:trace:wininet:get_handle_object handle 1 -> 0xafc6380 0058:trace:wininet:HTTP_Connect --> 0058:trace:wininet:WININET_Release object 0xafc6380 refcount = 1 0058:trace:wininet:InternetConnectW returning (nil) 0058:Call KERNEL32.OutputDebugStringW(004a5720 L"Could not open connection\n") ret=004178ba 0058:Ret KERNEL32.OutputDebugStringW() retval=0fb2eda0 ret=004178ba 0058:trace:wininet:InternetCloseHandle 0x1 ... --- snip ---
With patch:
--- snip --- ... 0058:trace:wininet:InternetCrackUrlW (L"http://origin.warframe.com" 0 10000000 0x1ed538) 0058:trace:wininet:InternetCanonicalizeUrlW (L"http://origin.warframe.com", 0x93f0fa8, 0xc0afd30, 0x30000000) buffer length: 27 0058:trace:shell:UrlCanonicalizeW (L"http://origin.warframe.com", 0x93f0fa8, 0xc0afd30, 0x90000000) *pcchCanonicalized: 27 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"ht"> 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"htt"> 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"http"> 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"http:"> 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"http://%22%3E 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"http://origin.warframe.com/%22%3E 0058:trace:shell:UrlUnescapeW (L"http://origin.warframe.com/", (nil), 0xc0af9a4, 0x00100000) 0058:trace:shell:UrlUnescapeW result L"http://origin.warframe.com/" 0058:trace:wininet:InternetCanonicalizeUrlW (L"http://origin.warframe.com", 0x951cd88, 0xc0afd30, 0x30000000) buffer length: 28 0058:trace:shell:UrlCanonicalizeW (L"http://origin.warframe.com", 0x951cd88, 0xc0afd30, 0x90000000) *pcchCanonicalized: 28 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"ht"> 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"htt"> 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"http"> 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"http:"> 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"http://%22%3E 0058:trace:shell:UrlCanonicalizeW Simplified, orig <L"http://origin.warframe.com%22%3E, simple <L"http://origin.warframe.com/%22%3E 0058:trace:shell:UrlUnescapeW (L"http://origin.warframe.com/", (nil), 0xc0af9a4, 0x00100000) 0058:trace:shell:UrlUnescapeW result L"http://origin.warframe.com/" 0058:trace:shell:UrlCanonicalizeW result L"http://origin.warframe.com/" 0058:trace:wininet:InternetCrackUrlW (L"http://origin.warframe.com/" 27 0 0x1ed538) 0058:trace:wininet:set_url_component (null) (0) 0058:trace:wininet:GetInternetSchemeW L"http" 4 0058:trace:wininet:set_url_component L"http" (4) 0058:trace:wininet:set_url_component (null) (0) 0058:trace:wininet:set_url_component (null) (0) 0058:trace:wininet:set_url_component L"origin.warframe.com" (19) 0058:trace:wininet:set_url_component L"/" (1) 0058:trace:wininet:InternetCrackUrlW L"http://origin.warframe.com/": scheme((null)) host(L"origin.warframe.com") path(L"/") extra((null)) 0058:trace:wininet:InternetConnectW (0x1, L"origin.warframe.com", 80, L"", 0x1ed138, 3, 0, 0) 0058:trace:wininet:WININET_AddRef 0x91be7c8 -> refcount = 2 0058:trace:wininet:get_handle_object handle 1 -> 0x91be7c8 0058:trace:wininet:HTTP_Connect --> 0058:trace:wininet:WININET_AddRef 0x91be7c8 -> refcount = 3 0058:trace:wininet:HTTP_Connect 0x91be7c8 --> 0x91ec4d0 0058:trace:wininet:WININET_Release object 0x91be7c8 refcount = 2 0058:trace:wininet:InternetConnectW returning 0x2 ... --- snip ---
--- quote --- I wouldn't mind if the patch accepted, but please note that it is more a workaround instead of a proper fix. As I explained in https://www.winehq.org/pipermail/wine-patches/2016-July/152110.html:
... Reason for the failure is because after decoding a "/" is added, and it does not fit into the buffer anymore. Michael wrote a patch to dynamically allocate a buffer, however I do not think the "/" should be added in the first place. --- quote ---
https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/shlwapi/url.c#l282
It seems the current implementation of 'UrlCanonicalizeW()' of adding the trailing slash is correct.
'http://origin.warframe.com' -> 0x1A characters (buffer size = 0x1B, includes NULL term)
Native will return 'ERROR_INSUFFICIENT_BUFFER' and have 'pcchCanonicalized' set to 0x1C (= includes space for trailing slash). The canonicalized URL will contain a trailing slash if buffer size 0x1C is passed: 'http://origin.warframe.com/'
$ sha1sum Warframe.msi 041c922c72dd18202b7aec65dc6dc3f27926b5cf Warframe.msi
$ du -sh Warframe.msi 39M Warframe.msi
$ wine --version wine-3.14
Regards