Commit 0de1f3e6 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Pass the correct verb.

Add a space between extra parameters. Wait for ShellExecute to complete.
parent 20ea04f9
...@@ -2466,6 +2466,7 @@ static HRESULT WINAPI ...@@ -2466,6 +2466,7 @@ static HRESULT WINAPI
ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici ) ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici )
{ {
IShellLinkImpl *This = impl_from_IContextMenu(iface); IShellLinkImpl *This = impl_from_IContextMenu(iface);
static const WCHAR szOpen[] = { 'O','p','e','n',0 };
SHELLEXECUTEINFOW sei; SHELLEXECUTEINFOW sei;
HWND hwnd = NULL; /* FIXME: get using interface set from IObjectWithSite */ HWND hwnd = NULL; /* FIXME: get using interface set from IObjectWithSite */
LPWSTR args = NULL; LPWSTR args = NULL;
...@@ -2500,7 +2501,7 @@ ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici ) ...@@ -2500,7 +2501,7 @@ ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici )
( lpici->fMask & CMIC_MASK_UNICODE ) ) ( lpici->fMask & CMIC_MASK_UNICODE ) )
{ {
LPCMINVOKECOMMANDINFOEX iciex = (LPCMINVOKECOMMANDINFOEX) lpici; LPCMINVOKECOMMANDINFOEX iciex = (LPCMINVOKECOMMANDINFOEX) lpici;
DWORD len = 0; DWORD len = 2;
if ( This->sArgs ) if ( This->sArgs )
len += lstrlenW( This->sArgs ); len += lstrlenW( This->sArgs );
...@@ -2512,19 +2513,32 @@ ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici ) ...@@ -2512,19 +2513,32 @@ ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici )
if ( This->sArgs ) if ( This->sArgs )
lstrcatW( args, This->sArgs ); lstrcatW( args, This->sArgs );
if ( iciex->lpParametersW ) if ( iciex->lpParametersW )
{
static const WCHAR space[] = { ' ', 0 };
lstrcatW( args, space );
lstrcatW( args, iciex->lpParametersW ); lstrcatW( args, iciex->lpParametersW );
} }
}
memset( &sei, 0, sizeof sei ); memset( &sei, 0, sizeof sei );
sei.cbSize = sizeof sei; sei.cbSize = sizeof sei;
sei.fMask = SEE_MASK_UNICODE | SEE_MASK_NOCLOSEPROCESS;
sei.lpFile = path; sei.lpFile = path;
sei.nShow = This->iShowCmd; sei.nShow = This->iShowCmd;
sei.lpIDList = This->pPidl; sei.lpIDList = This->pPidl;
sei.lpDirectory = This->sWorkDir; sei.lpDirectory = This->sWorkDir;
sei.lpParameters = args; sei.lpParameters = args;
sei.lpVerb = szOpen;
if( ShellExecuteExW( &sei ) ) if( ShellExecuteExW( &sei ) )
{
if ( sei.hProcess )
{
WaitForSingleObject( sei.hProcess, 10000 );
CloseHandle( sei.hProcess );
}
r = S_OK; r = S_OK;
}
else else
r = E_FAIL; r = E_FAIL;
......
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