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
1bc7db2e
Commit
1bc7db2e
authored
Mar 18, 2024
by
Yuxuan Shui
Committed by
Alexandre Julliard
Mar 21, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Fix FindExecutable search path.
It should look in the currect working directory, instead of the directory where the current executable is in.
parent
a1d0e21b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
shlexec.c
dlls/shell32/shlexec.c
+14
-6
shlexec.c
dlls/shell32/tests/shlexec.c
+1
-1
No files found.
dlls/shell32/shlexec.c
View file @
1bc7db2e
...
...
@@ -48,6 +48,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(exec);
typedef
UINT_PTR
(
*
SHELL_ExecuteW32
)(
const
WCHAR
*
lpCmd
,
WCHAR
*
env
,
BOOL
shWait
,
const
SHELLEXECUTEINFOW
*
sei
,
LPSHELLEXECUTEINFOW
sei_out
);
extern
BOOL
WINAPI
PathResolveAW
(
void
*
path
,
const
void
**
paths
,
DWORD
flags
);
static
inline
BOOL
isSpace
(
WCHAR
c
)
{
...
...
@@ -599,6 +600,8 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb,
WCHAR
*
tok
;
/* token pointer */
WCHAR
xlpFile
[
256
];
/* result of SearchPath */
DWORD
attribs
;
/* file attributes */
WCHAR
curdir
[
MAX_PATH
];
const
WCHAR
*
search_paths
[
3
]
=
{
0
};
TRACE
(
"%s
\n
"
,
debugstr_w
(
lpFile
));
...
...
@@ -623,18 +626,23 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb,
return
33
;
}
if
(
SearchPathW
(
lpPath
,
lpFile
,
L".exe"
,
ARRAY_SIZE
(
xlpFile
),
xlpFile
,
NULL
)
)
if
(
lpPath
&&
*
lpPath
)
{
TRACE
(
"SearchPathW returned non-zero
\n
"
);
lpFile
=
xlpFile
;
/* The file was found in the application-supplied default directory (or the system search path) */
search_paths
[
0
]
=
lpPath
;
search_paths
[
1
]
=
curdir
;
}
else
if
(
lpPath
&&
SearchPathW
(
NULL
,
lpFile
,
L".exe"
,
ARRAY_SIZE
(
xlpFile
),
xlpFile
,
NULL
))
else
search_paths
[
0
]
=
curdir
;
GetCurrentDirectoryW
(
MAX_PATH
,
curdir
);
lstrcpyW
(
xlpFile
,
lpFile
);
if
(
PathResolveAW
(
xlpFile
,
(
const
void
**
)
search_paths
,
PRF_TRYPROGRAMEXTENSIONS
|
PRF_VERIFYEXISTS
))
{
TRACE
(
"SearchPathW returned non-zero
\n
"
);
lpFile
=
xlpFile
;
/* The file was found in one of the directories in the system-wide search path */
/* The file was found in
lpPath or
one of the directories in the system-wide search path */
}
else
xlpFile
[
0
]
=
'\0'
;
attribs
=
GetFileAttributesW
(
lpFile
);
if
(
attribs
!=
INVALID_FILE_ATTRIBUTES
&&
(
attribs
&
FILE_ATTRIBUTE_DIRECTORY
))
...
...
dlls/shell32/tests/shlexec.c
View file @
1bc7db2e
...
...
@@ -2063,7 +2063,7 @@ static void test_find_executable(void)
GetCurrentDirectoryA
(
MAX_PATH
,
curdir
);
SetCurrentDirectoryA
(
tmpdir
);
rc
=
(
INT_PTR
)
FindExecutableA
(
basename
,
NULL
,
command
);
todo_wine
ok
(
rc
==
SE_ERR_FNF
,
"FindExecutable(%s) returned %Id
\n
"
,
basename
,
rc
);
ok
(
rc
==
SE_ERR_FNF
,
"FindExecutable(%s) returned %Id
\n
"
,
basename
,
rc
);
SetCurrentDirectoryA
(
curdir
);
sprintf
(
filename
,
"%s
\\
test file.sfe"
,
tmpdir
);
...
...
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