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
060b28b9
Commit
060b28b9
authored
Apr 14, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Allow a second backslash after the drive letter.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5bf1900d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
14 deletions
+19
-14
path.c
dlls/ntdll/tests/path.c
+15
-12
file.c
dlls/ntdll/unix/file.c
+4
-2
No files found.
dlls/ntdll/tests/path.c
View file @
060b28b9
...
...
@@ -622,15 +622,16 @@ static void test_RtlDosPathNameToNtPathName_U(void)
static
void
test_nt_names
(
void
)
{
static
const
struct
{
const
WCHAR
*
root
,
*
name
;
NTSTATUS
expect
;
BOOL
todo
;
}
tests
[]
=
static
const
struct
{
const
WCHAR
*
root
,
*
name
;
NTSTATUS
expect
,
broken
;
BOOL
todo
;
}
tests
[]
=
{
{
NULL
,
L"
\\
??
\\
C:
\\
windows
\\
system32
\\
kernel32.dll"
,
STATUS_SUCCESS
},
{
NULL
,
L"
\\
??
\\
C:
\\\\
windows
\\
system32
\\
kernel32.dll"
,
STATUS_OBJECT_NAME_INVALID
},
{
NULL
,
L"
\\
??
\\
C:
\\\\
windows
\\
system32
\\
"
,
STATUS_OBJECT_NAME_INVALID
},
{
NULL
,
L"
\\
??
\\
C:
\\\\
windows
\\
system32
\\
kernel32.dll"
,
STATUS_SUCCESS
,
STATUS_OBJECT_NAME_INVALID
},
{
NULL
,
L"
\\
??
\\
C:
\\
windows
\\
system32
\\
"
,
STATUS_FILE_IS_A_DIRECTORY
},
{
NULL
,
L"
\\
??
\\
C:
\\\\\\
windows
\\
system32
\\
kernel32.dll"
,
STATUS_OBJECT_NAME_INVALID
},
{
NULL
,
L"
\\
??
\\
C:
\\
windows
\\\\
system32
\\
kernel32.dll"
,
STATUS_OBJECT_NAME_INVALID
},
{
NULL
,
L"
\\
??
\\
C:
\\
windows
\\
system32
\\
.
\\
kernel32.dll"
,
STATUS_OBJECT_NAME_INVALID
},
{
NULL
,
L"
\\
??
\\
C:
\\
windows
\\
system32
\\
.
\\
kernel32.dll"
,
STATUS_OBJECT_NAME_INVALID
,
STATUS_OBJECT_PATH_NOT_FOUND
},
{
NULL
,
L"
\\
??
\\
C:
\\
windows
\\
system32
\\
..
\\
system32
\\
kernel32.dll"
,
STATUS_OBJECT_NAME_INVALID
},
{
NULL
,
L"
\\
??
\\
C:
\\
.
\\
windows
\\
system32
\\
kernel32.dll"
,
STATUS_OBJECT_NAME_INVALID
},
{
NULL
,
L"
\\
??
\\
C:
\\
.
\\
windows
\\
system32
\\
kernel32.dll"
,
STATUS_OBJECT_NAME_INVALID
,
STATUS_OBJECT_PATH_NOT_FOUND
},
{
NULL
,
L"
\\
??
\\
C:
\\
windows
\\
system32
\\
kernel32.dll "
,
STATUS_OBJECT_NAME_NOT_FOUND
},
{
NULL
,
L"
\\
??
\\
C:
\\
windows
\\
system32
\\
kernel32.dll.."
,
STATUS_OBJECT_NAME_NOT_FOUND
},
{
NULL
,
L"
\\
??
\\
C:
\\
windows
\\
system32
\\
kernel32.dll"
,
STATUS_OBJECT_PATH_NOT_FOUND
},
...
...
@@ -642,12 +643,12 @@ static void test_nt_names(void)
{
NULL
,
L"/??
\\
C:
\\
windows
\\
system32
\\
kernel32.dll"
,
STATUS_OBJECT_PATH_SYNTAX_BAD
},
{
NULL
,
L"
\\
??"
L"/C:
\\
windows
\\
system32
\\
kernel32.dll"
,
STATUS_OBJECT_PATH_NOT_FOUND
},
{
NULL
,
L"
\\
??
\\
C:/windows
\\
system32
\\
kernel32.dll"
,
STATUS_OBJECT_PATH_NOT_FOUND
},
{
NULL
,
L"
\\
??
\\
C:
\\
windows
\\
system32
\\
kernel32.dll
\\
"
,
STATUS_OBJECT_NAME_INVALID
,
TRUE
},
{
NULL
,
L"
\\
??
\\
C:
\\
windows
\\
system32
\\
kernel32.dll
\\
foo"
,
STATUS_OBJECT_PATH_NOT_FOUND
,
TRUE
},
{
NULL
,
L"
\\
??
\\
C:
\\
windows
\\
system32
\\
kernel32.dll
\\
"
,
STATUS_OBJECT_NAME_INVALID
,
0
,
TRUE
},
{
NULL
,
L"
\\
??
\\
C:
\\
windows
\\
system32
\\
kernel32.dll
\\
foo"
,
STATUS_OBJECT_PATH_NOT_FOUND
,
0
,
TRUE
},
{
NULL
,
L"
\\
??
\\
C:
\\
windows
\\
sys
\001
"
,
STATUS_OBJECT_NAME_INVALID
},
{
L"
\\
??
\\
"
,
NULL
,
STATUS_OBJECT_NAME_INVALID
},
{
L"
\\
??
\\
C:
\\
"
,
NULL
,
STATUS_SUCCESS
},
{
L"
\\
??
\\
C:
\\\\
"
,
NULL
,
STATUS_OBJECT_NAME_INVALID
},
{
L"
\\
??
\\
C:
\\\\
"
,
NULL
,
STATUS_
SUCCESS
,
STATUS_
OBJECT_NAME_INVALID
},
{
L"/??
\\
C:
\\
"
,
NULL
,
STATUS_OBJECT_PATH_SYNTAX_BAD
},
{
L"
\\
??
\\
C:/"
,
NULL
,
STATUS_OBJECT_NAME_NOT_FOUND
},
{
L"
\\
??"
L"/C:"
,
NULL
,
STATUS_OBJECT_NAME_NOT_FOUND
},
...
...
@@ -659,14 +660,15 @@ static void test_nt_names(void)
{
L"
\\
??
\\
C:
\\
windows
\\
.."
,
NULL
,
STATUS_OBJECT_NAME_INVALID
},
{
L"
\\
??
\\
C:
\\
windows
\\
..
\\
"
,
NULL
,
STATUS_OBJECT_NAME_INVALID
},
{
L"
\\
??
\\
C:
\\
"
,
L"windows
\\
system32
\\
kernel32.dll"
,
STATUS_SUCCESS
},
{
L"
\\
??
\\
C:
\\\\
"
,
L"windows
\\
system32
\\
kernel32.dll"
,
STATUS_SUCCESS
,
STATUS_OBJECT_NAME_INVALID
},
{
L"
\\
??
\\
C:
\\
windows"
,
L"system32
\\
kernel32.dll"
,
STATUS_SUCCESS
},
{
L"
\\
??
\\
C:
\\
windows
\\
"
,
L"system32
\\
kernel32.dll"
,
STATUS_SUCCESS
},
{
L"
\\
??
\\
C:
\\
windows
\\
"
,
L"system32
\\
"
,
STATUS_FILE_IS_A_DIRECTORY
},
{
L"
\\
??
\\
C:
\\
windows
\\
"
,
L"system32
\\
kernel32.dll
\\
"
,
STATUS_OBJECT_NAME_INVALID
,
TRUE
},
{
L"
\\
??
\\
C:
\\
windows
\\
"
,
L"system32
\\
kernel32.dll
\\
foo"
,
STATUS_OBJECT_PATH_NOT_FOUND
,
TRUE
},
{
L"
\\
??
\\
C:
\\
windows
\\
"
,
L"system32
\\
kernel32.dll
\\
"
,
STATUS_OBJECT_NAME_INVALID
,
0
,
TRUE
},
{
L"
\\
??
\\
C:
\\
windows
\\
"
,
L"system32
\\
kernel32.dll
\\
foo"
,
STATUS_OBJECT_PATH_NOT_FOUND
,
0
,
TRUE
},
{
L"
\\
??
\\
C:
\\
windows
\\
"
,
L"
\\
system32
\\
kernel32.dll"
,
STATUS_INVALID_PARAMETER
},
{
L"
\\
??
\\
C:
\\
windows
\\
"
,
L"/system32
\\
kernel32.dll"
,
STATUS_OBJECT_NAME_INVALID
},
{
L"
\\
??
\\
C:
\\
windows
\\
"
,
L".
\\
system32
\\
kernel32.dll"
,
STATUS_OBJECT_NAME_INVALID
},
{
L"
\\
??
\\
C:
\\
windows
\\
"
,
L".
\\
system32
\\
kernel32.dll"
,
STATUS_OBJECT_NAME_INVALID
,
STATUS_OBJECT_PATH_NOT_FOUND
},
{
L"
\\
??
\\
C:
\\
windows
\\
"
,
L"..
\\
windows
\\
system32
\\
kernel32.dll"
,
STATUS_OBJECT_NAME_INVALID
},
{
L"
\\
??
\\
C:
\\
windows
\\
"
,
L"."
,
STATUS_OBJECT_NAME_INVALID
},
{
L"
\\
??
\\
C:
\\
windows
\\
"
,
L".."
,
STATUS_OBJECT_NAME_INVALID
},
...
...
@@ -703,7 +705,8 @@ static void test_nt_names(void)
if
(
attr
.
RootDirectory
)
NtClose
(
attr
.
RootDirectory
);
if
(
handle
)
NtClose
(
handle
);
todo_wine_if
(
tests
[
i
].
todo
)
ok
(
status
==
tests
[
i
].
expect
,
"%u: got %x / %x for %s + %s
\n
"
,
i
,
status
,
tests
[
i
].
expect
,
ok
(
status
==
tests
[
i
].
expect
||
broken
(
tests
[
i
].
broken
&&
status
==
tests
[
i
].
broken
),
"%u: got %x / %x for %s + %s
\n
"
,
i
,
status
,
tests
[
i
].
expect
,
debugstr_w
(
tests
[
i
].
root
),
debugstr_w
(
tests
[
i
].
name
));
}
}
...
...
dlls/ntdll/unix/file.c
View file @
060b28b9
...
...
@@ -3372,8 +3372,10 @@ NTSTATUS nt_to_unix_file_name( const UNICODE_STRING *nameW, char **unix_name_ret
}
}
name
+=
prefix_len
+
1
;
name_len
-=
prefix_len
+
1
;
prefix_len
++
;
/* skip initial backslash */
if
(
name_len
>
prefix_len
&&
name
[
prefix_len
]
==
'\\'
)
prefix_len
++
;
/* allow a second backslash */
name
+=
prefix_len
;
name_len
-=
prefix_len
;
status
=
lookup_unix_name
(
name
,
name_len
,
&
unix_name
,
unix_len
,
pos
,
disposition
,
is_unix
);
if
(
status
==
STATUS_SUCCESS
||
status
==
STATUS_NO_SUCH_FILE
)
...
...
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