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.
<br><br>Erich Hoover<br><a href="mailto:email@example.com">firstname.lastname@example.org</a><br><br><div><span class="gmail_quote">On 2/26/07, <b class="gmail_sendername">Felix Nawothnig</b> <<a href="mailto:email@example.com">firstname.lastname@example.org
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Erich Hoover wrote:<br>> Real Name:<br>> Erich Hoover<br>> Description:
<br>> Implements the functions ReplaceFileA and ReplaceFileW in kernel32<br>> (Bug #7544). Also provides conformance test code to ensure proper<br>> functionality.<br>> Changelog:<br>> kernel32: Implement ReplaceFileA/ReplaceFileW
<br><br>Your patch seems to introduce lots of race cons. It's possible these<br>exist on Win32 too but can't we avoid them?<br></blockquote></div><br>