ntdll: Pass the NT name in the set_fd_name_info request.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
76b3284388
commit
9e255ba4e0
|
@ -4387,8 +4387,10 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
|
|||
{
|
||||
req->handle = wine_server_obj_handle( handle );
|
||||
req->rootdir = wine_server_obj_handle( attr.RootDirectory );
|
||||
req->namelen = nt_name.Length;
|
||||
req->link = FALSE;
|
||||
req->replace = info->ReplaceIfExists;
|
||||
wine_server_add_data( req, nt_name.Buffer, nt_name.Length );
|
||||
wine_server_add_data( req, unix_name, strlen(unix_name) );
|
||||
io->u.Status = wine_server_call( req );
|
||||
}
|
||||
|
@ -4425,8 +4427,10 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
|
|||
{
|
||||
req->handle = wine_server_obj_handle( handle );
|
||||
req->rootdir = wine_server_obj_handle( attr.RootDirectory );
|
||||
req->namelen = nt_name.Length;
|
||||
req->link = TRUE;
|
||||
req->replace = info->ReplaceIfExists;
|
||||
wine_server_add_data( req, nt_name.Buffer, nt_name.Length );
|
||||
wine_server_add_data( req, unix_name, strlen(unix_name) );
|
||||
io->u.Status = wine_server_call( req );
|
||||
}
|
||||
|
|
|
@ -5130,10 +5130,11 @@ struct set_fd_name_info_request
|
|||
struct request_header __header;
|
||||
obj_handle_t handle;
|
||||
obj_handle_t rootdir;
|
||||
data_size_t namelen;
|
||||
int link;
|
||||
int replace;
|
||||
/* VARARG(name,unicode_str,namelen); */
|
||||
/* VARARG(filename,string); */
|
||||
char __pad_28[4];
|
||||
};
|
||||
struct set_fd_name_info_reply
|
||||
{
|
||||
|
@ -6279,7 +6280,7 @@ union generic_reply
|
|||
|
||||
/* ### protocol_version begin ### */
|
||||
|
||||
#define SERVER_PROTOCOL_VERSION 670
|
||||
#define SERVER_PROTOCOL_VERSION 671
|
||||
|
||||
/* ### protocol_version end ### */
|
||||
|
||||
|
|
|
@ -2825,6 +2825,12 @@ DECL_HANDLER(set_fd_name_info)
|
|||
{
|
||||
struct fd *fd, *root_fd = NULL;
|
||||
|
||||
if (req->namelen > get_req_data_size())
|
||||
{
|
||||
set_error( STATUS_INVALID_PARAMETER );
|
||||
return;
|
||||
}
|
||||
|
||||
if (req->rootdir)
|
||||
{
|
||||
struct dir *root;
|
||||
|
@ -2837,7 +2843,8 @@ DECL_HANDLER(set_fd_name_info)
|
|||
|
||||
if ((fd = get_handle_fd_obj( current->process, req->handle, 0 )))
|
||||
{
|
||||
set_fd_name( fd, root_fd, get_req_data(), get_req_data_size(), req->link, req->replace );
|
||||
set_fd_name( fd, root_fd, (const char *)get_req_data() + req->namelen,
|
||||
get_req_data_size() - req->namelen, req->link, req->replace );
|
||||
release_object( fd );
|
||||
}
|
||||
if (root_fd) release_object( root_fd );
|
||||
|
|
|
@ -3542,8 +3542,10 @@ struct handle_info
|
|||
@REQ(set_fd_name_info)
|
||||
obj_handle_t handle; /* handle to a file or directory */
|
||||
obj_handle_t rootdir; /* root directory */
|
||||
data_size_t namelen; /* length of NT name in bytes */
|
||||
int link; /* link instead of renaming */
|
||||
int replace; /* replace an existing file? */
|
||||
VARARG(name,unicode_str,namelen); /* NT name */
|
||||
VARARG(filename,string); /* new file name */
|
||||
@END
|
||||
|
||||
|
|
|
@ -2173,8 +2173,9 @@ C_ASSERT( FIELD_OFFSET(struct set_fd_disp_info_request, unlink) == 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 );
|
||||
C_ASSERT( FIELD_OFFSET(struct set_fd_name_info_request, link) == 20 );
|
||||
C_ASSERT( FIELD_OFFSET(struct set_fd_name_info_request, replace) == 24 );
|
||||
C_ASSERT( FIELD_OFFSET(struct set_fd_name_info_request, namelen) == 20 );
|
||||
C_ASSERT( FIELD_OFFSET(struct set_fd_name_info_request, link) == 24 );
|
||||
C_ASSERT( FIELD_OFFSET(struct set_fd_name_info_request, replace) == 28 );
|
||||
C_ASSERT( sizeof(struct set_fd_name_info_request) == 32 );
|
||||
C_ASSERT( FIELD_OFFSET(struct get_window_layered_info_request, handle) == 12 );
|
||||
C_ASSERT( sizeof(struct get_window_layered_info_request) == 16 );
|
||||
|
|
|
@ -4292,8 +4292,10 @@ static void dump_set_fd_name_info_request( const struct set_fd_name_info_request
|
|||
{
|
||||
fprintf( stderr, " handle=%04x", req->handle );
|
||||
fprintf( stderr, ", rootdir=%04x", req->rootdir );
|
||||
fprintf( stderr, ", namelen=%u", req->namelen );
|
||||
fprintf( stderr, ", link=%d", req->link );
|
||||
fprintf( stderr, ", replace=%d", req->replace );
|
||||
dump_varargs_unicode_str( ", name=", min(cur_size,req->namelen) );
|
||||
dump_varargs_string( ", filename=", cur_size );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue