shell32: Don't expand environment variables in ShellExecute()'s parameters argument.
This commit is contained in:
parent
40b01c1bfc
commit
0c989fb078
|
@ -1740,23 +1740,6 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
|
|||
sei_tmp.lpFile = wszApplicationName;
|
||||
}
|
||||
|
||||
if (*sei_tmp.lpParameters)
|
||||
{
|
||||
len = ExpandEnvironmentStringsW(sei_tmp.lpParameters, NULL, 0);
|
||||
if (len > 0)
|
||||
{
|
||||
LPWSTR buf;
|
||||
len++;
|
||||
buf = HeapAlloc(GetProcessHeap(),0,len*sizeof(WCHAR));
|
||||
ExpandEnvironmentStringsW(sei_tmp.lpParameters, buf, len);
|
||||
if (wszParameters != parametersBuffer)
|
||||
HeapFree(GetProcessHeap(), 0, wszParameters);
|
||||
wszParameters = buf;
|
||||
parametersLen = len;
|
||||
sei_tmp.lpParameters = wszParameters;
|
||||
}
|
||||
}
|
||||
|
||||
if (*sei_tmp.lpDirectory)
|
||||
{
|
||||
len = ExpandEnvironmentStringsW(sei_tmp.lpDirectory, NULL, 0);
|
||||
|
|
|
@ -1354,7 +1354,7 @@ static const argify_tests_t argify_tests[] =
|
|||
{"", "\" p\\three pfour\"", "pfive", "", NULL}, 0}},
|
||||
|
||||
/* Environment variables are left untouched. */
|
||||
{"Params23456", "%TMPDIR% %t %c", 0x12,
|
||||
{"Params23456", "%TMPDIR% %t %c", 0,
|
||||
{" \"%TMPDIR%\" \"%t\" \"%c\" \"\" \"\"",
|
||||
{"", "%TMPDIR%", "%t", "%c", "", "", NULL}, 0}},
|
||||
|
||||
|
|
Loading…
Reference in New Issue