gecko-dev/uriloader/exthandler/win
Toshihito Kikuchi d5a7d77f4f Bug 1573051 - Use both SHParseDisplayName and CreateUri to validate a uri. r=aklotz
For launching with an external protocol handler on Windows, we validate a uri
before sending it to `ShellExecute`, by converting a string into `PIDL` using
`SHParseDisplayName` and extract a string back from PIDL using
`IShellFolder::GetDisplayNameOf`.  The problem was that if a fragment, a
string following a hash mark (#), is always dropped after this validation.
This is caused by the intended design of Windows.

A proposed fix is to use `CreateUri` for validation, which is used behind
`IShellFolder::GetDisplayNameOf`.  However, we also keep `SHParseDisplayName`
because there are cases where `CreateUri` succeeds while `SHParseDisplayName`
fails such as a non-existent `file:` uri and we want to keep the same
validation result for those cases.

Adding `CreateUri` broke MinGW build because of our toolkit issue.  We use
dynamic linking for MinGW build in the meantime.

This patch adds a new unittest to make sure the new validation logic
behaves the same as the old one except the fragment issue.

Differential Revision: https://phabricator.services.mozilla.com/D42041

--HG--
extra : moz-landing-system : lando
2019-08-19 22:10:32 +00:00
..
nsMIMEInfoWin.cpp Bug 1573051 - Use both SHParseDisplayName and CreateUri to validate a uri. r=aklotz 2019-08-19 22:10:32 +00:00
nsMIMEInfoWin.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
nsOSHelperAppService.cpp Bug 1452278 - Part 1 - Make macOS nsOSHelperAppService::GetFromTypeAndExtension() not call OS MIME API's in content r=bzbarsky,froydnj 2019-03-27 22:49:33 +00:00
nsOSHelperAppService.h Bug 1452278 - Part 1 - Make macOS nsOSHelperAppService::GetFromTypeAndExtension() not call OS MIME API's in content r=bzbarsky,froydnj 2019-03-27 22:49:33 +00:00