Module: wine Branch: master Commit: 146333fed2d524d1badf1828dc31fc3e4bb0e179 URL: https://gitlab.winehq.org/wine/wine/-/commit/146333fed2d524d1badf1828dc31fc3...
Author: Joel Holdsworth joel@airwebreathe.org.uk Date: Tue Jun 20 12:25:14 2023 +0100
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
---
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 f76448659e2..b230249fdc3 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 22046e63a21..91ba408bc95 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -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 ) { 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;