[PATCH] shell32: Allow copy operation to overwrite an existing write protected file + tests
Alexandre Julliard
julliard at winehq.org
Mon Feb 22 05:34:48 CST 2010
Christian Costa <titan.costa at wanadoo.fr> writes:
> @@ -627,6 +627,14 @@ static DWORD SHNotifyCopyFileW(LPCWSTR src, LPCWSTR dest, BOOL bFailIfExists)
>
> TRACE("(%s %s %s)\n", debugstr_w(src), debugstr_w(dest), bFailIfExists ? "failIfExists" : "");
>
> + if (PathFileExistsW(dest))
> + {
> + /* Destination file may already exist with read only attribute */
> + DWORD attribs = GetFileAttributesW(dest);
> + if (IsAttrib(attribs, FILE_ATTRIBUTE_READONLY))
> + SetFileAttributesW(dest, attribs &= ~ FILE_ATTRIBUTE_READONLY);
> + }
> +
The PathFileExistsW call is redundant.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list