shell32: make sure BrowseForFolder doesn't return NULL for the Desktop folder as this means a cancel (should fix bug #5533)

Robert Shearman rob at codeweavers.com
Fri Feb 9 07:52:42 CST 2007


Mikołaj Zalewski wrote:
> +/*************************************************************************
> + * _ILMakePidlNotNull
> + *
> + * A null pidl is a valid pidl that represents the Desktop. However if we don't
> + * want a NULL pidl (e.g. because NULL indicates an error) this function will
> + * make an explicit empty pidl if the parameter is NULL.
> + */
> +HRESULT _ILMakePidlNotNull(LPITEMIDLIST *pidl)
> +{
> +    if (*pidl == NULL)
> +        *pidl = _ILCreateDesktop();
> +    if (*pidl == NULL)
> +        return E_OUTOFMEMORY;
> +    return S_OK;
> +}
>   

This function is a bit ugly. It seems this policy should be made in the 
BrsFolder_OnCommand function, rather than in pidl.c as a file.

-- 
Rob Shearman




More information about the wine-devel mailing list