KERNEL: force copying of DOS-style path into argv[0] of PE process (was: Re: Queries about some 'usability' points) - partially fixes #3542

Jesse Allen the3dfxdude at gmail.com
Mon Oct 31 16:47:42 CST 2005


On 10/31/05, Alex Villací­s Lasso <a_villacis at palosanto.com> wrote:
> This is a patch to fix the primary bug on DungeonKeeper. I am surprised
> this bug was overlooked up to 0.9, since this is such a basic
> characteristic of Windows.
>
> The basic problem is that Wine is passing the argv[] array unmodified
> (except for the removal of the 'wine' reference itself) to the PE
> process. This means that, unless the user writes a DOS-style path at
> wine invocation, the PE process receives an UNIX-style relative path as
> its argv[0]. This differs from standard behavior in MS-DOS and Windows,
> where the argv[0] of the process contains a fully qualified DOS-style
> path (such as C:\WINDOWS\FOO.EXE) regardless of the method used to run
> the executable. DungeonKeeper relies on this characteristic of
> MS-DOS/Windows and crashes when it sees the UNIX-style path.
>


This is the same bug I experience in a program called LogicWorks. 
Here is a trace of what I think is suspect:

0009:Call kernel32.GetCommandLineA() ret=1002cf90
0009:Ret  kernel32.GetCommandLineA() retval=7fd20e30 ret=1002cf90
0009:Call kernel32.lstrlenA(7fd20e30 "LogicWorks.exe") ret=6c37396c
0009:Ret  kernel32.lstrlenA() retval=0000000e ret=6c37396c
0009:Call msvcrt.malloc(00001404) ret=6c373844
0009:Ret  msvcrt.malloc() retval=7fdb37a0 ret=6c373844
0009:Call msvcrt.memcpy(7fdb37b0,7fd20e30,0000000e) ret=6c37398b
0009:Ret  msvcrt.memcpy() retval=7fdb37b0 ret=6c37398b
0009:Call msvcrt._mbslwr(7fdb37b0 "LogicWorks.exe") ret=6c3cbdf5
0009:Ret  msvcrt._mbslwr() retval=7fdb37b0 ret=6c3cbdf5
0009:Call msvcrt._mbschr(7fdb37b0 "logicworks.exe",00000022) ret=6c3cbda0
0009:Ret  msvcrt._mbschr() retval=00000000 ret=6c3cbda0
0009:Call msvcrt._mbsstr(7fdb37b0 "logicworks.exe",10077a1c ".exe") ret=6c3c4256
0009:Ret  msvcrt._mbsstr() retval=7fdb37ba ret=6c3c4256
0009:Call msvcrt._mbsrchr(7fdb37b0 "logicworks.exe",0000005c) ret=6c3c421c
0009:Ret  msvcrt._mbsrchr() retval=00000000 ret=6c3c421c
0009:Call msvcrt._mbsrchr(7fdb37b0 "logicworks.exe",0000002e) ret=6c3c421c
0009:Ret  msvcrt._mbsrchr() retval=7fdb37ba ret=6c3c421c
0009:Call msvcrt.memcpy(7fdb3800,7fdb37b0,0000000a) ret=6c3cbbe9
0009:Ret  msvcrt.memcpy() retval=7fdb3800 ret=6c3cbbe9
0009:Call msvcrt._mbsrchr(7fdb3800 "logicworks",0000005c) ret=6c3c421c
0009:Ret  msvcrt._mbsrchr() retval=00000000 ret=6c3c421c
0009:Call msvcrt._mbsrchr(7fdb3800 "logicworks",0000003a) ret=6c3c421c
0009:Ret  msvcrt._mbsrchr() retval=00000000 ret=6c3c421c
0009:Call msvcrt._strdup(7fdb3800 "logicworks") ret=1002d1e3
0009:Ret  msvcrt._strdup() retval=7fdb0f58 ret=1002d1e3
0009:Call msvcrt._chdir(7fdb37b0 "logicworks.exe") ret=1002d1fd


This is obviously wrong.



More information about the wine-devel mailing list