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
d2a3104f
Commit
d2a3104f
authored
Jun 25, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Support CONIN$ and CONOUT$ in RtlIsDosDeviceName_U.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
18f83c12
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
8 deletions
+44
-8
path.c
dlls/ntdll/path.c
+8
-0
path.c
dlls/ntdll/tests/path.c
+36
-8
No files found.
dlls/ntdll/path.c
View file @
d2a3104f
...
@@ -80,6 +80,8 @@ ULONG WINAPI RtlIsDosDeviceName_U( PCWSTR dos_name )
...
@@ -80,6 +80,8 @@ ULONG WINAPI RtlIsDosDeviceName_U( PCWSTR dos_name )
static
const
WCHAR
lptW
[]
=
{
'L'
,
'P'
,
'T'
};
static
const
WCHAR
lptW
[]
=
{
'L'
,
'P'
,
'T'
};
static
const
WCHAR
nulW
[]
=
{
'N'
,
'U'
,
'L'
};
static
const
WCHAR
nulW
[]
=
{
'N'
,
'U'
,
'L'
};
static
const
WCHAR
prnW
[]
=
{
'P'
,
'R'
,
'N'
};
static
const
WCHAR
prnW
[]
=
{
'P'
,
'R'
,
'N'
};
static
const
WCHAR
coninW
[]
=
{
'C'
,
'O'
,
'N'
,
'I'
,
'N'
,
'$'
};
static
const
WCHAR
conoutW
[]
=
{
'C'
,
'O'
,
'N'
,
'O'
,
'U'
,
'T'
,
'$'
};
const
WCHAR
*
start
,
*
end
,
*
p
;
const
WCHAR
*
start
,
*
end
,
*
p
;
...
@@ -124,6 +126,12 @@ ULONG WINAPI RtlIsDosDeviceName_U( PCWSTR dos_name )
...
@@ -124,6 +126,12 @@ ULONG WINAPI RtlIsDosDeviceName_U( PCWSTR dos_name )
if
(
wcsnicmp
(
start
,
comW
,
3
)
&&
wcsnicmp
(
start
,
lptW
,
3
))
break
;
if
(
wcsnicmp
(
start
,
comW
,
3
)
&&
wcsnicmp
(
start
,
lptW
,
3
))
break
;
if
(
*
end
<=
'0'
||
*
end
>
'9'
)
break
;
if
(
*
end
<=
'0'
||
*
end
>
'9'
)
break
;
return
MAKELONG
(
4
*
sizeof
(
WCHAR
),
(
start
-
dos_name
)
*
sizeof
(
WCHAR
)
);
return
MAKELONG
(
4
*
sizeof
(
WCHAR
),
(
start
-
dos_name
)
*
sizeof
(
WCHAR
)
);
case
6
:
if
(
wcsnicmp
(
start
,
coninW
,
ARRAY_SIZE
(
coninW
)
))
break
;
return
MAKELONG
(
sizeof
(
coninW
),
(
start
-
dos_name
)
*
sizeof
(
WCHAR
)
);
case
7
:
if
(
wcsnicmp
(
start
,
conoutW
,
ARRAY_SIZE
(
conoutW
)
))
break
;
return
MAKELONG
(
sizeof
(
conoutW
),
(
start
-
dos_name
)
*
sizeof
(
WCHAR
)
);
default:
/* can't match anything */
default:
/* can't match anything */
break
;
break
;
}
}
...
...
dlls/ntdll/tests/path.c
View file @
d2a3104f
...
@@ -77,6 +77,11 @@ static void test_RtlDetermineDosPathNameType_U(void)
...
@@ -77,6 +77,11 @@ static void test_RtlDetermineDosPathNameType_U(void)
{
"//?foo"
,
1
},
{
"//?foo"
,
1
},
{
"
\\\\
?"
,
7
},
{
"
\\\\
?"
,
7
},
{
"//?"
,
7
},
{
"//?"
,
7
},
{
"CONIN$"
,
5
},
{
"CONOUT$"
,
5
},
{
"CONERR$"
,
5
},
{
"
\\\\
.
\\
CONIN$"
,
6
},
{
"
\\\\
.
\\
CONOUT$"
,
6
},
{
NULL
,
0
}
{
NULL
,
0
}
};
};
...
@@ -143,6 +148,15 @@ static void test_RtlIsDosDeviceName_U(void)
...
@@ -143,6 +148,15 @@ static void test_RtlIsDosDeviceName_U(void)
{
"CoM4:"
,
0
,
8
},
{
"CoM4:"
,
0
,
8
},
{
"lpt9:"
,
0
,
8
},
{
"lpt9:"
,
0
,
8
},
{
"c:
\\
lpt0.txt"
,
0
,
0
},
{
"c:
\\
lpt0.txt"
,
0
,
0
},
{
"CONIN$"
,
0
,
12
,
TRUE
},
/* fails on winxp */
{
"CONOUT$"
,
0
,
14
,
TRUE
},
/* fails on winxp */
{
"CONERR$"
,
0
,
0
},
{
"CON"
,
0
,
6
},
{
"PIPE"
,
0
,
0
},
{
"
\\
??
\\
CONIN$"
,
8
,
12
,
TRUE
},
/* fails on winxp */
{
"
\\
??
\\
CONOUT$"
,
8
,
14
,
TRUE
},
/* fails on winxp */
{
"
\\
??
\\
CONERR$"
,
0
,
0
},
{
"
\\
??
\\
CON"
,
8
,
6
},
{
"c:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
{
"c:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
...
@@ -329,6 +343,11 @@ static void test_RtlGetFullPathName_U(void)
...
@@ -329,6 +343,11 @@ static void test_RtlGetFullPathName_U(void)
{
"//?/foo/."
,
"
\\\\
?
\\
foo"
,
"foo"
},
{
"//?/foo/."
,
"
\\\\
?
\\
foo"
,
"foo"
},
{
"//?/foo/.."
,
"
\\\\
?
\\
"
,
NULL
},
{
"//?/foo/.."
,
"
\\\\
?
\\
"
,
NULL
},
{
"CONIN$"
,
"
\\\\
.
\\
CONIN$"
,
NULL
,
"C:
\\
windows
\\
CONIN$"
,
"CONIN$"
},
{
"CONOUT$"
,
"
\\\\
.
\\
CONOUT$"
,
NULL
,
"C:
\\
windows
\\
CONOUT$"
,
"CONOUT$"
},
/* RtlGetFullPathName_U() can't understand the global namespace prefix */
/* RtlGetFullPathName_U() can't understand the global namespace prefix */
{
"
\\
??
\\
foo"
,
"C:
\\
??
\\
foo"
,
"foo"
},
{
"
\\
??
\\
foo"
,
"C:
\\
??
\\
foo"
,
"foo"
},
{
0
}
{
0
}
...
@@ -409,6 +428,7 @@ static void test_RtlDosPathNameToNtPathName_U(void)
...
@@ -409,6 +428,7 @@ static void test_RtlDosPathNameToNtPathName_U(void)
const
WCHAR
*
dos
;
const
WCHAR
*
dos
;
const
WCHAR
*
nt
;
const
WCHAR
*
nt
;
int
file_offset
;
/* offset to file part */
int
file_offset
;
/* offset to file part */
const
WCHAR
*
alt_nt
;
}
}
tests
[]
=
tests
[]
=
{
{
...
@@ -507,6 +527,11 @@ static void test_RtlDosPathNameToNtPathName_U(void)
...
@@ -507,6 +527,11 @@ static void test_RtlDosPathNameToNtPathName_U(void)
{
L"
\\
??
\\
foo
\\
bar"
,
L"
\\
??
\\
foo
\\
bar"
,
8
},
{
L"
\\
??
\\
foo
\\
bar"
,
L"
\\
??
\\
foo
\\
bar"
,
8
},
{
L"
\\
??
\\
foo
\\
."
,
L"
\\
??
\\
foo
\\
."
,
8
},
{
L"
\\
??
\\
foo
\\
."
,
L"
\\
??
\\
foo
\\
."
,
8
},
{
L"
\\
??
\\
foo
\\
.."
,
L"
\\
??
\\
foo
\\
.."
,
8
},
{
L"
\\
??
\\
foo
\\
.."
,
L"
\\
??
\\
foo
\\
.."
,
8
},
{
L"CONIN$"
,
L"
\\
??
\\
CONIN$"
,
-
1
,
L"
\\
??
\\
C:
\\
windows
\\
CONIN$"
/* winxp */
},
{
L"CONOUT$"
,
L"
\\
??
\\
CONOUT$"
,
-
1
,
L"
\\
??
\\
C:
\\
windows
\\
CONOUT$"
/* winxp */
},
{
L"cOnOuT$"
,
L"
\\
??
\\
cOnOuT$"
,
-
1
,
L"
\\
??
\\
C:
\\
windows
\\
cOnOuT$"
/* winxp */
},
{
L"CONERR$"
,
L"
\\
??
\\
C:
\\
windows
\\
CONERR$"
,
15
},
};
};
GetCurrentDirectoryA
(
sizeof
(
curdir
),
curdir
);
GetCurrentDirectoryA
(
sizeof
(
curdir
),
curdir
);
...
@@ -555,16 +580,19 @@ static void test_RtlDosPathNameToNtPathName_U(void)
...
@@ -555,16 +580,19 @@ static void test_RtlDosPathNameToNtPathName_U(void)
continue
;
continue
;
}
}
ok
(
!
wcscmp
(
nameW
.
Buffer
,
tests
[
i
].
nt
),
"%s: Expected %s, got %s.
\n
"
,
ok
(
!
wcscmp
(
nameW
.
Buffer
,
tests
[
i
].
nt
)
||
broken
(
!
wcscmp
(
nameW
.
Buffer
,
tests
[
i
].
alt_nt
))
,
"%s: Expected %s, got %s.
\n
"
,
debugstr_w
(
tests
[
i
].
dos
),
debugstr_w
(
tests
[
i
].
nt
),
debugstr_w
(
nameW
.
Buffer
));
debugstr_w
(
tests
[
i
].
dos
),
debugstr_w
(
tests
[
i
].
nt
),
debugstr_w
(
nameW
.
Buffer
));
if
(
tests
[
i
].
file_offset
>
0
)
if
(
!
wcscmp
(
nameW
.
Buffer
,
tests
[
i
].
nt
))
ok
(
file_part
==
nameW
.
Buffer
+
tests
[
i
].
file_offset
,
{
"%s: Expected file part %s, got %s.
\n
"
,
debugstr_w
(
tests
[
i
].
dos
),
if
(
tests
[
i
].
file_offset
>
0
)
debugstr_w
(
nameW
.
Buffer
+
tests
[
i
].
file_offset
),
debugstr_w
(
file_part
));
ok
(
file_part
==
nameW
.
Buffer
+
tests
[
i
].
file_offset
,
else
"%s: Expected file part %s, got %s.
\n
"
,
debugstr_w
(
tests
[
i
].
dos
),
ok
(
file_part
==
NULL
,
"%s: Expected NULL file part, got %s.
\n
"
,
debugstr_w
(
nameW
.
Buffer
+
tests
[
i
].
file_offset
),
debugstr_w
(
file_part
));
debugstr_w
(
tests
[
i
].
dos
),
debugstr_w
(
file_part
));
else
ok
(
file_part
==
NULL
,
"%s: Expected NULL file part, got %s.
\n
"
,
debugstr_w
(
tests
[
i
].
dos
),
debugstr_w
(
file_part
));
}
RtlFreeUnicodeString
(
&
nameW
);
RtlFreeUnicodeString
(
&
nameW
);
}
}
...
...
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