Author: rharabien
Date: Sun Nov 20 22:22:42 2011
New Revision: 54465
URL:
http://svn.reactos.org/svn/reactos?rev=54465&view=rev
Log:
[SHELL32] - Fix running batch files from patch containing spaces in ShellExecute API
Modified:
trunk/reactos/dll/win32/shell32/shlexec.cpp
Modified: trunk/reactos/dll/win32/shell32/shlexec.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlexec.…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shlexec.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shlexec.cpp [iso-8859-1] Sun Nov 20 22:22:42 2011
@@ -475,7 +475,7 @@
}
else if ((retval = GetLastError()) >= 32)
{
- TRACE("CreateProcess returned error %ld\n", retval);
+ WARN("CreateProcess returned error %ld\n", retval);
retval = ERROR_BAD_FORMAT;
}
@@ -1906,7 +1906,7 @@
lpFile = wfileName;
wcmd = wcmdBuffer;
- len = lstrlenW(wszApplicationName) + 1;
+ len = lstrlenW(wszApplicationName) + 3;
if (sei_tmp.lpParameters[0])
len += 1 + lstrlenW(wszParameters);
if (len > wcmdLen)
@@ -1914,7 +1914,7 @@
wcmd = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
wcmdLen = len;
}
- strcpyW(wcmd, wszApplicationName);
+ swprintf(wcmd, L"\"%s\"", wszApplicationName);
if (sei_tmp.lpParameters[0])
{
strcatW(wcmd, wSpace);