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
ff9d90bb
Commit
ff9d90bb
authored
Feb 12, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Use a standard object for object attribute roots instead of a directory.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dcca411a
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
89 additions
and
97 deletions
+89
-97
completion.c
server/completion.c
+3
-3
device.c
server/device.c
+6
-6
directory.c
server/directory.c
+31
-35
event.c
server/event.c
+6
-6
file.h
server/file.h
+3
-3
mailslot.c
server/mailslot.c
+6
-6
mapping.c
server/mapping.c
+3
-4
mutex.c
server/mutex.c
+3
-3
named_pipe.c
server/named_pipe.c
+5
-5
object.h
server/object.h
+4
-7
process.c
server/process.c
+3
-3
request.c
server/request.c
+2
-2
request.h
server/request.h
+1
-1
semaphore.c
server/semaphore.c
+3
-3
symlink.c
server/symlink.c
+3
-3
timer.c
server/timer.c
+3
-3
winstation.c
server/winstation.c
+4
-4
No files found.
server/completion.c
View file @
ff9d90bb
...
...
@@ -130,13 +130,13 @@ static unsigned int completion_map_access( struct object *obj, unsigned int acce
return
access
&
~
(
GENERIC_READ
|
GENERIC_WRITE
|
GENERIC_EXECUTE
|
GENERIC_ALL
);
}
static
struct
completion
*
create_completion
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
static
struct
completion
*
create_completion
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
unsigned
int
concurrent
,
const
struct
security_descriptor
*
sd
)
{
struct
completion
*
completion
;
if
((
completion
=
create_named_object
_dir
(
root
,
name
,
attr
,
&
completion_ops
)))
if
((
completion
=
create_named_object
(
root
,
&
completion_ops
,
name
,
attr
)))
{
if
(
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
{
...
...
@@ -179,7 +179,7 @@ DECL_HANDLER(create_completion)
{
struct
completion
*
completion
;
struct
unicode_str
name
;
struct
directory
*
root
;
struct
object
*
root
;
const
struct
security_descriptor
*
sd
;
const
struct
object_attributes
*
objattr
=
get_req_object_attributes
(
&
sd
,
&
name
,
&
root
);
...
...
server/device.c
View file @
ff9d90bb
...
...
@@ -599,12 +599,12 @@ static obj_handle_t device_file_ioctl( struct fd *fd, ioctl_code_t code, const a
return
handle
;
}
static
struct
device
*
create_device
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
static
struct
device
*
create_device
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
struct
device_manager
*
manager
,
unsigned
int
attr
)
{
struct
device
*
device
;
if
((
device
=
create_named_object
_dir
(
root
,
name
,
attr
,
&
device_ops
)))
if
((
device
=
create_named_object
(
root
,
&
device_ops
,
name
,
attr
)))
{
if
(
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
{
...
...
@@ -618,12 +618,12 @@ static struct device *create_device( struct directory *root, const struct unicod
return
device
;
}
struct
device
*
create_unix_device
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
struct
device
*
create_unix_device
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
const
char
*
unix_path
)
{
struct
device
*
device
;
if
((
device
=
create_named_object
_dir
(
root
,
name
,
0
,
&
device_ops
)))
if
((
device
=
create_named_object
(
root
,
&
device_ops
,
name
,
0
)))
{
device
->
unix_path
=
strdup
(
unix_path
);
device
->
manager
=
NULL
;
/* no manager, requests go straight to the Unix device */
...
...
@@ -718,13 +718,13 @@ DECL_HANDLER(create_device)
struct
device
*
device
;
struct
unicode_str
name
=
get_req_unicode_str
();
struct
device_manager
*
manager
;
struct
directory
*
root
=
NULL
;
struct
object
*
root
=
NULL
;
if
(
!
(
manager
=
(
struct
device_manager
*
)
get_handle_obj
(
current
->
process
,
req
->
manager
,
0
,
&
device_manager_ops
)))
return
;
if
(
req
->
rootdir
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
req
->
rootdir
,
0
)))
if
(
req
->
rootdir
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
req
->
rootdir
)))
{
release_object
(
manager
);
return
;
...
...
server/directory.c
View file @
ff9d90bb
...
...
@@ -198,13 +198,13 @@ static void directory_destroy( struct object *obj )
free
(
dir
->
entries
);
}
static
struct
directory
*
create_directory
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
static
struct
directory
*
create_directory
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
unsigned
int
hash_size
,
const
struct
security_descriptor
*
sd
)
{
struct
directory
*
dir
;
if
((
dir
=
create_named_object
_dir
(
root
,
name
,
attr
,
&
directory_ops
))
&&
if
((
dir
=
create_named_object
(
root
,
&
directory_ops
,
name
,
attr
))
&&
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
{
if
(
!
(
dir
->
entries
=
create_namespace
(
hash_size
)))
...
...
@@ -223,16 +223,10 @@ struct object *get_root_directory(void)
return
grab_object
(
root_directory
);
}
struct
directory
*
get_directory_obj
(
struct
process
*
process
,
obj_handle_t
handle
,
unsigned
int
access
)
/* return a directory object for creating/opening some object; no access rights are required */
struct
object
*
get_directory_obj
(
struct
process
*
process
,
obj_handle_t
handle
)
{
return
(
struct
directory
*
)
get_handle_obj
(
process
,
handle
,
access
,
&
directory_ops
);
}
/* create a named (if name is present) or unnamed object. */
void
*
create_named_object_dir
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attributes
,
const
struct
object_ops
*
ops
)
{
return
create_named_object
(
&
root
->
obj
,
ops
,
name
,
attributes
);
return
get_handle_obj
(
process
,
handle
,
0
,
&
directory_ops
);
}
/* retrieve an object type, creating it if needed */
...
...
@@ -240,7 +234,7 @@ struct object_type *get_object_type( const struct unicode_str *name )
{
struct
object_type
*
type
;
if
((
type
=
create_named_object
_dir
(
dir_objtype
,
name
,
OBJ_OPENIF
,
&
object_type_ops
)))
if
((
type
=
create_named_object
(
&
dir_objtype
->
obj
,
&
object_type_ops
,
name
,
OBJ_OPENIF
)))
{
if
(
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
{
...
...
@@ -335,13 +329,13 @@ void init_directories(void)
unsigned
int
i
;
root_directory
=
create_directory
(
NULL
,
NULL
,
0
,
HASH_SIZE
,
NULL
);
dir_driver
=
create_directory
(
root_directory
,
&
dir_driver_str
,
0
,
HASH_SIZE
,
NULL
);
dir_device
=
create_directory
(
root_directory
,
&
dir_device_str
,
0
,
HASH_SIZE
,
NULL
);
dir_objtype
=
create_directory
(
root_directory
,
&
dir_objtype_str
,
0
,
HASH_SIZE
,
NULL
);
dir_sessions
=
create_directory
(
root_directory
,
&
dir_sessions_str
,
0
,
HASH_SIZE
,
NULL
);
dir_kernel
=
create_directory
(
root_directory
,
&
dir_kernel_str
,
0
,
HASH_SIZE
,
NULL
);
dir_windows
=
create_directory
(
root_directory
,
&
dir_windows_str
,
0
,
HASH_SIZE
,
NULL
);
dir_winstation
=
create_directory
(
dir_windows
,
&
dir_winstations_str
,
0
,
HASH_SIZE
,
NULL
);
dir_driver
=
create_directory
(
&
root_directory
->
obj
,
&
dir_driver_str
,
0
,
HASH_SIZE
,
NULL
);
dir_device
=
create_directory
(
&
root_directory
->
obj
,
&
dir_device_str
,
0
,
HASH_SIZE
,
NULL
);
dir_objtype
=
create_directory
(
&
root_directory
->
obj
,
&
dir_objtype_str
,
0
,
HASH_SIZE
,
NULL
);
dir_sessions
=
create_directory
(
&
root_directory
->
obj
,
&
dir_sessions_str
,
0
,
HASH_SIZE
,
NULL
);
dir_kernel
=
create_directory
(
&
root_directory
->
obj
,
&
dir_kernel_str
,
0
,
HASH_SIZE
,
NULL
);
dir_windows
=
create_directory
(
&
root_directory
->
obj
,
&
dir_windows_str
,
0
,
HASH_SIZE
,
NULL
);
dir_winstation
=
create_directory
(
&
dir_windows
->
obj
,
&
dir_winstations_str
,
0
,
HASH_SIZE
,
NULL
);
make_object_static
(
&
root_directory
->
obj
);
make_object_static
(
&
dir_driver
->
obj
);
make_object_static
(
&
dir_objtype
->
obj
);
...
...
@@ -352,20 +346,20 @@ void init_directories(void)
dir_basenamed
=
create_directory
(
NULL
,
&
dir_basenamed_str
,
0
,
37
,
NULL
);
/* devices */
create_named_pipe_device
(
dir_device
,
&
named_pipe_str
);
create_mailslot_device
(
dir_device
,
&
mailslot_str
);
create_unix_device
(
dir_device
,
&
null_str
,
"/dev/null"
);
create_named_pipe_device
(
&
dir_device
->
obj
,
&
named_pipe_str
);
create_mailslot_device
(
&
dir_device
->
obj
,
&
mailslot_str
);
create_unix_device
(
&
dir_device
->
obj
,
&
null_str
,
"/dev/null"
);
/* symlinks */
link_dosdev
=
create_symlink
(
root_directory
,
&
link_dosdev_str
,
0
,
&
dir_global_str
,
NULL
);
link_global1
=
create_symlink
(
dir_global
,
&
link_global_str
,
0
,
&
dir_global_str
,
NULL
);
link_global2
=
create_symlink
(
dir_basenamed
,
&
link_global_str
,
0
,
&
dir_basenamed_str
,
NULL
);
link_local
=
create_symlink
(
dir_basenamed
,
&
link_local_str
,
0
,
&
dir_basenamed_str
,
NULL
);
link_nul
=
create_symlink
(
dir_global
,
&
link_nul_str
,
0
,
&
dir_null_str
,
NULL
);
link_pipe
=
create_symlink
(
dir_global
,
&
link_pipe_str
,
0
,
&
dir_named_pipe_str
,
NULL
);
link_mailslot
=
create_symlink
(
dir_global
,
&
link_mailslot_str
,
0
,
&
dir_mailslot_str
,
NULL
);
link_0
=
create_symlink
(
dir_sessions
,
&
link_0_str
,
0
,
&
dir_basenamed_str
,
NULL
);
link_session
=
create_symlink
(
dir_basenamed
,
&
link_session_str
,
0
,
&
link_sessions_str
,
NULL
);
link_dosdev
=
create_symlink
(
&
root_directory
->
obj
,
&
link_dosdev_str
,
0
,
&
dir_global_str
,
NULL
);
link_global1
=
create_symlink
(
&
dir_global
->
obj
,
&
link_global_str
,
0
,
&
dir_global_str
,
NULL
);
link_global2
=
create_symlink
(
&
dir_basenamed
->
obj
,
&
link_global_str
,
0
,
&
dir_basenamed_str
,
NULL
);
link_local
=
create_symlink
(
&
dir_basenamed
->
obj
,
&
link_local_str
,
0
,
&
dir_basenamed_str
,
NULL
);
link_nul
=
create_symlink
(
&
dir_global
->
obj
,
&
link_nul_str
,
0
,
&
dir_null_str
,
NULL
);
link_pipe
=
create_symlink
(
&
dir_global
->
obj
,
&
link_pipe_str
,
0
,
&
dir_named_pipe_str
,
NULL
);
link_mailslot
=
create_symlink
(
&
dir_global
->
obj
,
&
link_mailslot_str
,
0
,
&
dir_mailslot_str
,
NULL
);
link_0
=
create_symlink
(
&
dir_sessions
->
obj
,
&
link_0_str
,
0
,
&
dir_basenamed_str
,
NULL
);
link_session
=
create_symlink
(
&
dir_basenamed
->
obj
,
&
link_session_str
,
0
,
&
link_sessions_str
,
NULL
);
make_object_static
(
(
struct
object
*
)
link_dosdev
);
make_object_static
(
(
struct
object
*
)
link_global1
);
make_object_static
(
(
struct
object
*
)
link_global2
);
...
...
@@ -379,10 +373,10 @@ void init_directories(void)
/* events */
for
(
i
=
0
;
i
<
sizeof
(
kernel_events
)
/
sizeof
(
kernel_events
[
0
]);
i
++
)
{
struct
event
*
event
=
create_event
(
dir_kernel
,
&
kernel_events
[
i
],
0
,
1
,
0
,
NULL
);
struct
event
*
event
=
create_event
(
&
dir_kernel
->
obj
,
&
kernel_events
[
i
],
0
,
1
,
0
,
NULL
);
make_object_static
(
(
struct
object
*
)
event
);
}
keyed_event
=
create_keyed_event
(
dir_kernel
,
&
keyed_event_crit_sect_str
,
0
,
NULL
);
keyed_event
=
create_keyed_event
(
&
dir_kernel
->
obj
,
&
keyed_event_crit_sect_str
,
0
,
NULL
);
make_object_static
(
(
struct
object
*
)
keyed_event
);
/* the objects hold references so we can release these directories */
...
...
@@ -398,7 +392,8 @@ void init_directories(void)
DECL_HANDLER
(
create_directory
)
{
struct
unicode_str
name
;
struct
directory
*
dir
,
*
root
;
struct
object
*
root
;
struct
directory
*
dir
;
const
struct
security_descriptor
*
sd
;
const
struct
object_attributes
*
objattr
=
get_req_object_attributes
(
&
sd
,
&
name
,
&
root
);
...
...
@@ -425,7 +420,8 @@ DECL_HANDLER(open_directory)
/* get a directory entry by index */
DECL_HANDLER
(
get_directory_entry
)
{
struct
directory
*
dir
=
get_directory_obj
(
current
->
process
,
req
->
handle
,
DIRECTORY_QUERY
);
struct
directory
*
dir
=
(
struct
directory
*
)
get_handle_obj
(
current
->
process
,
req
->
handle
,
DIRECTORY_QUERY
,
&
directory_ops
);
if
(
dir
)
{
struct
object
*
obj
=
find_object_index
(
dir
->
entries
,
req
->
index
);
...
...
server/event.c
View file @
ff9d90bb
...
...
@@ -106,13 +106,13 @@ static const struct object_ops keyed_event_ops =
};
struct
event
*
create_event
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
struct
event
*
create_event
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
int
manual_reset
,
int
initial_state
,
const
struct
security_descriptor
*
sd
)
{
struct
event
*
event
;
if
((
event
=
create_named_object
_dir
(
root
,
name
,
attr
,
&
event_ops
)))
if
((
event
=
create_named_object
(
root
,
&
event_ops
,
name
,
attr
)))
{
if
(
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
{
...
...
@@ -206,12 +206,12 @@ static int event_signal( struct object *obj, unsigned int access )
return
1
;
}
struct
keyed_event
*
create_keyed_event
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
struct
keyed_event
*
create_keyed_event
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
const
struct
security_descriptor
*
sd
)
{
struct
keyed_event
*
event
;
if
((
event
=
create_named_object
_dir
(
root
,
name
,
attr
,
&
keyed_event_ops
)))
if
((
event
=
create_named_object
(
root
,
&
keyed_event_ops
,
name
,
attr
)))
{
if
(
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
{
...
...
@@ -284,7 +284,7 @@ DECL_HANDLER(create_event)
{
struct
event
*
event
;
struct
unicode_str
name
;
struct
directory
*
root
;
struct
object
*
root
;
const
struct
security_descriptor
*
sd
;
const
struct
object_attributes
*
objattr
=
get_req_object_attributes
(
&
sd
,
&
name
,
&
root
);
...
...
@@ -355,7 +355,7 @@ DECL_HANDLER(create_keyed_event)
{
struct
keyed_event
*
event
;
struct
unicode_str
name
;
struct
directory
*
root
;
struct
object
*
root
;
const
struct
security_descriptor
*
sd
;
const
struct
object_attributes
*
objattr
=
get_req_object_attributes
(
&
sd
,
&
name
,
&
root
);
...
...
server/file.h
View file @
ff9d90bb
...
...
@@ -141,9 +141,9 @@ extern int get_page_size(void);
/* device functions */
extern
void
create_named_pipe_device
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
);
extern
void
create_mailslot_device
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
);
extern
struct
device
*
create_unix_device
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
extern
void
create_named_pipe_device
(
struct
object
*
root
,
const
struct
unicode_str
*
name
);
extern
void
create_mailslot_device
(
struct
object
*
root
,
const
struct
unicode_str
*
name
);
extern
struct
device
*
create_unix_device
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
const
char
*
unix_path
);
/* change notification functions */
...
...
server/mailslot.c
View file @
ff9d90bb
...
...
@@ -397,11 +397,11 @@ static enum server_fd_type mailslot_device_get_fd_type( struct fd *fd )
return
FD_TYPE_DEVICE
;
}
void
create_mailslot_device
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
)
void
create_mailslot_device
(
struct
object
*
root
,
const
struct
unicode_str
*
name
)
{
struct
mailslot_device
*
dev
;
if
((
dev
=
create_named_object
_dir
(
root
,
name
,
0
,
&
mailslot_device_ops
))
&&
if
((
dev
=
create_named_object
(
root
,
&
mailslot_device_ops
,
name
,
0
))
&&
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
{
dev
->
mailslots
=
NULL
;
...
...
@@ -415,7 +415,7 @@ void create_mailslot_device( struct directory *root, const struct unicode_str *n
if
(
dev
)
make_object_static
(
&
dev
->
obj
);
}
static
struct
mailslot
*
create_mailslot
(
struct
directory
*
root
,
static
struct
mailslot
*
create_mailslot
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
int
max_msgsize
,
timeout_t
read_timeout
,
const
struct
security_descriptor
*
sd
)
...
...
@@ -423,7 +423,7 @@ static struct mailslot *create_mailslot( struct directory *root,
struct
mailslot
*
mailslot
;
int
fds
[
2
];
if
(
!
(
mailslot
=
create_named_object
_dir
(
root
,
name
,
attr
,
&
mailslot_ops
)))
return
NULL
;
if
(
!
(
mailslot
=
create_named_object
(
root
,
&
mailslot_ops
,
name
,
attr
)))
return
NULL
;
mailslot
->
fd
=
NULL
;
mailslot
->
write_fd
=
-
1
;
...
...
@@ -497,7 +497,7 @@ DECL_HANDLER(create_mailslot)
{
struct
mailslot
*
mailslot
;
struct
unicode_str
name
;
struct
directory
*
root
;
struct
object
*
root
;
const
struct
security_descriptor
*
sd
;
const
struct
object_attributes
*
objattr
=
get_req_object_attributes
(
&
sd
,
&
name
,
&
root
);
...
...
@@ -510,7 +510,7 @@ DECL_HANDLER(create_mailslot)
set_error
(
STATUS_OBJECT_PATH_SYNTAX_BAD
);
return
;
}
else
if
(
!
(
root
=
get_directory_obj
(
current
->
process
,
objattr
->
rootdir
,
0
)))
return
;
if
(
!
(
root
=
get_directory_obj
(
current
->
process
,
objattr
->
rootdir
)))
return
;
}
if
((
mailslot
=
create_mailslot
(
root
,
&
name
,
objattr
->
attributes
,
req
->
max_msgsize
,
...
...
server/mapping.c
View file @
ff9d90bb
...
...
@@ -470,7 +470,7 @@ static unsigned int get_image_params( struct mapping *mapping, int unix_fd, int
return
STATUS_INVALID_FILE_FOR_SECTION
;
}
static
struct
object
*
create_mapping
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
static
struct
object
*
create_mapping
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
mem_size_t
size
,
int
protect
,
obj_handle_t
handle
,
const
struct
security_descriptor
*
sd
)
{
...
...
@@ -483,7 +483,7 @@ static struct object *create_mapping( struct directory *root, const struct unico
if
(
!
page_mask
)
page_mask
=
sysconf
(
_SC_PAGESIZE
)
-
1
;
if
(
!
(
mapping
=
create_named_object
_dir
(
root
,
name
,
attr
,
&
mapping_ops
)))
if
(
!
(
mapping
=
create_named_object
(
root
,
&
mapping_ops
,
name
,
attr
)))
return
NULL
;
if
(
get_error
()
==
STATUS_OBJECT_NAME_EXISTS
)
return
&
mapping
->
obj
;
/* Nothing else to do */
...
...
@@ -661,9 +661,8 @@ int get_page_size(void)
/* create a file mapping */
DECL_HANDLER
(
create_mapping
)
{
struct
object
*
obj
;
struct
object
*
root
,
*
obj
;
struct
unicode_str
name
;
struct
directory
*
root
;
const
struct
security_descriptor
*
sd
;
const
struct
object_attributes
*
objattr
=
get_req_object_attributes
(
&
sd
,
&
name
,
&
root
);
...
...
server/mutex.c
View file @
ff9d90bb
...
...
@@ -99,12 +99,12 @@ static void do_release( struct mutex *mutex )
wake_up
(
&
mutex
->
obj
,
0
);
}
static
struct
mutex
*
create_mutex
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
static
struct
mutex
*
create_mutex
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
int
owned
,
const
struct
security_descriptor
*
sd
)
{
struct
mutex
*
mutex
;
if
((
mutex
=
create_named_object
_dir
(
root
,
name
,
attr
,
&
mutex_ops
)))
if
((
mutex
=
create_named_object
(
root
,
&
mutex_ops
,
name
,
attr
)))
{
if
(
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
{
...
...
@@ -210,7 +210,7 @@ DECL_HANDLER(create_mutex)
{
struct
mutex
*
mutex
;
struct
unicode_str
name
;
struct
directory
*
root
;
struct
object
*
root
;
const
struct
security_descriptor
*
sd
;
const
struct
object_attributes
*
objattr
=
get_req_object_attributes
(
&
sd
,
&
name
,
&
root
);
...
...
server/named_pipe.c
View file @
ff9d90bb
...
...
@@ -500,11 +500,11 @@ static enum server_fd_type named_pipe_device_get_fd_type( struct fd *fd )
return
FD_TYPE_DEVICE
;
}
void
create_named_pipe_device
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
)
void
create_named_pipe_device
(
struct
object
*
root
,
const
struct
unicode_str
*
name
)
{
struct
named_pipe_device
*
dev
;
if
((
dev
=
create_named_object
_dir
(
root
,
name
,
0
,
&
named_pipe_device_ops
))
&&
if
((
dev
=
create_named_object
(
root
,
&
named_pipe_device_ops
,
name
,
0
))
&&
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
{
dev
->
pipes
=
NULL
;
...
...
@@ -892,7 +892,7 @@ DECL_HANDLER(create_named_pipe)
struct
named_pipe
*
pipe
;
struct
pipe_server
*
server
;
struct
unicode_str
name
;
struct
directory
*
root
;
struct
object
*
root
;
const
struct
security_descriptor
*
sd
;
const
struct
object_attributes
*
objattr
=
get_req_object_attributes
(
&
sd
,
&
name
,
&
root
);
...
...
@@ -912,10 +912,10 @@ DECL_HANDLER(create_named_pipe)
set_error
(
STATUS_OBJECT_PATH_SYNTAX_BAD
);
return
;
}
else
if
(
!
(
root
=
get_directory_obj
(
current
->
process
,
objattr
->
rootdir
,
0
)))
return
;
if
(
!
(
root
=
get_directory_obj
(
current
->
process
,
objattr
->
rootdir
)))
return
;
}
pipe
=
create_named_object
_dir
(
root
,
&
name
,
objattr
->
attributes
|
OBJ_OPENIF
,
&
named_pipe_ops
);
pipe
=
create_named_object
(
root
,
&
named_pipe_ops
,
&
name
,
objattr
->
attributes
|
OBJ_OPENIF
);
if
(
root
)
release_object
(
root
);
if
(
!
pipe
)
return
;
...
...
server/object.h
View file @
ff9d90bb
...
...
@@ -44,7 +44,6 @@ struct wait_queue_entry;
struct
async
;
struct
async_queue
;
struct
winstation
;
struct
directory
;
struct
object_type
;
...
...
@@ -177,10 +176,10 @@ extern void close_objects(void);
struct
event
;
struct
keyed_event
;
extern
struct
event
*
create_event
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
extern
struct
event
*
create_event
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
int
manual_reset
,
int
initial_state
,
const
struct
security_descriptor
*
sd
);
extern
struct
keyed_event
*
create_keyed_event
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
extern
struct
keyed_event
*
create_keyed_event
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
const
struct
security_descriptor
*
sd
);
extern
struct
event
*
get_event_obj
(
struct
process
*
process
,
obj_handle_t
handle
,
unsigned
int
access
);
extern
struct
keyed_event
*
get_keyed_event_obj
(
struct
process
*
process
,
obj_handle_t
handle
,
unsigned
int
access
);
...
...
@@ -230,16 +229,14 @@ extern void release_global_atom( struct winstation *winstation, atom_t atom );
/* directory functions */
extern
struct
object
*
get_root_directory
(
void
);
extern
struct
directory
*
get_directory_obj
(
struct
process
*
process
,
obj_handle_t
handle
,
unsigned
int
access
);
extern
void
*
create_named_object_dir
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
const
struct
object_ops
*
ops
);
extern
struct
object
*
get_directory_obj
(
struct
process
*
process
,
obj_handle_t
handle
);
extern
struct
object_type
*
get_object_type
(
const
struct
unicode_str
*
name
);
extern
int
directory_link_name
(
struct
object
*
obj
,
struct
object_name
*
name
,
struct
object
*
parent
);
extern
void
init_directories
(
void
);
/* symbolic link functions */
extern
struct
symlink
*
create_symlink
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
extern
struct
symlink
*
create_symlink
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
const
struct
unicode_str
*
target
,
const
struct
security_descriptor
*
sd
);
...
...
server/process.c
View file @
ff9d90bb
...
...
@@ -181,12 +181,12 @@ static const struct object_ops job_ops =
job_destroy
/* destroy */
};
static
struct
job
*
create_job_object
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
static
struct
job
*
create_job_object
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
const
struct
security_descriptor
*
sd
)
{
struct
job
*
job
;
if
((
job
=
create_named_object
_dir
(
root
,
name
,
attr
,
&
job_ops
)))
if
((
job
=
create_named_object
(
root
,
&
job_ops
,
name
,
attr
)))
{
if
(
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
{
...
...
@@ -1544,7 +1544,7 @@ DECL_HANDLER(create_job)
{
struct
job
*
job
;
struct
unicode_str
name
;
struct
directory
*
root
;
struct
object
*
root
;
const
struct
security_descriptor
*
sd
;
const
struct
object_attributes
*
objattr
=
get_req_object_attributes
(
&
sd
,
&
name
,
&
root
);
...
...
server/request.c
View file @
ff9d90bb
...
...
@@ -170,7 +170,7 @@ void *set_reply_data_size( data_size_t size )
/* return object attributes from the current request */
const
struct
object_attributes
*
get_req_object_attributes
(
const
struct
security_descriptor
**
sd
,
struct
unicode_str
*
name
,
struct
directory
**
root
)
struct
object
**
root
)
{
static
const
struct
object_attributes
empty_attributes
;
const
struct
object_attributes
*
attr
=
get_req_data
();
...
...
@@ -203,7 +203,7 @@ const struct object_attributes *get_req_object_attributes( const struct security
}
if
(
root
&&
attr
->
rootdir
&&
attr
->
name_len
)
{
if
(
!
(
*
root
=
get_directory_obj
(
current
->
process
,
attr
->
rootdir
,
0
)))
return
NULL
;
if
(
!
(
*
root
=
get_directory_obj
(
current
->
process
,
attr
->
rootdir
)))
return
NULL
;
}
*
sd
=
attr
->
sd_len
?
(
const
struct
security_descriptor
*
)(
attr
+
1
)
:
NULL
;
name
->
len
=
attr
->
name_len
;
...
...
server/request.h
View file @
ff9d90bb
...
...
@@ -48,7 +48,7 @@ extern const char *get_config_dir(void);
extern
void
*
set_reply_data_size
(
data_size_t
size
);
extern
const
struct
object_attributes
*
get_req_object_attributes
(
const
struct
security_descriptor
**
sd
,
struct
unicode_str
*
name
,
struct
directory
**
root
);
struct
object
**
root
);
extern
const
void
*
get_req_data_after_objattr
(
const
struct
object_attributes
*
attr
,
data_size_t
*
len
);
extern
int
receive_fd
(
struct
process
*
process
);
extern
int
send_client_fd
(
struct
process
*
process
,
int
fd
,
obj_handle_t
handle
);
...
...
server/semaphore.c
View file @
ff9d90bb
...
...
@@ -73,7 +73,7 @@ static const struct object_ops semaphore_ops =
};
static
struct
semaphore
*
create_semaphore
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
static
struct
semaphore
*
create_semaphore
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
unsigned
int
initial
,
unsigned
int
max
,
const
struct
security_descriptor
*
sd
)
{
...
...
@@ -84,7 +84,7 @@ static struct semaphore *create_semaphore( struct directory *root, const struct
set_error
(
STATUS_INVALID_PARAMETER
);
return
NULL
;
}
if
((
sem
=
create_named_object
_dir
(
root
,
name
,
attr
,
&
semaphore_ops
)))
if
((
sem
=
create_named_object
(
root
,
&
semaphore_ops
,
name
,
attr
)))
{
if
(
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
{
...
...
@@ -178,7 +178,7 @@ DECL_HANDLER(create_semaphore)
{
struct
semaphore
*
sem
;
struct
unicode_str
name
;
struct
directory
*
root
;
struct
object
*
root
;
const
struct
security_descriptor
*
sd
;
const
struct
object_attributes
*
objattr
=
get_req_object_attributes
(
&
sd
,
&
name
,
&
root
);
...
...
server/symlink.c
View file @
ff9d90bb
...
...
@@ -133,7 +133,7 @@ static void symlink_destroy( struct object *obj )
free
(
symlink
->
target
);
}
struct
symlink
*
create_symlink
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
struct
symlink
*
create_symlink
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
const
struct
unicode_str
*
target
,
const
struct
security_descriptor
*
sd
)
{
...
...
@@ -144,7 +144,7 @@ struct symlink *create_symlink( struct directory *root, const struct unicode_str
set_error
(
STATUS_INVALID_PARAMETER
);
return
NULL
;
}
if
((
symlink
=
create_named_object
_dir
(
root
,
name
,
attr
,
&
symlink_ops
))
&&
if
((
symlink
=
create_named_object
(
root
,
&
symlink_ops
,
name
,
attr
))
&&
(
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
))
{
if
((
symlink
->
target
=
memdup
(
target
->
str
,
target
->
len
)))
...
...
@@ -170,7 +170,7 @@ DECL_HANDLER(create_symlink)
{
struct
symlink
*
symlink
;
struct
unicode_str
name
,
target
;
struct
directory
*
root
;
struct
object
*
root
;
const
struct
security_descriptor
*
sd
;
const
struct
object_attributes
*
objattr
=
get_req_object_attributes
(
&
sd
,
&
name
,
&
root
);
...
...
server/timer.c
View file @
ff9d90bb
...
...
@@ -81,12 +81,12 @@ static const struct object_ops timer_ops =
/* create a timer object */
static
struct
timer
*
create_timer
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
static
struct
timer
*
create_timer
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
int
manual
,
const
struct
security_descriptor
*
sd
)
{
struct
timer
*
timer
;
if
((
timer
=
create_named_object
_dir
(
root
,
name
,
attr
,
&
timer_ops
)))
if
((
timer
=
create_named_object
(
root
,
&
timer_ops
,
name
,
attr
)))
{
if
(
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
{
...
...
@@ -234,7 +234,7 @@ DECL_HANDLER(create_timer)
{
struct
timer
*
timer
;
struct
unicode_str
name
;
struct
directory
*
root
;
struct
object
*
root
;
const
struct
security_descriptor
*
sd
;
const
struct
object_attributes
*
objattr
=
get_req_object_attributes
(
&
sd
,
&
name
,
&
root
);
...
...
server/winstation.c
View file @
ff9d90bb
...
...
@@ -105,12 +105,12 @@ static const struct object_ops desktop_ops =
#define DESKTOP_ALL_ACCESS 0x01ff
/* create a winstation object */
static
struct
winstation
*
create_winstation
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
static
struct
winstation
*
create_winstation
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
unsigned
int
flags
)
{
struct
winstation
*
winstation
;
if
((
winstation
=
create_named_object
_dir
(
root
,
name
,
attr
,
&
winstation_ops
)))
if
((
winstation
=
create_named_object
(
root
,
&
winstation_ops
,
name
,
attr
)))
{
if
(
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
{
...
...
@@ -438,10 +438,10 @@ DECL_HANDLER(create_winstation)
{
struct
winstation
*
winstation
;
struct
unicode_str
name
=
get_req_unicode_str
();
struct
directory
*
root
=
NULL
;
struct
object
*
root
=
NULL
;
reply
->
handle
=
0
;
if
(
req
->
rootdir
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
req
->
rootdir
,
0
)))
return
;
if
(
req
->
rootdir
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
req
->
rootdir
)))
return
;
if
((
winstation
=
create_winstation
(
root
,
&
name
,
req
->
attributes
,
req
->
flags
)))
{
...
...
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