https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0f16d44b660266130f5c08...
commit 0f16d44b660266130f5c0807c01d01cfaa6e685d Author: Joachim Henze Joachim.Henze@reactos.org AuthorDate: Tue Aug 6 20:24:55 2019 +0200 Commit: Joachim Henze Joachim.Henze@reactos.org CommitDate: Tue Aug 6 20:24:55 2019 +0200
[SHELL32] Improve ShellExecute
This fixes regression CORE-6412 and also fixes CORE-12927 by bringing us a bit closer to Wine implementation.
Thanks to patches author Doug Lyons. The removed code looks like historic workaround code.
Automated tests do improve as well VBox https://reactos.org/testman/compare.php?ids=68662,68696 KVM https://reactos.org/testman/compare.php?ids=68663,68697
I intend to merge this back into 0.4.12RC. --- dll/win32/shell32/shlexec.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-)
diff --git a/dll/win32/shell32/shlexec.cpp b/dll/win32/shell32/shlexec.cpp index b745d40de14..5a741467cb0 100644 --- a/dll/win32/shell32/shlexec.cpp +++ b/dll/win32/shell32/shlexec.cpp @@ -1993,34 +1993,6 @@ static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) } else { - /* If the executable name is not quoted, we have to use this search loop here, - that in CreateProcess() is not sufficient because it does not handle shell links. */ - WCHAR buffer[MAX_PATH], xlpFile[MAX_PATH]; - LPWSTR space, s; - - LPWSTR beg = wszApplicationName/*sei_tmp.lpFile*/; - for(s = beg; (space = const_cast<LPWSTR>(strchrW(s, L' '))); s = space + 1) - { - int idx = space - sei_tmp.lpFile; - memcpy(buffer, sei_tmp.lpFile, idx * sizeof(WCHAR)); - buffer[idx] = '\0'; - - /*FIXME This finds directory paths if the targeted file name contains spaces. */ - if (SearchPathW(*sei_tmp.lpDirectory ? sei_tmp.lpDirectory : NULL, buffer, wszExe, sizeof(xlpFile) / sizeof(xlpFile[0]), xlpFile, NULL)) - { - /* separate out command from parameter string */ - LPCWSTR p = space + 1; - - while(isspaceW(*p)) - ++p; - - strcpyW(wszParameters, p); - *space = L'\0'; - - break; - } - } - lpFile = sei_tmp.lpFile; } }