Fix execution of Control Panel items.

This commit is contained in:
Ge van Geldorp 2005-09-12 12:10:57 +00:00 committed by Alexandre Julliard
parent 8ec81f16fc
commit 5b7da80911
3 changed files with 8 additions and 7 deletions

View File

@ -970,6 +970,7 @@ static HRESULT WINAPI IShellExecuteHookW_fnExecute(IShellExecuteHookW* iface, LP
SHELLEXECUTEINFOW sei_tmp; SHELLEXECUTEINFOW sei_tmp;
PIDLCPanelStruct* pcpanel; PIDLCPanelStruct* pcpanel;
WCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
WCHAR params[MAX_PATH];
BOOL ret; BOOL ret;
int l; int l;
@ -990,12 +991,13 @@ static HRESULT WINAPI IShellExecuteHookW_fnExecute(IShellExecuteHookW* iface, LP
/* pass applet name to Control_RunDLL to distinguish between applets in one .cpl file */ /* pass applet name to Control_RunDLL to distinguish between applets in one .cpl file */
path[l++] = '"'; path[l++] = '"';
path[l++] = ' '; path[l] = '\0';
MultiByteToWideChar(CP_ACP, 0, pcpanel->szName+pcpanel->offsDispName, -1, path+l, MAX_PATH); MultiByteToWideChar(CP_ACP, 0, pcpanel->szName+pcpanel->offsDispName, -1, params, MAX_PATH);
memcpy(&sei_tmp, psei, sizeof(sei_tmp)); memcpy(&sei_tmp, psei, sizeof(sei_tmp));
sei_tmp.lpFile = path; sei_tmp.lpFile = path;
sei_tmp.lpParameters = params;
sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST; sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST;
sei_tmp.lpVerb = wCplopen; sei_tmp.lpVerb = wCplopen;

View File

@ -1263,9 +1263,10 @@ BOOL WINAPI ShellExecuteExW32 (LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfun
lpFile = wfileName; lpFile = wfileName;
strcpyW(wcmd, wszApplicationName);
if (sei_tmp.lpParameters[0]) { if (sei_tmp.lpParameters[0]) {
strcatW(wszApplicationName, wSpace); strcatW(wcmd, wSpace);
strcatW(wszApplicationName, wszParameters); strcatW(wcmd, wszParameters);
} }
/* We set the default to open, and that should generally work. /* We set the default to open, and that should generally work.
@ -1273,7 +1274,7 @@ BOOL WINAPI ShellExecuteExW32 (LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfun
if (!sei_tmp.lpVerb) if (!sei_tmp.lpVerb)
sei_tmp.lpVerb = wszOpen; sei_tmp.lpVerb = wszOpen;
retval = execfunc(wszApplicationName, NULL, FALSE, &sei_tmp, sei); retval = execfunc(wcmd, NULL, FALSE, &sei_tmp, sei);
if (retval > 32) if (retval > 32)
return TRUE; return TRUE;

View File

@ -704,9 +704,7 @@ static void test_lnks()
okChildInt("argcA", 5); okChildInt("argcA", 5);
okChildString("argvA3", "Open"); okChildString("argvA3", "Open");
sprintf(filename, "%s\\test file.shlexec", tmpdir); sprintf(filename, "%s\\test file.shlexec", tmpdir);
todo_wine {
okChildPath("argvA4", filename); okChildPath("argvA4", filename);
}
sprintf(filename, "%s\\test_shortcut_exe.lnk", tmpdir); sprintf(filename, "%s\\test_shortcut_exe.lnk", tmpdir);
rc=shell_execute_ex(SEE_MASK_NOZONECHECKS, NULL, filename, NULL, NULL); rc=shell_execute_ex(SEE_MASK_NOZONECHECKS, NULL, filename, NULL, NULL);