Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ee136f98
Commit
ee136f98
authored
Mar 10, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Check for an existing file on the server side.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5b75d943
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
18 deletions
+17
-18
file.c
dlls/ntdll/file.c
+2
-14
server_protocol.h
include/wine/server_protocol.h
+3
-1
fd.c
server/fd.c
+8
-2
protocol.def
server/protocol.def
+1
-0
request.h
server/request.h
+2
-1
trace.c
server/trace.c
+1
-0
No files found.
dlls/ntdll/file.c
View file @
ee136f98
...
...
@@ -2778,18 +2778,12 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
if
(
io
->
u
.
Status
!=
STATUS_SUCCESS
&&
io
->
u
.
Status
!=
STATUS_NO_SUCH_FILE
)
break
;
if
(
!
info
->
ReplaceIfExists
&&
io
->
u
.
Status
==
STATUS_SUCCESS
)
{
RtlFreeAnsiString
(
&
unix_name
);
io
->
u
.
Status
=
STATUS_OBJECT_NAME_COLLISION
;
break
;
}
SERVER_START_REQ
(
set_fd_name_info
)
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
req
->
rootdir
=
wine_server_obj_handle
(
attr
.
RootDirectory
);
req
->
link
=
FALSE
;
req
->
replace
=
info
->
ReplaceIfExists
;
wine_server_add_data
(
req
,
unix_name
.
Buffer
,
unix_name
.
Length
);
io
->
u
.
Status
=
wine_server_call
(
req
);
}
...
...
@@ -2821,18 +2815,12 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
if
(
io
->
u
.
Status
!=
STATUS_SUCCESS
&&
io
->
u
.
Status
!=
STATUS_NO_SUCH_FILE
)
break
;
if
(
!
info
->
ReplaceIfExists
&&
io
->
u
.
Status
==
STATUS_SUCCESS
)
{
RtlFreeAnsiString
(
&
unix_name
);
io
->
u
.
Status
=
STATUS_OBJECT_NAME_COLLISION
;
break
;
}
SERVER_START_REQ
(
set_fd_name_info
)
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
req
->
rootdir
=
wine_server_obj_handle
(
attr
.
RootDirectory
);
req
->
link
=
TRUE
;
req
->
replace
=
info
->
ReplaceIfExists
;
wine_server_add_data
(
req
,
unix_name
.
Buffer
,
unix_name
.
Length
);
io
->
u
.
Status
=
wine_server_call
(
req
);
}
...
...
include/wine/server_protocol.h
View file @
ee136f98
...
...
@@ -5532,7 +5532,9 @@ struct set_fd_name_info_request
obj_handle_t
handle
;
obj_handle_t
rootdir
;
int
link
;
int
replace
;
/* VARARG(filename,string); */
char
__pad_28
[
4
];
};
struct
set_fd_name_info_reply
{
...
...
@@ -6704,6 +6706,6 @@ union generic_reply
struct
resume_process_reply
resume_process_reply
;
};
#define SERVER_PROTOCOL_VERSION 59
5
#define SERVER_PROTOCOL_VERSION 59
6
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/fd.c
View file @
ee136f98
...
...
@@ -2325,7 +2325,7 @@ static void set_fd_disposition( struct fd *fd, int unlink )
/* set new name for the fd */
static
void
set_fd_name
(
struct
fd
*
fd
,
struct
fd
*
root
,
const
char
*
nameptr
,
data_size_t
len
,
int
create_link
)
data_size_t
len
,
int
create_link
,
int
replace
)
{
struct
inode
*
inode
;
struct
stat
st
;
...
...
@@ -2367,6 +2367,12 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr,
if
(
!
stat
(
name
,
&
st
))
{
if
(
!
replace
)
{
set_error
(
STATUS_OBJECT_NAME_COLLISION
);
goto
failed
;
}
/* can't replace directories or special files */
if
(
!
S_ISREG
(
st
.
st_mode
))
{
...
...
@@ -2695,7 +2701,7 @@ 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
);
set_fd_name
(
fd
,
root_fd
,
get_req_data
(),
get_req_data_size
(),
req
->
link
,
req
->
replace
);
release_object
(
fd
);
}
if
(
root_fd
)
release_object
(
root_fd
);
...
...
server/protocol.def
View file @
ee136f98
...
...
@@ -3809,6 +3809,7 @@ struct handle_info
obj_handle_t handle; /* handle to a file or directory */
obj_handle_t rootdir; /* root directory */
int link; /* link instead of renaming */
int replace; /* replace an existing file? */
VARARG(filename,string); /* new file name */
@END
...
...
server/request.h
View file @
ee136f98
...
...
@@ -2377,7 +2377,8 @@ 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
(
sizeof
(
struct
set_fd_name_info_request
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_fd_name_info_request
,
replace
)
==
24
);
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
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_window_layered_info_reply
,
color_key
)
==
8
);
...
...
server/trace.c
View file @
ee136f98
...
...
@@ -4464,6 +4464,7 @@ 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
,
", link=%d"
,
req
->
link
);
fprintf
(
stderr
,
", replace=%d"
,
req
->
replace
);
dump_varargs_string
(
", filename="
,
cur_size
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment