ntdll: Implement FILE_DISPOSITION_ON_CLOSE.

The FILE_DELETE_ON_CLOSE can be used with the FILE_DISPOSITION_ON_CLOSE flag
of FileDispositionInformationEx.

Signed-off-by: Joel Holdsworth <joel@airwebreathe.org.uk>
This commit is contained in:
Joel Holdsworth 2023-06-20 12:25:14 +01:00 committed by Alexandre Julliard
parent d89ee7c030
commit 146333fed2
3 changed files with 3 additions and 3 deletions

View file

@ -3163,7 +3163,6 @@ static void test_file_disposition_information(void)
if ( res == STATUS_SUCCESS )
{
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
todo_wine
ok( !fileDeleted, "File shouldn't have been deleted\n" );
DeleteFileA( buffer );
}

View file

@ -4772,8 +4772,6 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
FIXME( "FILE_DISPOSITION_POSIX_SEMANTICS not supported\n" );
if (info->Flags & FILE_DISPOSITION_FORCE_IMAGE_SECTION_CHECK)
FIXME( "FILE_DISPOSITION_FORCE_IMAGE_SECTION_CHECK not supported\n" );
if (info->Flags & FILE_DISPOSITION_ON_CLOSE)
FIXME( "FILE_DISPOSITION_ON_CLOSE not supported\n" );
SERVER_START_REQ( set_fd_disp_info )
{

View file

@ -2525,6 +2525,9 @@ static void set_fd_disposition( struct fd *fd, unsigned int flags )
}
}
if (flags & FILE_DISPOSITION_ON_CLOSE)
fd->options &= ~FILE_DELETE_ON_CLOSE;
fd->closed->unlink = (flags & FILE_DISPOSITION_DELETE) ? 1 : 0;
if (fd->options & FILE_DELETE_ON_CLOSE)
fd->closed->unlink = -1;