mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-20 08:51:04 +00:00

The patch for Bug 1588975 specified the "open" verb to execute a target, but the default verb is not always "open". For example, the default verb for a font file is "preview". We should specify null verb to start the default operation. Now we use `IShellDispatch2.ShellExecute` to ask explorer.exe to call `ShellExecuteExW`. That method takes an optional `VARIANT` parameter as a verb. According to https://devblogs.microsoft.com/oldnewthing/20140919-00/?p=44023, we need to pass `VT_ERROR` to omit an optional parameter. If we pass other values such as `nullptr` with `VT_BSTR` or `VT_EMPTY`, explorer.exe calls `ShellExecuteExW` with the empty string `""` instead of `nullptr`, which is not considered as a valid verb if the target file is not associated with any app. Differential Revision: https://phabricator.services.mozilla.com/D54036 --HG-- extra : moz-landing-system : lando