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

Alex Villací­s Lasso a_villacis at
Mon Oct 31 11:08:36 CST 2005

Lionel Ulmer wrote:

>On Thu, Oct 27, 2005 at 04:17:17PM -0500, Alex Villací­s Lasso wrote:
>>The page says that you have a patch that fixes something. Is that the 
>>issue about the executable path name, or the one about the game refusing 
>>to go past the splash screen, or the one about the mouse cursor?
>It's only fixing the mouse cursor issue.
>      Lionel
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 patch will also be sent to wine-patches, as a fix for one of the 
issues of bug 3542.

Note that the patch, as it stands, only fixes PE executables. Winelib 
applications continue to receive an UNIX-style path. I don't really know 
whether this is the right thing to do, but winelib apps surely know that 
they are running in an Unix environment, so they know how to deal with 
an Unix-style argv[0]. However, this poses the question of how to write 
a test for this bug, since all tests are winelib applications.

BTW, could you please post the mouse-cursor issue patch? I also have a 
Japanese RPG for which the mouse cursor gets stuck at the center of the 
window, and I think that problem and the one in DungeonKeeper might be 
one and the same.

* Force a copy of the fully-qualified DOS-style executable path into 
argv[0] of the current PE process.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wine-kernel-process_force_dospath.patch
Type: text/x-patch
Size: 1603 bytes
Desc: not available
Url :

More information about the wine-patches mailing list