4 Sep
2018
4 Sep
'18
8:03 a.m.
Brock York <twunknown(a)gmail.com> writes:
@@ -1788,6 +1789,14 @@ BOOL WINAPI ReplaceFileW(LPCWSTR lpReplacedFileName, LPCWSTR lpReplacementFileNa goto fail; }
+ /* Replacement should fail if replaced is READ_ONLY */ + fattribs = GetFileAttributesW(lpReplacedFileName); + if (fattribs & FILE_ATTRIBUTE_READONLY) + { + error = ERROR_ACCESS_DENIED; + goto fail; + }
It would be better to retrieve the attributes from the handle we have already opened, with something like GetFileInformationByHandle(). -- Alexandre Julliard julliard(a)winehq.org