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
ed268bbf
Commit
ed268bbf
authored
Jan 29, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Use a common helper function to implement open object calls.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
38f9a788
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
46 additions
and
143 deletions
+46
-143
completion.c
server/completion.c
+2
-14
directory.c
server/directory.c
+2
-11
event.c
server/event.c
+4
-22
handle.c
server/handle.c
+11
-10
handle.h
server/handle.h
+3
-2
mapping.c
server/mapping.c
+2
-12
mutex.c
server/mutex.c
+2
-12
process.c
server/process.c
+2
-10
semaphore.c
server/semaphore.c
+2
-12
symlink.c
server/symlink.c
+2
-12
timer.c
server/timer.c
+2
-12
winstation.c
server/winstation.c
+12
-14
No files found.
server/completion.c
View file @
ed268bbf
...
...
@@ -196,23 +196,11 @@ DECL_HANDLER(create_completion)
/* open a completion */
DECL_HANDLER
(
open_completion
)
{
struct
completion
*
completion
;
struct
unicode_str
name
;
struct
directory
*
root
=
NULL
;
reply
->
handle
=
0
;
get_req_unicode_str
(
&
name
);
if
(
req
->
rootdir
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
req
->
rootdir
,
0
)))
return
;
if
(
(
completion
=
open_object_dir
(
root
,
&
name
,
req
->
attributes
,
&
completion_ops
))
!=
NULL
)
{
reply
->
handle
=
alloc_handle
(
current
->
process
,
completion
,
req
->
access
,
req
->
attributes
);
release_object
(
completion
);
}
if
(
root
)
release_object
(
root
);
reply
->
handle
=
open_object
(
current
->
process
,
req
->
rootdir
,
req
->
access
,
&
completion_ops
,
&
name
,
req
->
attributes
);
}
...
...
server/directory.c
View file @
ed268bbf
...
...
@@ -523,19 +523,10 @@ DECL_HANDLER(create_directory)
DECL_HANDLER
(
open_directory
)
{
struct
unicode_str
name
;
struct
directory
*
dir
,
*
root
=
NULL
;
get_req_unicode_str
(
&
name
);
if
(
req
->
rootdir
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
req
->
rootdir
,
0
)))
return
;
if
((
dir
=
open_object_dir
(
root
,
&
name
,
req
->
attributes
,
&
directory_ops
)))
{
reply
->
handle
=
alloc_handle
(
current
->
process
,
&
dir
->
obj
,
req
->
access
,
req
->
attributes
);
release_object
(
dir
);
}
if
(
root
)
release_object
(
root
);
reply
->
handle
=
open_object
(
current
->
process
,
req
->
rootdir
,
req
->
access
,
&
directory_ops
,
&
name
,
req
->
attributes
);
}
/* get a directory entry by index */
...
...
server/event.c
View file @
ed268bbf
...
...
@@ -307,20 +307,10 @@ DECL_HANDLER(create_event)
DECL_HANDLER
(
open_event
)
{
struct
unicode_str
name
;
struct
directory
*
root
=
NULL
;
struct
event
*
event
;
get_req_unicode_str
(
&
name
);
if
(
req
->
rootdir
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
req
->
rootdir
,
0
)))
return
;
if
((
event
=
open_object_dir
(
root
,
&
name
,
req
->
attributes
,
&
event_ops
)))
{
reply
->
handle
=
alloc_handle
(
current
->
process
,
&
event
->
obj
,
req
->
access
,
req
->
attributes
);
release_object
(
event
);
}
if
(
root
)
release_object
(
root
);
reply
->
handle
=
open_object
(
current
->
process
,
req
->
rootdir
,
req
->
access
,
&
event_ops
,
&
name
,
req
->
attributes
);
}
/* do an event operation */
...
...
@@ -389,16 +379,8 @@ DECL_HANDLER(create_keyed_event)
DECL_HANDLER
(
open_keyed_event
)
{
struct
unicode_str
name
;
struct
directory
*
root
=
NULL
;
struct
keyed_event
*
event
;
get_req_unicode_str
(
&
name
);
if
(
req
->
rootdir
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
req
->
rootdir
,
0
)))
return
;
if
((
event
=
open_object_dir
(
root
,
&
name
,
req
->
attributes
,
&
keyed_event_ops
)))
{
reply
->
handle
=
alloc_handle
(
current
->
process
,
&
event
->
obj
,
req
->
access
,
req
->
attributes
);
release_object
(
event
);
}
if
(
root
)
release_object
(
root
);
reply
->
handle
=
open_object
(
current
->
process
,
req
->
rootdir
,
req
->
access
,
&
keyed_event_ops
,
&
name
,
req
->
attributes
);
}
server/handle.c
View file @
ed268bbf
...
...
@@ -571,21 +571,22 @@ obj_handle_t duplicate_handle( struct process *src, obj_handle_t src_handle, str
}
/* open a new handle to an existing object */
obj_handle_t
open_object
(
const
struct
namespace
*
namespace
,
const
struct
unicode_str
*
name
,
const
struct
object_ops
*
ops
,
unsigned
int
access
,
unsigned
int
attr
)
obj_handle_t
open_object
(
struct
process
*
process
,
obj_handle_t
parent
,
unsigned
int
access
,
const
struct
object_ops
*
ops
,
const
struct
unicode_str
*
name
,
unsigned
int
attributes
)
{
obj_handle_t
handle
=
0
;
struct
object
*
obj
=
find_object
(
namespace
,
name
,
attr
);
if
(
obj
)
struct
directory
*
root
=
NULL
;
struct
object
*
obj
;
if
(
parent
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
parent
,
0
)))
return
0
;
if
((
obj
=
open_object_dir
(
root
,
name
,
attributes
,
ops
)))
{
if
(
ops
&&
obj
->
ops
!=
ops
)
set_error
(
STATUS_OBJECT_TYPE_MISMATCH
);
else
handle
=
alloc_handle
(
current
->
process
,
obj
,
access
,
attr
);
handle
=
alloc_handle
(
current
->
process
,
obj
,
access
,
attributes
);
release_object
(
obj
);
}
else
set_error
(
STATUS_OBJECT_NAME_NOT_FOUND
);
if
(
root
)
release_object
(
root
);
return
handle
;
}
...
...
server/handle.h
View file @
ed268bbf
...
...
@@ -44,8 +44,9 @@ extern struct object *get_handle_obj( struct process *process, obj_handle_t hand
extern
unsigned
int
get_handle_access
(
struct
process
*
process
,
obj_handle_t
handle
);
extern
obj_handle_t
duplicate_handle
(
struct
process
*
src
,
obj_handle_t
src_handle
,
struct
process
*
dst
,
unsigned
int
access
,
unsigned
int
attr
,
unsigned
int
options
);
extern
obj_handle_t
open_object
(
const
struct
namespace
*
namespace
,
const
struct
unicode_str
*
name
,
const
struct
object_ops
*
ops
,
unsigned
int
access
,
unsigned
int
attr
);
extern
obj_handle_t
open_object
(
struct
process
*
process
,
obj_handle_t
parent
,
unsigned
int
access
,
const
struct
object_ops
*
ops
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
);
extern
obj_handle_t
find_inherited_handle
(
struct
process
*
process
,
const
struct
object_ops
*
ops
);
extern
obj_handle_t
enumerate_handles
(
struct
process
*
process
,
const
struct
object_ops
*
ops
,
unsigned
int
*
index
);
...
...
server/mapping.c
View file @
ed268bbf
...
...
@@ -688,20 +688,10 @@ DECL_HANDLER(create_mapping)
DECL_HANDLER
(
open_mapping
)
{
struct
unicode_str
name
;
struct
directory
*
root
=
NULL
;
struct
mapping
*
mapping
;
get_req_unicode_str
(
&
name
);
if
(
req
->
rootdir
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
req
->
rootdir
,
0
)))
return
;
if
((
mapping
=
open_object_dir
(
root
,
&
name
,
req
->
attributes
,
&
mapping_ops
)))
{
reply
->
handle
=
alloc_handle
(
current
->
process
,
&
mapping
->
obj
,
req
->
access
,
req
->
attributes
);
release_object
(
mapping
);
}
if
(
root
)
release_object
(
root
);
reply
->
handle
=
open_object
(
current
->
process
,
req
->
rootdir
,
req
->
access
,
&
mapping_ops
,
&
name
,
req
->
attributes
);
}
/* get a mapping information */
...
...
server/mutex.c
View file @
ed268bbf
...
...
@@ -234,20 +234,10 @@ DECL_HANDLER(create_mutex)
DECL_HANDLER
(
open_mutex
)
{
struct
unicode_str
name
;
struct
directory
*
root
=
NULL
;
struct
mutex
*
mutex
;
get_req_unicode_str
(
&
name
);
if
(
req
->
rootdir
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
req
->
rootdir
,
0
)))
return
;
if
((
mutex
=
open_object_dir
(
root
,
&
name
,
req
->
attributes
,
&
mutex_ops
)))
{
reply
->
handle
=
alloc_handle
(
current
->
process
,
&
mutex
->
obj
,
req
->
access
,
req
->
attributes
);
release_object
(
mutex
);
}
if
(
root
)
release_object
(
root
);
reply
->
handle
=
open_object
(
current
->
process
,
req
->
rootdir
,
req
->
access
,
&
mutex_ops
,
&
name
,
req
->
attributes
);
}
/* release a mutex */
...
...
server/process.c
View file @
ed268bbf
...
...
@@ -1561,19 +1561,11 @@ DECL_HANDLER(create_job)
/* open a job object */
DECL_HANDLER
(
open_job
)
{
struct
job
*
job
;
struct
unicode_str
name
;
struct
directory
*
root
=
NULL
;
get_req_unicode_str
(
&
name
);
if
(
req
->
rootdir
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
req
->
rootdir
,
0
)))
return
;
if
((
job
=
open_object_dir
(
root
,
&
name
,
req
->
attributes
,
&
job_ops
)))
{
reply
->
handle
=
alloc_handle
(
current
->
process
,
&
job
->
obj
,
req
->
access
,
req
->
attributes
);
release_object
(
job
);
}
if
(
root
)
release_object
(
root
);
reply
->
handle
=
open_object
(
current
->
process
,
req
->
rootdir
,
req
->
access
,
&
job_ops
,
&
name
,
req
->
attributes
);
}
/* assign a job object to a process */
...
...
server/semaphore.c
View file @
ed268bbf
...
...
@@ -202,20 +202,10 @@ DECL_HANDLER(create_semaphore)
DECL_HANDLER
(
open_semaphore
)
{
struct
unicode_str
name
;
struct
directory
*
root
=
NULL
;
struct
semaphore
*
sem
;
get_req_unicode_str
(
&
name
);
if
(
req
->
rootdir
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
req
->
rootdir
,
0
)))
return
;
if
((
sem
=
open_object_dir
(
root
,
&
name
,
req
->
attributes
,
&
semaphore_ops
)))
{
reply
->
handle
=
alloc_handle
(
current
->
process
,
&
sem
->
obj
,
req
->
access
,
req
->
attributes
);
release_object
(
sem
);
}
if
(
root
)
release_object
(
root
);
reply
->
handle
=
open_object
(
current
->
process
,
req
->
rootdir
,
req
->
access
,
&
semaphore_ops
,
&
name
,
req
->
attributes
);
}
/* release a semaphore */
...
...
server/symlink.c
View file @
ed268bbf
...
...
@@ -190,20 +190,10 @@ DECL_HANDLER(create_symlink)
DECL_HANDLER
(
open_symlink
)
{
struct
unicode_str
name
;
struct
directory
*
root
=
NULL
;
struct
symlink
*
symlink
;
get_req_unicode_str
(
&
name
);
if
(
req
->
rootdir
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
req
->
rootdir
,
0
)))
return
;
if
((
symlink
=
open_object_dir
(
root
,
&
name
,
req
->
attributes
|
OBJ_OPENLINK
,
&
symlink_ops
)))
{
reply
->
handle
=
alloc_handle
(
current
->
process
,
&
symlink
->
obj
,
req
->
access
,
req
->
attributes
);
release_object
(
symlink
);
}
if
(
root
)
release_object
(
root
);
reply
->
handle
=
open_object
(
current
->
process
,
req
->
rootdir
,
req
->
access
,
&
symlink_ops
,
&
name
,
req
->
attributes
|
OBJ_OPENLINK
);
}
/* query a symbolic link object */
...
...
server/timer.c
View file @
ed268bbf
...
...
@@ -252,20 +252,10 @@ DECL_HANDLER(create_timer)
DECL_HANDLER
(
open_timer
)
{
struct
unicode_str
name
;
struct
directory
*
root
=
NULL
;
struct
timer
*
timer
;
get_req_unicode_str
(
&
name
);
if
(
req
->
rootdir
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
req
->
rootdir
,
0
)))
return
;
if
((
timer
=
open_object_dir
(
root
,
&
name
,
req
->
attributes
,
&
timer_ops
)))
{
reply
->
handle
=
alloc_handle
(
current
->
process
,
&
timer
->
obj
,
req
->
access
,
req
->
attributes
);
release_object
(
timer
);
}
if
(
root
)
release_object
(
root
);
reply
->
handle
=
open_object
(
current
->
process
,
req
->
rootdir
,
req
->
access
,
&
timer_ops
,
&
name
,
req
->
attributes
);
}
/* set a waitable timer */
...
...
server/winstation.c
View file @
ed268bbf
...
...
@@ -419,19 +419,11 @@ DECL_HANDLER(create_winstation)
/* open a handle to a window station */
DECL_HANDLER
(
open_winstation
)
{
struct
winstation
*
winstation
;
struct
unicode_str
name
;
struct
directory
*
root
=
NULL
;
get_req_unicode_str
(
&
name
);
if
(
req
->
rootdir
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
req
->
rootdir
,
0
)))
return
;
if
((
winstation
=
open_object_dir
(
root
,
&
name
,
req
->
attributes
,
&
winstation_ops
)))
{
reply
->
handle
=
alloc_handle
(
current
->
process
,
&
winstation
->
obj
,
req
->
access
,
req
->
attributes
);
release_object
(
winstation
);
}
if
(
root
)
release_object
(
root
);
reply
->
handle
=
open_object
(
current
->
process
,
req
->
rootdir
,
req
->
access
,
&
winstation_ops
,
&
name
,
req
->
attributes
);
}
...
...
@@ -494,6 +486,7 @@ DECL_HANDLER(create_desktop)
DECL_HANDLER
(
open_desktop
)
{
struct
winstation
*
winstation
;
struct
object
*
obj
;
struct
unicode_str
name
;
get_req_unicode_str
(
&
name
);
...
...
@@ -504,12 +497,17 @@ DECL_HANDLER(open_desktop)
else
winstation
=
(
struct
winstation
*
)
get_handle_obj
(
current
->
process
,
req
->
winsta
,
0
,
&
winstation_ops
);
if
(
winstation
)
if
(
!
winstation
)
return
;
if
((
obj
=
find_object
(
winstation
->
desktop_names
,
&
name
,
req
->
attributes
)))
{
reply
->
handle
=
open_object
(
winstation
->
desktop_names
,
&
name
,
&
desktop_ops
,
req
->
access
,
req
->
attributes
);
release_object
(
winstation
);
assert
(
obj
->
ops
==
&
desktop_ops
);
reply
->
handle
=
alloc_handle
(
current
->
process
,
obj
,
req
->
access
,
req
->
attributes
);
release_object
(
obj
);
}
else
set_error
(
STATUS_OBJECT_NAME_NOT_FOUND
);
release_object
(
winstation
);
}
/* open a handle to current input desktop */
...
...
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