[PATCH] shell32: Implement FCIDM_SHVIEW_CREATELINK

Nikolay Sivov bunglehead at gmail.com
Mon Jun 5 08:58:52 CDT 2017


On 05.06.2017 16:45, Aric Stewart wrote:
> 
> 
> On 6/2/17 10:49 AM, Nikolay Sivov wrote:
>> On 02.06.2017 17:24, Aric Stewart wrote:
>>>
>>> Presently the wine file explorer has a create shortcut entry that
>>> does nothing. This implements the FCIDM_SHVIEW_CREATELINK command.
>>>
>>> Signed-off-by: Aric Stewart <aric at codeweavers.com>
>>> ---
>>>   dlls/shell32/shlview_cmenu.c | 50 ++++++++++++++++++++++++++++++++++++++++++++
>>>   1 file changed, 50 insertions(+)
>>>
>>
>>
>>> +    if (!SUCCEEDED(CoCreateInstance( &CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
>>> +                                     &IID_IShellLinkW, (LPVOID*)&shelllink)))
>>> +    {
>>> +        ERR("couldn't create ShellLink object\n");
>>> +        return;
>>> +    }
>>
>> This should be FAILED(). You can use IShellLink_Constructor() instead of
>> going through generic object creation.
>>
>>   > +    SHGetSpecialFolderPathW(NULL, root, CSIDL_STARTMENU, TRUE);
>>> +    lnkfile=HeapAlloc(GetProcessHeap(), 0, (lstrlenW(root)+1+lstrlenW(wszFilename)+5) * sizeof(*lnkfile));
>>> +    lstrcpyW(lnkfile, root);
>>> +    lstrcatW(lnkfile, backslashW);
>>> +    lstrcatW(lnkfile, wszFilename);
>>> +    lstrcatW(lnkfile, lnkW);
>>
>> Why is it created in Start Menu dir? I think usual behavior is to create
>> it in target directory.
> 
> Create the link in the same directory as the original program exists?  That seems counter intuitive to me. I could seen an argument for the desktop instead of the start menu. But again I have not used windows myself in years.

Yes, that's how it works. If you use desktop context menu it will be
created on the desktop, for different explorer window it will be created
in the path this window is open to.

> 
> 
> -aric
> 
> 




More information about the wine-devel mailing list