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
3a78ec67
Commit
3a78ec67
authored
Oct 20, 2018
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: GetShortPathName should fail when called with a wildcard.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9bc60688
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
path.c
dlls/kernel32/path.c
+10
-1
path.c
dlls/kernel32/tests/path.c
+0
-2
No files found.
dlls/kernel32/path.c
View file @
3a78ec67
...
@@ -45,6 +45,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(file);
...
@@ -45,6 +45,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(file);
static
int
path_safe_mode
=
-
1
;
/* path mode set by SetSearchPathMode */
static
int
path_safe_mode
=
-
1
;
/* path mode set by SetSearchPathMode */
static
const
WCHAR
wildcardsW
[]
=
{
'*'
,
'?'
,
0
};
/* check if a file name is for an executable file (.exe or .com) */
/* check if a file name is for an executable file (.exe or .com) */
static
inline
BOOL
is_executable
(
const
WCHAR
*
name
)
static
inline
BOOL
is_executable
(
const
WCHAR
*
name
)
{
{
...
@@ -445,7 +447,7 @@ DWORD WINAPI GetShortPathNameW( LPCWSTR longpath, LPWSTR shortpath, DWORD shortl
...
@@ -445,7 +447,7 @@ DWORD WINAPI GetShortPathNameW( LPCWSTR longpath, LPWSTR shortpath, DWORD shortl
WIN32_FIND_DATAW
wfd
;
WIN32_FIND_DATAW
wfd
;
HANDLE
goit
;
HANDLE
goit
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
longpath
)
);
TRACE
(
"%s
,%p,%u
\n
"
,
debugstr_w
(
longpath
),
shortpath
,
shortlen
);
if
(
!
longpath
)
if
(
!
longpath
)
{
{
...
@@ -474,6 +476,13 @@ DWORD WINAPI GetShortPathNameW( LPCWSTR longpath, LPWSTR shortpath, DWORD shortl
...
@@ -474,6 +476,13 @@ DWORD WINAPI GetShortPathNameW( LPCWSTR longpath, LPWSTR shortpath, DWORD shortl
sp
=
lp
=
4
;
sp
=
lp
=
4
;
}
}
if
(
strpbrkW
(
longpath
+
lp
,
wildcardsW
))
{
HeapFree
(
GetProcessHeap
(),
0
,
tmpshortpath
);
SetLastError
(
ERROR_INVALID_NAME
);
return
0
;
}
/* check for drive letter */
/* check for drive letter */
if
(
longpath
[
lp
]
!=
'/'
&&
longpath
[
lp
+
1
]
==
':'
)
if
(
longpath
[
lp
]
!=
'/'
&&
longpath
[
lp
+
1
]
==
':'
)
{
{
...
...
dlls/kernel32/tests/path.c
View file @
3a78ec67
...
@@ -1477,9 +1477,7 @@ static void test_GetShortPathNameW(void)
...
@@ -1477,9 +1477,7 @@ static void test_GetShortPathNameW(void)
lstrcpyW
(
ptr
,
wildW
);
lstrcpyW
(
ptr
,
wildW
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
length
=
GetShortPathNameW
(
path
,
short_path
,
ARRAY_SIZE
(
short_path
)
);
length
=
GetShortPathNameW
(
path
,
short_path
,
ARRAY_SIZE
(
short_path
)
);
todo_wine
ok
(
!
length
,
"GetShortPathNameW should fail
\n
"
);
ok
(
!
length
,
"GetShortPathNameW should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_NAME
,
"wrong error %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INVALID_NAME
,
"wrong error %d
\n
"
,
GetLastError
());
lstrcpyW
(
ptr
,
a_bcdeW
);
lstrcpyW
(
ptr
,
a_bcdeW
);
...
...
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