shell32: Simplify SHELL_execute().
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
fe83877cb3
commit
06f1f53c4c
|
@ -1806,26 +1806,10 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
|
|||
TRACE("execute:%s,%s,%s\n", debugstr_w(wszApplicationName), debugstr_w(wszParameters), debugstr_w(wszDir));
|
||||
lpFile = sei_tmp.lpFile;
|
||||
wcmd = wcmdBuffer;
|
||||
len = lstrlenW(wszApplicationName) + 3;
|
||||
if (sei_tmp.lpParameters[0])
|
||||
len += 1 + lstrlenW(wszParameters);
|
||||
if (len > wcmdLen)
|
||||
{
|
||||
wcmd = heap_alloc(len * sizeof(WCHAR));
|
||||
wcmdLen = len;
|
||||
}
|
||||
wcmd[0] = '\"';
|
||||
len = lstrlenW(wszApplicationName);
|
||||
memcpy(wcmd+1, wszApplicationName, len * sizeof(WCHAR));
|
||||
len++;
|
||||
wcmd[len++] = '\"';
|
||||
wcmd[len] = 0;
|
||||
if (sei_tmp.lpParameters[0]) {
|
||||
wcmd[len++] = ' ';
|
||||
strcpyW(wcmd+len, wszParameters);
|
||||
}
|
||||
|
||||
retval = execfunc(wcmd, NULL, FALSE, &sei_tmp, sei);
|
||||
strcpyW(wcmd, wszApplicationName);
|
||||
retval = SHELL_quote_and_execute( wcmd, wszParameters, wszEmpty,
|
||||
wszApplicationName, NULL, &sei_tmp,
|
||||
sei, execfunc );
|
||||
if (retval > 32) {
|
||||
heap_free(wszApplicationName);
|
||||
if (wszParameters != parametersBuffer)
|
||||
|
|
Loading…
Reference in New Issue