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
d09edf80
Commit
d09edf80
authored
Mar 19, 2004
by
Rein Klazes
Committed by
Alexandre Julliard
Mar 19, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In SHELL_ExecuteW, if a new current directory is specified, change to
it before calling CreateProcess so that it will find the correct executable.
parent
cf5775fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
shlexec.c
dlls/shell32/shlexec.c
+12
-0
No files found.
dlls/shell32/shlexec.c
View file @
d09edf80
...
...
@@ -135,8 +135,16 @@ static UINT SHELL_ExecuteW(const WCHAR *lpCmd, void *env, BOOL shWait,
STARTUPINFOW
startup
;
PROCESS_INFORMATION
info
;
UINT
retval
=
31
;
UINT
gcdret
=
0
;
WCHAR
curdir
[
MAX_PATH
];
TRACE
(
"Execute %s from directory %s
\n
"
,
debugstr_w
(
lpCmd
),
debugstr_w
(
psei
->
lpDirectory
));
/* ShellExecute specifies the command from psei->lpDirectory
* if present. Not from the current dir as CreateProcess does */
if
(
psei
->
lpDirectory
&&
psei
->
lpDirectory
[
0
]
)
if
(
(
gcdret
=
GetCurrentDirectoryW
(
MAX_PATH
,
curdir
)))
if
(
!
SetCurrentDirectoryW
(
psei
->
lpDirectory
))
ERR
(
"cannot set directory %s
\n
"
,
debugstr_w
(
psei
->
lpDirectory
));
ZeroMemory
(
&
startup
,
sizeof
(
STARTUPINFOW
));
startup
.
cb
=
sizeof
(
STARTUPINFOW
);
startup
.
dwFlags
=
STARTF_USESHOWWINDOW
;
...
...
@@ -165,6 +173,10 @@ static UINT SHELL_ExecuteW(const WCHAR *lpCmd, void *env, BOOL shWait,
TRACE
(
"returning %u
\n
"
,
retval
);
psei_out
->
hInstApp
=
(
HINSTANCE
)
retval
;
if
(
gcdret
)
if
(
!
SetCurrentDirectoryW
(
curdir
))
ERR
(
"cannot return to directory %s
\n
"
,
debugstr_w
(
curdir
));
return
retval
;
}
...
...
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