Commit c530fb9e authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

ntdll: Fix NtFlushBuffersFile() for files with FILE_APPEND_DATA access.

Fixes a regression introduced by commit f7d40d45. Signed-off-by: 's avatarJózef Kucia <jkucia@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent a0aac495
...@@ -3418,6 +3418,8 @@ NTSTATUS WINAPI NtFlushBuffersFile( HANDLE hFile, IO_STATUS_BLOCK* IoStatusBlock ...@@ -3418,6 +3418,8 @@ NTSTATUS WINAPI NtFlushBuffersFile( HANDLE hFile, IO_STATUS_BLOCK* IoStatusBlock
int fd, needs_close; int fd, needs_close;
ret = server_get_unix_fd( hFile, FILE_WRITE_DATA, &fd, &needs_close, &type, NULL ); ret = server_get_unix_fd( hFile, FILE_WRITE_DATA, &fd, &needs_close, &type, NULL );
if (ret == STATUS_ACCESS_DENIED)
ret = server_get_unix_fd( hFile, FILE_APPEND_DATA, &fd, &needs_close, &type, NULL );
if (!ret && type == FD_TYPE_SERIAL) if (!ret && type == FD_TYPE_SERIAL)
{ {
......
...@@ -4441,7 +4441,6 @@ static void test_flush_buffers_file(void) ...@@ -4441,7 +4441,6 @@ static void test_flush_buffers_file(void)
ok(hfile != INVALID_HANDLE_VALUE, "could not open temp file, error %d.\n", GetLastError()); ok(hfile != INVALID_HANDLE_VALUE, "could not open temp file, error %d.\n", GetLastError());
status = pNtFlushBuffersFile(hfile, &io_status_block); status = pNtFlushBuffersFile(hfile, &io_status_block);
todo_wine
ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x.\n", status); ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x.\n", status);
CloseHandle(hfile); CloseHandle(hfile);
......
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