Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6ccefdb7
Commit
6ccefdb7
authored
Feb 09, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Support opening file objects from any root, not only directories.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
39e60dc6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
21 deletions
+16
-21
fd.c
server/fd.c
+6
-20
file.c
server/file.c
+10
-1
No files found.
server/fd.c
View file @
6ccefdb7
...
...
@@ -2393,27 +2393,13 @@ DECL_HANDLER(flush)
DECL_HANDLER
(
open_file_object
)
{
struct
unicode_str
name
=
get_req_unicode_str
();
struct
directory
*
root
=
NULL
;
struct
object
*
obj
,
*
result
;
struct
object
*
obj
,
*
result
,
*
root
=
NULL
;
if
(
req
->
rootdir
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
req
->
rootdir
,
0
)))
{
if
(
get_error
()
!=
STATUS_OBJECT_TYPE_MISMATCH
)
return
;
if
(
!
(
obj
=
(
struct
object
*
)
get_file_obj
(
current
->
process
,
req
->
rootdir
,
0
)))
return
;
if
(
name
.
len
)
{
release_object
(
obj
);
set_error
(
STATUS_OBJECT_PATH_NOT_FOUND
);
return
;
}
clear_error
();
}
else
{
obj
=
open_object_dir
(
root
,
&
name
,
req
->
attributes
,
NULL
);
if
(
root
)
release_object
(
root
);
if
(
!
obj
)
return
;
}
if
(
req
->
rootdir
&&
!
(
root
=
get_handle_obj
(
current
->
process
,
req
->
rootdir
,
0
,
NULL
)))
return
;
obj
=
open_named_object
(
root
,
NULL
,
&
name
,
req
->
attributes
);
if
(
root
)
release_object
(
root
);
if
(
!
obj
)
return
;
if
((
result
=
obj
->
ops
->
open_file
(
obj
,
req
->
access
,
req
->
sharing
,
req
->
options
)))
{
...
...
server/file.c
View file @
6ccefdb7
...
...
@@ -68,6 +68,7 @@ static struct object_type *file_get_type( struct object *obj );
static
struct
fd
*
file_get_fd
(
struct
object
*
obj
);
static
struct
security_descriptor
*
file_get_sd
(
struct
object
*
obj
);
static
int
file_set_sd
(
struct
object
*
obj
,
const
struct
security_descriptor
*
sd
,
unsigned
int
set_info
);
static
struct
object
*
file_lookup_name
(
struct
object
*
obj
,
struct
unicode_str
*
name
,
unsigned
int
attr
);
static
struct
object
*
file_open_file
(
struct
object
*
obj
,
unsigned
int
access
,
unsigned
int
sharing
,
unsigned
int
options
);
static
void
file_destroy
(
struct
object
*
obj
);
...
...
@@ -90,7 +91,7 @@ static const struct object_ops file_ops =
default_fd_map_access
,
/* map_access */
file_get_sd
,
/* get_sd */
file_set_sd
,
/* set_sd */
no_lookup_name
,
/* lookup_name */
file_lookup_name
,
/* lookup_name */
no_link_name
,
/* link_name */
NULL
,
/* unlink_name */
file_open_file
,
/* open_file */
...
...
@@ -609,6 +610,14 @@ static int file_set_sd( struct object *obj, const struct security_descriptor *sd
return
1
;
}
static
struct
object
*
file_lookup_name
(
struct
object
*
obj
,
struct
unicode_str
*
name
,
unsigned
int
attr
)
{
if
(
!
name
||
!
name
->
len
)
return
NULL
;
/* open the file itself */
set_error
(
STATUS_OBJECT_PATH_NOT_FOUND
);
return
NULL
;
}
static
struct
object
*
file_open_file
(
struct
object
*
obj
,
unsigned
int
access
,
unsigned
int
sharing
,
unsigned
int
options
)
{
...
...
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