Brock York twunknown@gmail.com wrote:
- /* Open the "replaced" file for reading and writing */
- /* Open the "replaced" file for reading and writing to check for READ_ONLY attribute */ if (!(RtlDosPathNameToNtPathName_U(lpReplacedFileName, &nt_replaced_name, NULL, NULL))) { error = ERROR_PATH_NOT_FOUND;
@@ -1776,6 +1776,12 @@ BOOL WINAPI ReplaceFileW(LPCWSTR lpReplacedFileName, LPCWSTR lpReplacementFileNa &attr, &io, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, FILE_SYNCHRONOUS_IO_NONALERT|FILE_NON_DIRECTORY_FILE);
- /*If we didn't get ACCESS_DENIED, then open the file for reading and delete ready for the replacement*/
- if (status == STATUS_SHARING_VIOLATION)
- status = NtOpenFile(&hReplaced, GENERIC_READ|DELETE|SYNCHRONIZE,
&attr, &io,
FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
FILE_SYNCHRONOUS_IO_NONALERT|FILE_NON_DIRECTORY_FILE);
This is a hack, read-only attribute should be checked on wineserver side.