Damjan Jovanovic : shell32: Pass the executable's full path from SHELL_execute() to CreateProcess().
Alexandre Julliard
julliard at winehq.org
Mon Mar 23 15:47:09 CDT 2020
Module: wine
Branch: master
Commit: 9736fe499d0887bf92652ca32ba5195e7b0b0e9c
URL: https://source.winehq.org/git/wine.git/?a=commit;h=9736fe499d0887bf92652ca32ba5195e7b0b0e9c
Author: Damjan Jovanovic <damjan.jov at gmail.com>
Date: Sun Mar 22 13:46:23 2020 +0200
shell32: Pass the executable's full path from SHELL_execute() to CreateProcess().
Several older Microsoft installers, particularly those changing CDs
during installation, break because they launch a child setup.exe, from
a parent process also called setup.exe, which Wine finds in the wrong
directory, as CreateProcess() first searches the parent executable's
own directory, thus re-launching the parent itself instead of the
child. Therefore CreateProcess() must be passed a full path from
SHELL_execute(), so it launches the correct child.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=8439
Signed-off-by: Damjan Jovanovic <damjan.jov at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/shell32/shlexec.c | 8 ++++++++
dlls/shell32/tests/shlexec.c | 8 ++++----
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c
index d3ff821135..ce0b8f6d2b 100644
--- a/dlls/shell32/shlexec.c
+++ b/dlls/shell32/shlexec.c
@@ -1807,6 +1807,14 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
lpFile = sei_tmp.lpFile;
wcmd = wcmdBuffer;
strcpyW(wcmd, wszApplicationName);
+ if (sei_tmp.lpDirectory)
+ {
+ LPCWSTR searchPath[] = {
+ sei_tmp.lpDirectory,
+ NULL
+ };
+ PathFindOnPathW(wcmd, searchPath);
+ }
retval = SHELL_quote_and_execute( wcmd, wszParameters, wszEmpty,
wszApplicationName, NULL, &sei_tmp,
sei, execfunc );
diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c
index 0b3d0cb18e..b49297bb41 100644
--- a/dlls/shell32/tests/shlexec.c
+++ b/dlls/shell32/tests/shlexec.c
@@ -2842,7 +2842,7 @@ static void test_directory(void)
NULL, "test2.exe", params, tmpdir, NULL);
okShell(rc > 32, "returned %lu\n", rc);
okChildInt("argcA", 4);
- todo_wine okChildString("argvA0", path);
+ okChildString("argvA0", path);
okChildString("argvA3", "Exec");
okChildPath("longPath", path);
@@ -2855,7 +2855,7 @@ static void test_directory(void)
NULL, "test2.exe", params, "%TMPDIR%", NULL);
okShell(rc > 32, "returned %lu\n", rc);
okChildInt("argcA", 4);
- todo_wine okChildString("argvA0", path);
+ okChildString("argvA0", path);
okChildString("argvA3", "Exec");
okChildPath("longPath", path);
@@ -2872,9 +2872,9 @@ static void test_directory(void)
NULL, strrchr(argv0, '\\') + 1, params, tmpdir, NULL);
okShell(rc > 32, "returned %lu\n", rc);
okChildInt("argcA", 4);
- todo_wine okChildString("argvA0", path);
+ okChildString("argvA0", path);
okChildString("argvA3", "Exec");
- todo_wine okChildPath("longPath", path);
+ okChildPath("longPath", path);
DeleteFileA(path);
}
More information about the wine-cvs
mailing list