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
0458a7d0
Commit
0458a7d0
authored
Feb 08, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Use the lookup_name operation when creating a named object.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e2ccc978
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
42 deletions
+17
-42
directory.c
server/directory.c
+1
-30
object.c
server/object.c
+14
-10
object.h
server/object.h
+1
-1
winstation.c
server/winstation.c
+1
-1
No files found.
server/directory.c
View file @
0458a7d0
...
...
@@ -254,36 +254,7 @@ struct object *find_object_dir( struct directory *root, const struct unicode_str
void
*
create_named_object_dir
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attributes
,
const
struct
object_ops
*
ops
)
{
struct
object
*
obj
,
*
new_obj
=
NULL
;
struct
unicode_str
new_name
;
if
(
!
name
||
!
name
->
len
)
{
if
((
new_obj
=
alloc_object
(
ops
)))
clear_error
();
return
new_obj
;
}
if
(
!
(
obj
=
find_object_dir
(
root
,
name
,
attributes
,
&
new_name
)))
return
NULL
;
if
(
!
new_name
.
len
)
{
if
(
attributes
&
OBJ_OPENIF
&&
obj
->
ops
==
ops
)
set_error
(
STATUS_OBJECT_NAME_EXISTS
);
else
{
release_object
(
obj
);
obj
=
NULL
;
if
(
attributes
&
OBJ_OPENIF
)
set_error
(
STATUS_OBJECT_TYPE_MISMATCH
);
else
set_error
(
STATUS_OBJECT_NAME_COLLISION
);
}
return
obj
;
}
if
((
new_obj
=
create_object
(
obj
,
ops
,
&
new_name
)))
clear_error
();
release_object
(
obj
);
return
new_obj
;
return
create_named_object
(
&
root
->
obj
,
ops
,
name
,
attributes
);
}
/* open a new handle to an existing object */
...
...
server/object.c
View file @
0458a7d0
...
...
@@ -282,18 +282,20 @@ void *create_object( struct object *parent, const struct object_ops *ops, const
return
obj
;
}
void
*
create_named_object
(
struct
object
*
parent
,
struct
namespace
*
namespace
,
const
struct
object_ops
*
ops
,
/* create an object as named child under the specified parent */
void
*
create_named_object
(
struct
object
*
parent
,
const
struct
object_ops
*
ops
,
const
struct
unicode_str
*
name
,
unsigned
int
attributes
)
{
struct
object
*
obj
;
struct
object
*
obj
,
*
new_obj
;
struct
unicode_str
new_name
;
if
(
!
name
||
!
name
->
len
)
{
if
((
obj
=
alloc_object
(
ops
)))
clear_error
();
return
obj
;
}
clear_error
();
if
((
obj
=
find_object
(
namespace
,
name
,
attributes
)))
if
(
!
name
||
!
name
->
len
)
return
alloc_object
(
ops
);
if
(
!
(
obj
=
lookup_named_object
(
parent
,
name
,
attributes
,
&
new_name
)))
return
NULL
;
if
(
!
new_name
.
len
)
{
if
(
attributes
&
OBJ_OPENIF
&&
obj
->
ops
==
ops
)
set_error
(
STATUS_OBJECT_NAME_EXISTS
);
...
...
@@ -308,8 +310,10 @@ void *create_named_object( struct object *parent, struct namespace *namespace, c
}
return
obj
;
}
if
((
obj
=
create_object
(
parent
,
ops
,
name
)))
clear_error
();
return
obj
;
new_obj
=
create_object
(
obj
,
ops
,
&
new_name
);
release_object
(
obj
);
return
new_obj
;
}
/* recursive helper for dump_object_name */
...
...
server/object.h
View file @
0458a7d0
...
...
@@ -136,7 +136,7 @@ extern struct object *lookup_named_object( struct object *root, const struct uni
unsigned
int
attr
,
struct
unicode_str
*
name_left
);
extern
void
*
create_object
(
struct
object
*
parent
,
const
struct
object_ops
*
ops
,
const
struct
unicode_str
*
name
);
extern
void
*
create_named_object
(
struct
object
*
parent
,
struct
namespace
*
namespace
,
const
struct
object_ops
*
ops
,
extern
void
*
create_named_object
(
struct
object
*
parent
,
const
struct
object_ops
*
ops
,
const
struct
unicode_str
*
name
,
unsigned
int
attributes
);
extern
void
unlink_named_object
(
struct
object
*
obj
);
extern
void
make_object_static
(
struct
object
*
obj
);
...
...
server/winstation.c
View file @
0458a7d0
...
...
@@ -217,7 +217,7 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned
{
struct
desktop
*
desktop
;
if
((
desktop
=
create_named_object
(
&
winstation
->
obj
,
winstation
->
desktop_names
,
&
desktop_ops
,
name
,
attr
)))
if
((
desktop
=
create_named_object
(
&
winstation
->
obj
,
&
desktop_ops
,
name
,
attr
)))
{
if
(
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
{
...
...
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