[mono] Don't try "open" handlers on iOS/Android in ves_icall_System_Diagnostics_Proce...
commitd88455b1ba7882832bdbe3b4cdc650438b3b96c0
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 27 Mar 2019 14:34:54 +0000 (27 15:34 +0100)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 27 Mar 2019 14:38:15 +0000 (27 15:38 +0100)
treebbc12bbb15c6369c15772732bb3aa22be7198338
parent18b4372f18a0e2dd1fda6ca8e21ae0675cd59cfa
[mono] Don't try "open" handlers on iOS/Android in ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal

When you use `Process.Start()` with `UseShellExecute=true` (which is the
default on Mono/.NET Framework, but false on .NET Core) then we'd still
try to first start the file directly, before falling back to trying the
"open" handlers like xdg-open to launch the file. Presumably we do this
so that on mobile you can still start a process without needing to
explicitly set `UseShellExecute=false`.

However we don't need to try the fallback on iOS/Android since the
"open" handlers won't work there anyway.

This recently showed up on the Xamarin.iOS Mono 2019-02 integration
where we started running the System.Diagnostics.ProcessTest suite and
the Start1_FileName_NotFound() would fail because the native error code
wasn't 2 (file not found) but 13 (invalid data). This is because it tried
to use /usr/bin/open which doesn't work of course so it got to the
`mono_w32error_set_last (ERROR_INVALID_DATA)` on L2088.

(cherry picked from commit 68077141a50a4295c8358cb04be620c093bdd2fe)
mono/metadata/w32process-unix.c