Damjan Jovanovic : shell32: Simplify SHELL_execute().

Alexandre Julliard julliard at winehq.org
Fri Aug 7 10:42:26 CDT 2020


Module: wine
Branch: stable
Commit: bc88fe8f0f3eed9df32bf1f7a9f4eed2ac6c8428
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=bc88fe8f0f3eed9df32bf1f7a9f4eed2ac6c8428

Author: Damjan Jovanovic <damjan.jov at gmail.com>
Date:   Sun Mar 22 13:46:18 2020 +0200

shell32: Simplify SHELL_execute().

Signed-off-by: Damjan Jovanovic <damjan.jov at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 06f1f53c4c11c972561de91e76cd5ea6dc5c2ced)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/shell32/shlexec.c | 24 ++++--------------------
 1 file changed, 4 insertions(+), 20 deletions(-)

diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c
index 28f2e36f9a..d3ff821135 100644
--- a/dlls/shell32/shlexec.c
+++ b/dlls/shell32/shlexec.c
@@ -1806,26 +1806,10 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
     TRACE("execute:%s,%s,%s\n", debugstr_w(wszApplicationName), debugstr_w(wszParameters), debugstr_w(wszDir));
     lpFile = sei_tmp.lpFile;
     wcmd = wcmdBuffer;
-    len = lstrlenW(wszApplicationName) + 3;
-    if (sei_tmp.lpParameters[0])
-        len += 1 + lstrlenW(wszParameters);
-    if (len > wcmdLen)
-    {
-        wcmd = heap_alloc(len * sizeof(WCHAR));
-        wcmdLen = len;
-    }
-    wcmd[0] = '\"';
-    len = lstrlenW(wszApplicationName);
-    memcpy(wcmd+1, wszApplicationName, len * sizeof(WCHAR));
-    len++;
-    wcmd[len++] = '\"';
-    wcmd[len] = 0;
-    if (sei_tmp.lpParameters[0]) {
-        wcmd[len++] = ' ';
-        strcpyW(wcmd+len, wszParameters);
-    }
-
-    retval = execfunc(wcmd, NULL, FALSE, &sei_tmp, sei);
+    strcpyW(wcmd, wszApplicationName);
+    retval = SHELL_quote_and_execute( wcmd, wszParameters, wszEmpty,
+                                      wszApplicationName, NULL, &sei_tmp,
+                                      sei, execfunc );
     if (retval > 32) {
         heap_free(wszApplicationName);
         if (wszParameters != parametersBuffer)




More information about the wine-cvs mailing list