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
7ad32cf5
Commit
7ad32cf5
authored
Feb 09, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Allow lookup_name to distinguish the case of an empty path.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9a08714c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
15 deletions
+18
-15
winstation.c
dlls/user32/tests/winstation.c
+0
-1
directory.c
server/directory.c
+3
-3
mailslot.c
server/mailslot.c
+2
-0
named_pipe.c
server/named_pipe.c
+2
-0
object.c
server/object.c
+6
-4
symlink.c
server/symlink.c
+3
-1
winstation.c
server/winstation.c
+2
-6
No files found.
dlls/user32/tests/winstation.c
View file @
7ad32cf5
...
...
@@ -225,7 +225,6 @@ static void test_handles(void)
SetLastError
(
0xdeadbeef
);
w2
=
CreateWindowStationA
(
"foo
\\
bar"
,
0
,
WINSTA_ALL_ACCESS
,
NULL
);
ok
(
!
w2
,
"create station succeeded
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_PATH_NOT_FOUND
||
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"wrong error %u
\n
"
,
GetLastError
()
);
...
...
server/directory.c
View file @
7ad32cf5
...
...
@@ -144,6 +144,8 @@ static struct object *directory_lookup_name( struct object *obj, struct unicode_
assert
(
obj
->
ops
==
&
directory_ops
);
if
(
!
name
)
return
NULL
;
/* open the directory itself */
if
(
!
(
p
=
memchrW
(
name
->
str
,
'\\'
,
name
->
len
/
sizeof
(
WCHAR
)
)))
/* Last element in the path name */
tmp
.
len
=
name
->
len
;
...
...
@@ -165,14 +167,12 @@ static struct object *directory_lookup_name( struct object *obj, struct unicode_
return
found
;
}
if
(
name
->
str
)
if
(
name
->
str
)
/* not the last element */
{
if
(
tmp
.
len
==
0
)
/* Double backslash */
set_error
(
STATUS_OBJECT_NAME_INVALID
);
else
if
(
p
)
/* Path still has backslashes */
set_error
(
STATUS_OBJECT_PATH_NOT_FOUND
);
else
clear_error
();
}
return
NULL
;
}
...
...
server/mailslot.c
View file @
7ad32cf5
...
...
@@ -370,6 +370,8 @@ static struct object *mailslot_device_lookup_name( struct object *obj, struct un
assert
(
obj
->
ops
==
&
mailslot_device_ops
);
if
(
!
name
)
return
NULL
;
/* open the device itself */
if
((
found
=
find_object
(
device
->
mailslots
,
name
,
attr
|
OBJ_CASE_INSENSITIVE
)))
name
->
len
=
0
;
...
...
server/named_pipe.c
View file @
7ad32cf5
...
...
@@ -473,6 +473,8 @@ static struct object *named_pipe_device_lookup_name( struct object *obj, struct
assert
(
obj
->
ops
==
&
named_pipe_device_ops
);
assert
(
device
->
pipes
);
if
(
!
name
)
return
NULL
;
/* open the device itself */
if
((
found
=
find_object
(
device
->
pipes
,
name
,
attr
|
OBJ_CASE_INSENSITIVE
)))
name
->
len
=
0
;
...
...
server/object.c
View file @
7ad32cf5
...
...
@@ -217,7 +217,7 @@ struct object *lookup_named_object( struct object *root, const struct unicode_st
unsigned
int
attr
,
struct
unicode_str
*
name_left
)
{
struct
object
*
obj
,
*
parent
;
struct
unicode_str
name_tmp
=
*
name
;
struct
unicode_str
name_tmp
=
*
name
,
*
ptr
=
&
name_tmp
;
if
(
root
)
{
...
...
@@ -242,9 +242,11 @@ struct object *lookup_named_object( struct object *root, const struct unicode_st
parent
=
get_root_directory
();
}
if
(
!
name_tmp
.
len
)
goto
done
;
if
(
!
name_tmp
.
len
)
ptr
=
NULL
;
/* special case for empty path */
while
((
obj
=
parent
->
ops
->
lookup_name
(
parent
,
&
name_tmp
,
attr
)))
clear_error
();
while
((
obj
=
parent
->
ops
->
lookup_name
(
parent
,
ptr
,
attr
)))
{
/* move to the next element */
release_object
(
parent
);
...
...
@@ -256,7 +258,6 @@ struct object *lookup_named_object( struct object *root, const struct unicode_st
return
NULL
;
}
done:
if
(
name_left
)
*
name_left
=
name_tmp
;
return
parent
;
}
...
...
@@ -617,6 +618,7 @@ int default_set_sd( struct object *obj, const struct security_descriptor *sd,
struct
object
*
no_lookup_name
(
struct
object
*
obj
,
struct
unicode_str
*
name
,
unsigned
int
attr
)
{
if
(
!
name
)
set_error
(
STATUS_OBJECT_TYPE_MISMATCH
);
return
NULL
;
}
...
...
server/symlink.c
View file @
7ad32cf5
...
...
@@ -99,11 +99,13 @@ static struct object *symlink_lookup_name( struct object *obj, struct unicode_st
struct
object
*
target
;
assert
(
obj
->
ops
==
&
symlink_ops
);
if
(
!
name
)
return
NULL
;
if
(
!
name
->
len
&&
(
attr
&
OBJ_OPENLINK
))
return
NULL
;
target_str
.
str
=
symlink
->
target
;
target_str
.
len
=
symlink
->
len
;
if
((
target
=
find_object_dir
(
NULL
,
&
target_str
,
attr
,
&
name_left
)))
if
((
target
=
lookup_named_object
(
NULL
,
&
target_str
,
attr
,
&
name_left
)))
{
if
(
name_left
.
len
)
{
...
...
server/winstation.c
View file @
7ad32cf5
...
...
@@ -110,12 +110,6 @@ static struct winstation *create_winstation( struct directory *root, const struc
{
struct
winstation
*
winstation
;
if
(
memchrW
(
name
->
str
,
'\\'
,
name
->
len
/
sizeof
(
WCHAR
)
))
/* no backslash allowed in name */
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
NULL
;
}
if
((
winstation
=
create_named_object_dir
(
root
,
name
,
attr
,
&
winstation_ops
)))
{
if
(
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
...
...
@@ -165,6 +159,8 @@ static struct object *winstation_lookup_name( struct object *obj, struct unicode
assert
(
obj
->
ops
==
&
winstation_ops
);
if
(
!
name
)
return
NULL
;
/* open the winstation itself */
if
(
memchrW
(
name
->
str
,
'\\'
,
name
->
len
/
sizeof
(
WCHAR
)
))
/* no backslash allowed in name */
{
set_error
(
STATUS_OBJECT_PATH_SYNTAX_BAD
);
...
...
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