From: Thomas Faber Subject: msi: Use the intended attributes when overwriting the target file in cabinet_copy_file. Message-Id: <56531116.90907@reactos.org> Date: Mon, 23 Nov 2015 14:13:58 +0100 The current code uses the old file's attributes, which means it would make the file read-only again. This would e.g. prevent the deletion of the file at the end of test_readonlyfile_cab (and should probably even make this CreateFileW call fail since it specifies GENERIC_WRITE). The reason this currently works in Wine is that CreateFile keeps the existing file attributes in this case (see the todo_wine in test_NtCreateFile). The patch fixes msi to use the correct attributes as returned by the callback. From ad420f1f7df5c0b5c2bbb4d1d61f68273f9d9bb2 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Mon, 23 Nov 2015 14:00:54 +0100 Subject: msi: Use the intended attributes when overwriting the target file in cabinet_copy_file. Signed-off-by: Thomas Faber --- dlls/msi/media.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/msi/media.c b/dlls/msi/media.c index d75f59f..1357a64 100644 --- a/dlls/msi/media.c +++ b/dlls/msi/media.c @@ -476,7 +476,7 @@ static INT_PTR cabinet_copy_file(FDINOTIFICATIONTYPE fdint, { TRACE("removing read-only attribute on %s\n", debugstr_w(path)); SetFileAttributesW( path, attrs2 & ~FILE_ATTRIBUTE_READONLY ); - handle = CreateFileW(path, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, attrs2, NULL); + handle = CreateFileW(path, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, attrs, NULL); if (handle != INVALID_HANDLE_VALUE) goto done; err = GetLastError(); -- 1.9.4.msysgit.2