[4/4] shell32: Don't expand environment variables in ShellExecute()'s parameters argument.
Francois Gouget
fgouget at codeweavers.com
Mon Oct 8 17:13:54 CDT 2012
---
dlls/shell32/shlexec.c | 17 -----------------
dlls/shell32/tests/shlexec.c | 2 +-
2 files changed, 1 insertion(+), 18 deletions(-)
diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c
index de6c0f9..a714fe8 100644
--- a/dlls/shell32/shlexec.c
+++ b/dlls/shell32/shlexec.c
@@ -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);
diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c
index ac68ad0..69b466e 100644
--- a/dlls/shell32/tests/shlexec.c
+++ b/dlls/shell32/tests/shlexec.c
@@ -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}},
--
1.7.10.4
More information about the wine-patches
mailing list