Commit 0d750e32 authored by Misha Koshelev's avatar Misha Koshelev Committed by Alexandre Julliard

shell32: Fix shelllink creation to non-executable files and remove unnecessary code.

parent 24064853
......@@ -1048,10 +1048,7 @@ static HRESULT WINAPI IPersistStream_fnSave(
IStream* stm,
BOOL fClearDirty)
{
static const WCHAR wOpen[] = {'o','p','e','n',0};
LINK_HEADER header;
WCHAR exePath[MAX_PATH];
ULONG count;
DWORD zero;
HRESULT r;
......@@ -1060,20 +1057,6 @@ static HRESULT WINAPI IPersistStream_fnSave(
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);
/*
* windows can create lnk files to executables that do not exist yet
* so if the executable does not exist the just trust the path they
* gave us
*/
if (!*exePath) lstrcpyW(exePath,This->sPath);
}
memset(&header, 0, sizeof(header));
header.dwSize = sizeof(header);
header.fStartup = This->iShowCmd;
......@@ -1125,7 +1108,7 @@ static HRESULT WINAPI IPersistStream_fnSave(
}
if( This->sPath )
Stream_WriteLocationInfo( stm, exePath, &This->volume );
Stream_WriteLocationInfo( stm, This->sPath, &This->volume );
if( This->sDescription )
r = Stream_WriteString( stm, This->sDescription );
......
......@@ -586,7 +586,7 @@ static void test_load_save(void)
desc.icon_id=0;
desc.hotkey=0x1234;
create_lnk(lnkfile, &desc, 0);
check_lnk(lnkfile, &desc, 0x4);
check_lnk(lnkfile, &desc, 0x0);
r = DeleteFileA(mypath);
ok(r, "failed to delete file %s (%d)\n", mypath, GetLastError());
......
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