Commit 06f1f53c authored by Damjan Jovanovic's avatar Damjan Jovanovic Committed by Alexandre Julliard

shell32: Simplify SHELL_execute().

parent fe83877c
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment