From: Joel Holdsworth joel@airwebreathe.org.uk
The FILE_DELEETE_ON_CLOSE can be state with the FILE_DISPOSITION_ON_CLOSE flag of FileDispositionInformationEx.
Signed-off-by: Joel Holdsworth joel@airwebreathe.org.uk --- dlls/ntdll/tests/file.c | 1 - dlls/ntdll/unix/file.c | 2 -- server/fd.c | 3 +++ 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 06281f70a3d..6883e31ebb5 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -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 ); } diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 8352cd6722b..90760588e63 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -4771,8 +4771,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 ) { diff --git a/server/fd.c b/server/fd.c index 942585b06ae..dc35999c3f3 100644 --- a/server/fd.c +++ b/server/fd.c @@ -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;