MoveFileW bug?
Roderick Colenbrander
thunderbird2k at gmx.net
Tue Feb 25 07:32:19 CST 2003
Hi,
Today someone asked me to look at some Wine problems when running a gaming app
called "Steam". Because I wasn't using the latest version of the app, the
program tried to update itself. During the update process the main program
(steam.exe) needs to be replaced by a new version. To do this the old program
exits and another executable is being launched. The new process tries to
backup the old steam.exe to wine's temp drive to restore it in case something
goes wrong. Here the real problem appears. After "moving/renaming" the file
the update tool gives an error stating that steam.exe still exists.
After looking at the debug output I saw that to move the file the update tool
is using MoveFileW. Normally nothing is wrong with this but according to MSDN
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/movefile.asp)
it can be used for about everything except for the following:
"The MoveFile function will move (rename) either a file or a directory
(including its children) either in the same directory or across directories.
The one caveat is that the MoveFile function will fail on directory moves
when the destination is on a different volume."
The update tool is using something like this: MoveFileW(steam.exe,
e:\\steam.exe)
So it tries to move a file from c:\steam\steam.exe to e:\steam.exe which
according to the MSDN docs is not possible. The same works fine on Win2k.
After hacking MoveFileW to not check if the volumes are different it worked
fine on Wine too.
What shall we do? Shall we implement the same bugs Windows is doing or shall e
listen to the docs at MSDN? (I'm sure some tests need to be made)
Roderick Colenbrander
More information about the wine-devel
mailing list