Commit cc1d0e49 authored by Joel Holdsworth's avatar Joel Holdsworth Committed by Alexandre Julliard

ntdll: Initial implementation of FileDispositionInformationEx.

This is required by Msys2 when running gpg-agent. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54996Signed-off-by: 's avatarJoel Holdsworth <joel@airwebreathe.org.uk>
parent dedd130d
......@@ -4755,7 +4755,32 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
SERVER_START_REQ( set_fd_disp_info )
{
req->handle = wine_server_obj_handle( handle );
req->unlink = info->DoDeleteFile;
req->flags = info->DoDeleteFile ? FILE_DISPOSITION_DELETE : FILE_DISPOSITION_DO_NOT_DELETE;
status = wine_server_call( req );
}
SERVER_END_REQ;
}
else status = STATUS_INVALID_PARAMETER_3;
break;
case FileDispositionInformationEx:
if (len >= sizeof(FILE_DISPOSITION_INFORMATION_EX))
{
FILE_DISPOSITION_INFORMATION_EX *info = ptr;
if (info->Flags & FILE_DISPOSITION_POSIX_SEMANTICS)
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" );
if (info->Flags & FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE)
FIXME( "FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE not supported\n" );
SERVER_START_REQ( set_fd_disp_info )
{
req->handle = wine_server_obj_handle( handle );
req->flags = info->Flags;
status = wine_server_call( req );
}
SERVER_END_REQ;
......
......@@ -787,6 +787,7 @@ NTSTATUS WINAPI wow64_NtSetInformationFile( UINT *args )
case FileIoPriorityHintInformation: /* FILE_IO_PRIORITY_HINT_INFO */
case FileValidDataLengthInformation: /* FILE_VALID_DATA_LENGTH_INFORMATION */
case FileDispositionInformation: /* FILE_DISPOSITION_INFORMATION */
case FileDispositionInformationEx: /* FILE_DISPOSITION_INFORMATION_EX */
status = NtSetInformationFile( handle, iosb_32to64( &io, io32 ), ptr, len, class );
break;
......
......@@ -5230,7 +5230,7 @@ struct set_fd_disp_info_request
{
struct request_header __header;
obj_handle_t handle;
int unlink;
unsigned int flags;
char __pad_20[4];
};
struct set_fd_disp_info_reply
......@@ -6418,7 +6418,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 777
#define SERVER_PROTOCOL_VERSION 778
/* ### protocol_version end ### */
......
......@@ -2463,7 +2463,7 @@ static int is_dir_empty( int fd )
}
/* set disposition for the fd */
static void set_fd_disposition( struct fd *fd, int unlink )
static void set_fd_disposition( struct fd *fd, unsigned int flags )
{
struct stat st;
......@@ -2479,7 +2479,7 @@ static void set_fd_disposition( struct fd *fd, int unlink )
return;
}
if (unlink)
if (flags & FILE_DISPOSITION_DELETE)
{
struct fd *fd_ptr;
......@@ -2524,7 +2524,7 @@ static void set_fd_disposition( struct fd *fd, int unlink )
}
}
fd->closed->unlink = unlink ? 1 : 0;
fd->closed->unlink = (flags & FILE_DISPOSITION_DELETE) ? 1 : 0;
if (fd->options & FILE_DELETE_ON_CLOSE)
fd->closed->unlink = -1;
}
......@@ -2955,7 +2955,7 @@ DECL_HANDLER(set_fd_disp_info)
struct fd *fd = get_handle_fd_obj( current->process, req->handle, DELETE );
if (fd)
{
set_fd_disposition( fd, req->unlink );
set_fd_disposition( fd, req->flags );
release_object( fd );
}
}
......
......@@ -3641,7 +3641,7 @@ struct handle_info
/* set fd disposition information */
@REQ(set_fd_disp_info)
obj_handle_t handle; /* handle to a file or directory */
int unlink; /* whether to unlink file on close */
unsigned int flags; /* what actions should be taken when deleting a file */
@END
......
......@@ -2207,7 +2207,7 @@ C_ASSERT( FIELD_OFFSET(struct set_fd_completion_mode_request, handle) == 12 );
C_ASSERT( FIELD_OFFSET(struct set_fd_completion_mode_request, flags) == 16 );
C_ASSERT( sizeof(struct set_fd_completion_mode_request) == 24 );
C_ASSERT( FIELD_OFFSET(struct set_fd_disp_info_request, handle) == 12 );
C_ASSERT( FIELD_OFFSET(struct set_fd_disp_info_request, unlink) == 16 );
C_ASSERT( FIELD_OFFSET(struct set_fd_disp_info_request, flags) == 16 );
C_ASSERT( sizeof(struct set_fd_disp_info_request) == 24 );
C_ASSERT( FIELD_OFFSET(struct set_fd_name_info_request, handle) == 12 );
C_ASSERT( FIELD_OFFSET(struct set_fd_name_info_request, rootdir) == 16 );
......
......@@ -4360,7 +4360,7 @@ static void dump_set_fd_completion_mode_request( const struct set_fd_completion_
static void dump_set_fd_disp_info_request( const struct set_fd_disp_info_request *req )
{
fprintf( stderr, " handle=%04x", req->handle );
fprintf( stderr, ", unlink=%d", req->unlink );
fprintf( stderr, ", flags=%08x", req->flags );
}
static void dump_set_fd_name_info_request( const struct set_fd_name_info_request *req )
......
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