Author: tkreuzer
Date: Sun Apr 15 19:11:29 2012
New Revision: 56353
URL:
http://svn.reactos.org/svn/reactos?rev=56353&view=rev
Log:
[EXPLORER]
Expand the environment variables when running startup programs
Patch by Edijs Kolesnikovics, slightly modified by me
See issue #6953 for more details.
Modified:
trunk/reactos/base/shell/explorer/services/startup.c
Modified: trunk/reactos/base/shell/explorer/services/startup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/servic…
==============================================================================
--- trunk/reactos/base/shell/explorer/services/startup.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/services/startup.c [iso-8859-1] Sun Apr 15 19:11:29
2012
@@ -243,6 +243,9 @@
STARTUPINFOW si;
PROCESS_INFORMATION info;
DWORD exit_code=0;
+ WCHAR szCmdLineExp[MAX_PATH+1]= L"\0";
+
+ ExpandEnvironmentStrings(cmdline, szCmdLineExp, sizeof(szCmdLineExp));
memset(&si, 0, sizeof(si));
si.cb=sizeof(si);
@@ -253,7 +256,7 @@
}
memset(&info, 0, sizeof(info));
- if (!CreateProcessW(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, dir, &si,
&info))
+ if (!CreateProcessW(NULL, szCmdLineExp, NULL, NULL, FALSE, 0, NULL, dir, &si,
&info))
{
printf("Failed to run command (%ld)\n", GetLastError());
@@ -261,7 +264,7 @@
}
printf("Successfully ran command\n"); //%s - Created process handle
%p\n",
- //wine_dbgstr_w(cmdline), info.hProcess);
+ //wine_dbgstr_w(szCmdLineExp), info.hProcess);
if (wait)
{ /* wait for the process to exit */