Commit 97d2d9bf authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

kernel32: Add support for MOVEFILE_WRITE_THROUGH to MoveFile.

parent 88d52edc
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment