shell32: Add parameter formatting rule to the command line if there is no one

Dmitry Timoshkov dmitry at codeweavers.com
Sun Mar 12 23:44:41 CST 2006


Hello,

this patch fixes a regression for .xls and .doc files caused by my previous
patch which has reordered the exec and DDE exec ShellExecute execution modes.
The regression is caused by the fact that Microsoft Office sets .xls and .doc
file associations to the entries like:

@="\"C:\\Program Files\\Microsoft Office\\Office\\EXCEL.EXE\" /e"

i.e. there is no any param formatting rule there.

Changelog:
    shell32: Add parameter formatting rule to the command line if
    there is no one.

--- cvs/hq/wine/dlls/shell32/shlexec.c	2006-02-23 00:22:14.000000000 +0800
+++ wine/dlls/shell32/shlexec.c	2006-03-13 13:19:44.000000000 +0800
@@ -848,7 +848,14 @@ static UINT_PTR execute_from_key(LPWSTR 
         /* Is there a replace() function anywhere? */
         cmdlen /= sizeof(WCHAR);
         cmd[cmdlen] = '\0';
-        SHELL_ArgifyW(param, sizeof(param)/sizeof(WCHAR), cmd, lpFile, psei->lpIDList, szCommandline);
+        if (!SHELL_ArgifyW(param, sizeof(param)/sizeof(WCHAR), cmd, lpFile, psei->lpIDList, szCommandline))
+        {
+            /* looks like there is no %1 param in the cmd, add one */
+            static const WCHAR oneW[] = { ' ','\"','%','1','\"',0 };
+            strcatW(cmd, oneW);
+            SHELL_ArgifyW(param, sizeof(param)/sizeof(WCHAR), cmd, lpFile, psei->lpIDList, szCommandline);
+        }
+        TRACE("executing: %s\n", debugstr_w(param));
         retval = execfunc(param, env, FALSE, psei, psei_out);
     }
     else





More information about the wine-patches mailing list