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
6a1d2f80
Commit
6a1d2f80
authored
Jul 10, 2012
by
Erich Hoover
Committed by
Alexandre Julliard
Jul 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Fix FindExecutable search path when a default directory is supplied.
parent
d685894a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
shlexec.c
dlls/shell32/shlexec.c
+7
-1
shlexec.c
dlls/shell32/tests/shlexec.c
+16
-0
No files found.
dlls/shell32/shlexec.c
View file @
6a1d2f80
...
@@ -603,7 +603,13 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOpera
...
@@ -603,7 +603,13 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOpera
{
{
TRACE
(
"SearchPathW returned non-zero
\n
"
);
TRACE
(
"SearchPathW returned non-zero
\n
"
);
lpFile
=
xlpFile
;
lpFile
=
xlpFile
;
/* Hey, isn't this value ignored? Why make this call? Shouldn't we return here? --dank*/
/* The file was found in the application-supplied default directory (or the system search path) */
}
else
if
(
lpPath
&&
SearchPathW
(
NULL
,
lpFile
,
wszExe
,
sizeof
(
xlpFile
)
/
sizeof
(
WCHAR
),
xlpFile
,
NULL
))
{
TRACE
(
"SearchPathW returned non-zero
\n
"
);
lpFile
=
xlpFile
;
/* The file was found in one of the directories in the system-wide search path */
}
}
attribs
=
GetFileAttributesW
(
lpFile
);
attribs
=
GetFileAttributesW
(
lpFile
);
...
...
dlls/shell32/tests/shlexec.c
View file @
6a1d2f80
...
@@ -1307,6 +1307,7 @@ static void test_filename(void)
...
@@ -1307,6 +1307,7 @@ static void test_filename(void)
static
void
test_find_executable
(
void
)
static
void
test_find_executable
(
void
)
{
{
char
notepad_path
[
MAX_PATH
];
char
filename
[
MAX_PATH
];
char
filename
[
MAX_PATH
];
char
command
[
MAX_PATH
];
char
command
[
MAX_PATH
];
const
filename_tests_t
*
test
;
const
filename_tests_t
*
test
;
...
@@ -1329,6 +1330,21 @@ static void test_find_executable(void)
...
@@ -1329,6 +1330,21 @@ static void test_find_executable(void)
ok
(
strcmp
(
command
,
"your word"
)
!=
0
,
"FindExecutable(NULL) returned command=[%s]
\n
"
,
command
);
ok
(
strcmp
(
command
,
"your word"
)
!=
0
,
"FindExecutable(NULL) returned command=[%s]
\n
"
,
command
);
}
}
GetSystemDirectoryA
(
notepad_path
,
MAX_PATH
);
strcat
(
notepad_path
,
"
\\
notepad.exe"
);
/* Search for something that should be in the system-wide search path (no default directory) */
strcpy
(
command
,
"your word"
);
rc
=
(
INT_PTR
)
FindExecutableA
(
"notepad.exe"
,
NULL
,
command
);
ok
(
rc
>
32
,
"FindExecutable(%s) returned %ld
\n
"
,
"notepad.exe"
,
rc
);
ok
(
strcasecmp
(
command
,
notepad_path
)
==
0
,
"FindExecutable(%s) returned command=[%s]
\n
"
,
"notepad.exe"
,
command
);
/* Search for something that should be in the system-wide search path (with default directory) */
strcpy
(
command
,
"your word"
);
rc
=
(
INT_PTR
)
FindExecutableA
(
"notepad.exe"
,
tmpdir
,
command
);
ok
(
rc
>
32
,
"FindExecutable(%s) returned %ld
\n
"
,
"notepad.exe"
,
rc
);
ok
(
strcasecmp
(
command
,
notepad_path
)
==
0
,
"FindExecutable(%s) returned command=[%s]
\n
"
,
"notepad.exe"
,
command
);
strcpy
(
command
,
"your word"
);
strcpy
(
command
,
"your word"
);
rc
=
(
INT_PTR
)
FindExecutableA
(
tmpdir
,
NULL
,
command
);
rc
=
(
INT_PTR
)
FindExecutableA
(
tmpdir
,
NULL
,
command
);
ok
(
rc
==
SE_ERR_NOASSOC
/* >= win2000 */
||
rc
>
32
/* win98, nt4 */
,
"FindExecutable(NULL) returned %ld
\n
"
,
rc
);
ok
(
rc
==
SE_ERR_NOASSOC
/* >= win2000 */
||
rc
>
32
/* win98, nt4 */
,
"FindExecutable(NULL) returned %ld
\n
"
,
rc
);
...
...
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