https://bugs.winehq.org/show_bug.cgi?id=49593
Bug ID: 49593 Summary: inconsistent return code when executable is not found Product: Wine Version: 5.13 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: xantares09@hotmail.com Distribution: ---
When wine is launched to run an inexistent executable file, the exit code is different according to the path name being passed as absolute or relative:
- relative, return code 53: $ wine zz.exe 0024:err:module:__wine_process_init L"C:\windows\system32\zz.exe" not found $ echo $? 53
- absolute, return code 0: $ wine /tmp/zz.exe wine: cannot find L"/tmp/zz.exe" $ echo $? 0
I expected the return code to be also 53 when the file is passed as absolute
https://bugs.winehq.org/show_bug.cgi?id=49593
xantares xantares09@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Hardware|x86 |x86-64
--- Comment #1 from xantares xantares09@hotmail.com --- or at least non null
https://bugs.winehq.org/show_bug.cgi?id=49593
xantares xantares09@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Distribution|--- |ArchLinux
https://bugs.winehq.org/show_bug.cgi?id=49593
xantares xantares09@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |ntdll
https://bugs.winehq.org/show_bug.cgi?id=49593
--- Comment #2 from xantares xantares09@hotmail.com --- I think it could come from dlls/ntdll/env.c:
static void get_image_path( const char *argv0, UNICODE_STRING *path ) ... /* check for builtin path inside system directory */ if (!is_path_prefix( system_dir, full_name, file_part )) { if (!is_win64 && !is_wow64) goto failed; if (!is_path_prefix( syswow64_dir, full_name, file_part )) goto failed; } ... failed: MESSAGE( "wine: cannot find '%s'\n", argv0 ); RtlExitUserProcess( GetLastError() );
here it seems no error was set and GetLastError may return 0
a proposal would be to return CTL_E_FILENOTFOUND
https://bugs.winehq.org/show_bug.cgi?id=49593
--- Comment #3 from xantares xantares09@hotmail.com --- Created attachment 67770 --> https://bugs.winehq.org/attachment.cgi?id=67770 proposal patch (untested)
https://bugs.winehq.org/show_bug.cgi?id=49593
xantares xantares09@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |julliard@winehq.org
https://bugs.winehq.org/show_bug.cgi?id=49593
--- Comment #4 from xantares xantares09@hotmail.com --- cc @ajulliard as he seems the author of that function:
https://github.com/wine-mirror/wine/blame/master/dlls/ntdll/env.c
https://bugs.winehq.org/show_bug.cgi?id=49593
xantares xantares09@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |minor
https://bugs.winehq.org/show_bug.cgi?id=49593
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |f8d42a31c624f28f6c9bfd9678f | |b025bf15e9c12 Status|UNCONFIRMED |RESOLVED
--- Comment #5 from Gijs Vermeulen gijsvrm@gmail.com --- This works with wine-5.14.
Fixed by: https://source.winehq.org/git/wine.git/commit/f8d42a31c624f28f6c9bfd9678fb025bf15e9c12
https://bugs.winehq.org/show_bug.cgi?id=49593
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 5.15.