ReplaceFileW (was: Phoronix: Ubuntu 7.10 + WINE vs. Windows XP)

Reece Dunn msclrhd at
Mon Oct 22 01:42:13 CDT 2007

On 22/10/2007, Stephan Rose <kermos at> wrote:
> On Sun, 2007-10-21 at 19:33 +0900, Dmitry Timoshkov wrote:
> > "Reece Dunn" <msclrhd at> wrote:
> >
> > > On 20/10/2007, Dan Kegel <dank at> wrote:
> > >> Reece Dunn wrote:
> > >> > The patch was rejected by Alexandre because the patch was
> > >> > implementing that command using Windows API calls,
> > >> > when it should be implemented natively as POSIX/GNU calls.
> > >>
> > >> Really?  Where did he say that?  It'd be nice to link to that from
> > >>
> > >> - Dan
> > >
> > > I asked him about it at WineConf and that is a summary of what he said.
> >
> > I can't believe this, probably you misunderstood or misinterpreted something.
> > ReplaceFile API needs to abide sharing and access rights rules which are known
> > only to wineserver, and not known/available on the libc/kernel level.
> >
> Ok so what's the right way to implement this now? If I'm going to do
> this, and I most certainly wouldn't mind doing that, I'd like to be able
> to do it the right way the first time around.

I'd suggest working on the tests first and get these passing on
Windows, as I discussed on the initial thread. These should initially
be based on the MSDN documentation. Don't forget to cover both A and W

This will then give you the behaviour of that function on Windows that
you can then use to implement it on Wine and know that the function is
implemented correctly.

Also, the tests are more likely to get in than any implementation.
These will also help convince Alexandre (if I interpreted what he said
correctly) that the ReplaceFile[A/W] behaviour is more complex than he

The stub for ReplaceFileW can be created and ReplaceFileA can be fully
implemented, as that just feeds its data to ReplaceFileW.

- Reece

More information about the wine-devel mailing list