shell32: Partial implementation of IShellItem::BindToHandler.

David Hedberg david.hedberg at gmail.com
Mon Aug 2 03:07:01 CDT 2010


Hi,

On Mon, Aug 2, 2010 at 7:04 AM, Nikolay Sivov <nsivov at codeweavers.com> wrote:
>  On 8/2/2010 02:36, David Hedberg wrote:
>>
>> +static HRESULT ShellItem_get_shellfolder(ShellItem *This, IBindCtx *pbc,
>> IShellFolder **ppsf)
>> +{
>> +    IShellFolder *desktop;
>> +    HRESULT ret;
>> +
>> +    ret = SHGetDesktopFolder(&desktop);
>> +    if (SUCCEEDED(ret))
>> +    {
>> +        if (_ILIsDesktop(This->pidl))
>> +        {
>> +            *ppsf = desktop;
>> +            IShellFolder_AddRef(*ppsf);
>> +        }
>> +        else
>> +        {
>> +            ret = IShellFolder_BindToObject(desktop, This->pidl,
>> pbc,&IID_IShellFolder, (void**)ppsf);
>> +        }
>> +
>> +        IShellFolder_Release(desktop);
>> +    }
>> +
>> +    return ret;
>> +}
>> +
>>
> I don't think this explicit check for desktop folder is needed here, as I
> understand ::BindToObject() it should handle this case internally.
>

I wrote a quick testcase and tested it with wine, Windows XP and
Windows 7. BindToObject() does not seem to handle this case in any of
these, instead they all return E_INVALIDARG. Wine appears to
accomplish this with the check for "!pidlComplete->mkid.cb" in
shlfolder.c:Shell32_BindToChild. So as far as I can tell, the explicit
check here seems to be needed..



More information about the wine-devel mailing list