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

This commit is contained in:
Misha Koshelev 2007-06-28 20:00:30 -05:00 committed by Alexandre Julliard
parent 240648534f
commit 0d750e3282
2 changed files with 2 additions and 19 deletions

View File

@ -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 );

View File

@ -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());