Module: wine Branch: oldstable Commit: 19aea0583587cbde0dd2f665377be179acd37686 URL: https://source.winehq.org/git/wine.git/?a=commit;h=19aea0583587cbde0dd2f6653...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Thu Aug 2 14:04:38 2018 +0800
kernel32: Add support for MOVEFILE_WRITE_THROUGH to MoveFile.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit 97d2d9bf603d2356bdc1989b61a0b4e6f8f8ec31) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/kernel32/path.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c index a389743..6d2a902 100644 --- a/dlls/kernel32/path.c +++ b/dlls/kernel32/path.c @@ -1283,6 +1283,7 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest, NTSTATUS status; HANDLE source_handle = 0, dest_handle; ANSI_STRING source_unix, dest_unix; + DWORD options;
TRACE("(%s,%s,%p,%p,%04x)\n", debugstr_w(source), debugstr_w(dest), fnProgress, param, flag ); @@ -1293,9 +1294,6 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest, if (!dest) return DeleteFileW( source );
- if (flag & MOVEFILE_WRITE_THROUGH) - FIXME("MOVEFILE_WRITE_THROUGH unimplemented\n"); - /* check if we are allowed to rename the source */
if (!RtlDosPathNameToNtPathName_U( source, &nt_name, NULL, NULL )) @@ -1336,8 +1334,11 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest, SetLastError( ERROR_PATH_NOT_FOUND ); goto error; } - status = NtOpenFile( &dest_handle, GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, &attr, &io, 0, - FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT ); + + options = FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT; + if (flag & MOVEFILE_WRITE_THROUGH) + options |= FILE_WRITE_THROUGH; + status = NtOpenFile( &dest_handle, GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, &attr, &io, 0, options ); if (status == STATUS_SUCCESS) /* destination exists */ { NtClose( dest_handle );