7 Nov
2025
7 Nov
'25
8:03 a.m.
On Thu Nov 6 15:34:03 2025 +0000, Joe Souza wrote:
CopyFileW returns ERROR_SHARING_VIOLATION in the case where a file is attempted to copy onto itself. How to differentiate between this and copying onto a different file that may be open by another process? That is the purpose of the IsSameFile function. if mean something like:
``` if (!CopyFileW()) { if (GetLastError() == ERROR_SHARING_VIOLATION && IsSameFile()) {...} else {...} } ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9112#note_121136