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
7a5b14d4
Commit
7a5b14d4
authored
Feb 08, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Add a function to open a named object inside any parent, not only directories.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0458a7d0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
20 deletions
+25
-20
winstation.c
dlls/user32/tests/winstation.c
+0
-2
directory.c
server/directory.c
+1
-15
object.c
server/object.c
+21
-0
object.h
server/object.h
+2
-0
winstation.c
server/winstation.c
+1
-3
No files found.
dlls/user32/tests/winstation.c
View file @
7a5b14d4
...
...
@@ -278,7 +278,6 @@ static void test_handles(void)
SetLastError
(
0xdeadbeef
);
d2
=
OpenDesktopA
(
""
,
0
,
TRUE
,
DESKTOP_ALL_ACCESS
);
ok
(
!
d2
,
"open mepty desktop succeeded
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
...
...
@@ -289,7 +288,6 @@ static void test_handles(void)
SetLastError
(
0xdeadbeef
);
d2
=
OpenDesktopA
(
"foo
\\
bar"
,
0
,
TRUE
,
DESKTOP_ALL_ACCESS
);
ok
(
!
d2
,
"open desktop succeeded
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_BAD_PATHNAME
,
"wrong error %u
\n
"
,
GetLastError
()
);
d2
=
CreateDesktopA
(
"foobar"
,
NULL
,
NULL
,
0
,
DESKTOP_ALL_ACCESS
,
NULL
);
...
...
server/directory.c
View file @
7a5b14d4
...
...
@@ -261,21 +261,7 @@ void *create_named_object_dir( struct directory *root, const struct unicode_str
void
*
open_object_dir
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
const
struct
object_ops
*
ops
)
{
struct
unicode_str
name_left
;
struct
object
*
obj
;
if
((
obj
=
find_object_dir
(
root
,
name
,
attr
,
&
name_left
)))
{
if
(
name_left
.
len
)
/* not fully parsed */
set_error
(
STATUS_OBJECT_NAME_NOT_FOUND
);
else
if
(
ops
&&
obj
->
ops
!=
ops
)
set_error
(
STATUS_OBJECT_TYPE_MISMATCH
);
else
return
obj
;
release_object
(
obj
);
}
return
NULL
;
return
open_named_object
(
&
root
->
obj
,
ops
,
name
,
attr
);
}
/* retrieve an object type, creating it if needed */
...
...
server/object.c
View file @
7a5b14d4
...
...
@@ -316,6 +316,27 @@ void *create_named_object( struct object *parent, const struct object_ops *ops,
return
new_obj
;
}
/* open a object by name under the specified parent */
void
*
open_named_object
(
struct
object
*
parent
,
const
struct
object_ops
*
ops
,
const
struct
unicode_str
*
name
,
unsigned
int
attributes
)
{
struct
unicode_str
name_left
;
struct
object
*
obj
;
if
((
obj
=
lookup_named_object
(
parent
,
name
,
attributes
,
&
name_left
)))
{
if
(
name_left
.
len
)
/* not fully parsed */
set_error
(
STATUS_OBJECT_NAME_NOT_FOUND
);
else
if
(
ops
&&
obj
->
ops
!=
ops
)
set_error
(
STATUS_OBJECT_TYPE_MISMATCH
);
else
return
obj
;
release_object
(
obj
);
}
return
NULL
;
}
/* recursive helper for dump_object_name */
static
void
dump_name
(
struct
object
*
obj
)
{
...
...
server/object.h
View file @
7a5b14d4
...
...
@@ -138,6 +138,8 @@ 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
,
const
struct
object_ops
*
ops
,
const
struct
unicode_str
*
name
,
unsigned
int
attributes
);
extern
void
*
open_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
);
extern
struct
namespace
*
create_namespace
(
unsigned
int
hash_size
);
...
...
server/winstation.c
View file @
7a5b14d4
...
...
@@ -534,13 +534,11 @@ DECL_HANDLER(open_desktop)
if
(
!
winstation
)
return
;
if
((
obj
=
find_object
(
winstation
->
desktop_name
s
,
&
name
,
req
->
attributes
)))
if
((
obj
=
open_named_object
(
&
winstation
->
obj
,
&
desktop_op
s
,
&
name
,
req
->
attributes
)))
{
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
);
}
...
...
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