No subject

Tue Aug 30 17:20:58 CDT 2005

MAJOR overhaul, and it worked great in most cases and
older code had to rewritten...
.. and resolution of shortcuts just stopped working
since then.
So I have downgraded to using Wine 20030508 since it's
the last version till which resolution of shortcuts
works (though the code in 'shelllink.c' for this
version is not nice to look at ;) ).


You see, the resolving of shortcuts is handled through
IPersistFile::Load() using COM.

The code for this instance of the interface can be
found in 'dlls/shell32/shelllink.c'.
IPersistFile::Load() calls IPersistFile_fnLoad from
'dlls/shell32/shelllink.c', which passes control to
IPersistStream_Load() after a CreateStreamOnFile()
Now the problem starts in IPersistStream_Load()
at/after the following piece of code:

'if( hdr.dwFlags & SCF_DESCRIPTION ) r =
Stream_LoadString( pLoadStream, unicode,
&This->sDescription );'...

Everything before this seems to work just fine!

[That's a pity because most of the time we just
require the program location from the shortcut file,
and that's ALWAYS dumped correctly into 'This->pPidl'
You can verify this by adding the following code after
'r = Stream_LoadLocation( pLoadStream );' in

        LPCITEMIDLIST pidltemp = This->pPidl;
        char szSubho[MAX_PATH];
        _dbg_ILSimpleGetText(pidltemp, szSubho,
        TRACE ("name=\"%s\"\n",szSubho);
        pidltemp = _dbg_ILGetNext(pidltemp);
        }while (pidltemp->mkid.cb);
	You need to turn on the trace messages and you shall
see the program path resolved allright!
I had even tried to put a 'return S_OK;' after the
Stream_LoadLocation() call,because ALL i required was
the program path, but unfortunately that did NOT work

The call 'Stream_LoadString( pLoadStream, unicode,
&This->sDescription );' works in some cases and fails
in some. But you can be sure that all the following
Stream_LoadString() calls starting from
'Stream_LoadString( pLoadStream, unicode,
&This->sPathRel);' WILL fail!
It did everytime on my SuSE 8.2,Wine-20030911.
Thus, IPersistStream_fnLoad() will NEVER return S_OK !

The last time I debugged, I found that
'IStream_Read(pStm, &len, sizeof(len), &count);' under
'Stream_LoadString( IStream* pStm, BOOL unicode,
LPWSTR *pstr )' was failing at/after the 'Description'
string was read from the Windows shortcut file,
apparently because the 'number of bytes read!=number
of bytes to be read'( i.e, for those of you going
through the 'shelllink.c' code, the 'count != len'
condition was getting satisfied..)
You may again verify this by turning on tracing and
observing the messages for the above APIs from Wine
while running my shortcut resolving code (found in the
archives) OR McCormack's 'winemenubuilder'.

I hope to get a suitable response to this post. PLEASE
correct me if I have gone wrong anywhere! Thanks :=)

Also, I will be VERY happy to recieve
pseudocode/algorithm for the mentioned APIs specially
Stream_LoadString() and IPersistStream_fnLoad() as I
am having a hard time understanding a few lines in the
code. And could someone send me the layout of .lnk
files ?

Please keep up the good work.

Subhobroto Sinha

Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

More information about the wine-devel mailing list