[2/5] msi: Pass the full custom action command to CreateProcess.

Hans Leidekker hans at codeweavers.com
Fri Jun 10 03:13:07 CDT 2011


Fixes http://bugs.winehq.org/show_bug.cgi?id=27425
---
 dlls/msi/custom.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c
index 211bec0..f7a65cd 100644
--- a/dlls/msi/custom.c
+++ b/dlls/msi/custom.c
@@ -772,10 +772,22 @@ static HANDLE execute_command( const WCHAR *exe, WCHAR *arg, const WCHAR *dir )
 {
     STARTUPINFOW si;
     PROCESS_INFORMATION info;
+    int len;
+    WCHAR *cmd;
     BOOL ret;
 
+    len = strlenW( exe );
+    if (arg) len += strlenW( arg ) + 1;
+    if (!(cmd = msi_alloc( (len + 1) * sizeof(WCHAR) ))) return INVALID_HANDLE_VALUE;
+    strcpyW( cmd, exe );
+    if (arg)
+    {
+        strcatW( cmd, szSpace );
+        strcatW( cmd, arg );
+    }
     memset( &si, 0, sizeof(STARTUPINFOW) );
-    ret = CreateProcessW( exe, arg, NULL, NULL, FALSE, 0, NULL, dir, &si, &info );
+    ret = CreateProcessW( NULL, cmd, NULL, NULL, FALSE, 0, NULL, dir, &si, &info );
+    msi_free( cmd );
     if (!ret)
     {
         WARN("unable to execute command %u\n", GetLastError());
-- 
1.7.4.1







More information about the wine-patches mailing list