kernel32: Implement ReplaceFileA/ReplaceFileW

Erich Hoover ehoover at mines.edu
Mon Feb 26 14:42:53 CST 2007


I assume you're referring to the file existence check and file delete,
followed by the actual copy and move.  I implemented these checks in this
manner in order to provide error codes consistent with the documentation.  I
am not incredibly familiar with the Wine internals, but it looks to me like
the functions called should handle a simultaneous call from another thread
(without unnecessary code duplication).  For example, if the "replaced" file
goes missing between the check and the CopyFileW call then CopyFileW will
return an error.  If the "replaced" file appears between the DeleteFileW
call and the MoveFileExW call (since the MOVEFILE_REPLACE_EXISTING flag is
not set), then the MoveFileExW call will fail.  The documentation's expected
error codes for ReplaceFile seem to be consistent with these potential
outcomes.  I apologize if there's something I'm missing here, please let me
know.

Erich Hoover
ehoover at mines.edu

On 2/26/07, Felix Nawothnig <flexo at holycrap.org> wrote:
>
> Erich Hoover wrote:
> > Real Name:
> >     Erich Hoover
> > Description:
> >     Implements the functions ReplaceFileA and ReplaceFileW in kernel32
> > (Bug #7544).  Also provides conformance test code to ensure proper
> > functionality.
> > Changelog:
> >     kernel32: Implement ReplaceFileA/ReplaceFileW
>
> Your patch seems to introduce lots of race cons. It's possible these
> exist on Win32 too but can't we avoid them?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winehq.org/pipermail/wine-devel/attachments/20070226/9741663a/attachment.htm


More information about the wine-devel mailing list