Brock York twunknown@gmail.com writes:
Remove GENERIC_WRITE flag when opening replaced file. ReplaceFileW will fail when called to replace the current executable. This is not the same behaviour as tested on Windows 7, 10 and XP this is because the "replaced" file is opened with the GENERIC_WRITE flag. The MSDN also mentions that the replaced file is only opened with GENERIC_READ, DELETE and SYNCHRONIZE.
This patch will fix the following bug once it is merged into Wine-Staging as the WarFrame launcher requires patches from Wine-Staging to work. Wine-Bug:https://bugs.winehq.org/show_bug.cgi?id=33845
Signed-off-by: Brock York twunknown@gmail.com
dlls/kernel32/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
It breaks the tests:
../../../tools/runtest -q -P wine -T ../../.. -M kernel32.dll -p kernel32_test.exe.so file && touch file.ok file.c:904: Tests skipped: CopyFile2 is not available file.c:1328: Tests skipped: Either no authority to volume, or is todo_wine for C:\users\julliard\Temp\ err=5 should be 3 file.c:1328: Tests skipped: Either no authority to volume, or is todo_wine for C:\users\julliard\Temp\removeme\ err=5 should be 3 file.c:1328: Tests skipped: Either no authority to volume, or is todo_wine for C:\ err=5 should be 3 file.c:1328: Tests skipped: Either no authority to volume, or is todo_wine for \?\C:\ err=5 should be 3 file.c:3669: Test failed: ReplaceFileA: unexpected error -559038737 file.c:3672: Test failed: unexpected error, replacement file should still exist 2 file.c:3737: Test failed: DeleteFileA: error (backup) 5 file.c:3825: Test failed: DeleteFileW: error (backup) 5 make: *** [Makefile:477: file.ok] Error 4