Commit 906be1dc authored by Martin Fuchs's avatar Martin Fuchs Committed by Alexandre Julliard

- Fix handling of %2, %3, ... and lower case format characters in

SHELL_ArgifyW(). - Move "%I" expansion from ShellExecuteEx() into common function SHELL_ArgifyW(). - Pass buffer length to SHELL_FindExecutable(). - FIXME comment for len paramater in SHELL_ArgifyW(). Ge van Geldorp <ge@gse.nl> - Add double quotation marks unless we already have them (e.g.: "%1" %* for exefile). - Remove unnecessary double quotation marks and command line arguments.
parent f38a07b2
......@@ -233,6 +233,9 @@ typedef UINT (*SHELL_ExecuteW32)(const WCHAR *lpCmd, void *env, BOOL shWait,
BOOL WINAPI ShellExecuteExW32(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc);
UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
LPWSTR lpResult, int resultLen, LPWSTR key, void **env, LPITEMIDLIST pidl, LPCWSTR args);
extern WCHAR swShell32Name[MAX_PATH];
#endif
......@@ -664,20 +664,29 @@ static HRESULT WINAPI IPersistStream_fnSave(
IStream* stm,
BOOL fClearDirty)
{
static const WCHAR wOpen[] = {'o','p','e','n',0};
LINK_HEADER header;
ULONG count;
HRESULT r;
WCHAR exePath[MAX_PATH];
ULONG count;
HRESULT r;
_ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
_ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
TRACE("(%p) %p %x\n", This, stm, fClearDirty);
*exePath = '\0';
if (This->sPath)
SHELL_FindExecutable(NULL, This->sPath, wOpen, exePath, MAX_PATH, NULL, NULL, NULL, NULL);
/* if there's no PIDL, generate one */
if( ! This->pPidl )
{
if( ! This->sPath )
if( !*exePath )
return E_FAIL;
This->pPidl = ILCreateFromPathW( This->sPath );
This->pPidl = ILCreateFromPathW(exePath);
}
memset(&header, 0, sizeof(header));
......@@ -724,10 +733,7 @@ static HRESULT WINAPI IPersistStream_fnSave(
}
}
TRACE("Path = %s\n", debugstr_w(This->sPath));
if( ! This->sPath )
return E_FAIL;
Stream_WriteLocationInfo( stm, This->sPath );
Stream_WriteLocationInfo( stm, exePath );
TRACE("Description = %s\n", debugstr_w(This->sDescription));
if( This->sDescription )
......
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