[PATCH 1/3] shlwapi: Be less strict on which type of IShellFolder can be enumerated

Nikolay Sivov nsivov at codeweavers.com
Thu Jun 3 15:12:56 CDT 2010

On 6/4/2010 00:00, Andrew Eikum wrote:
> On 06/03/2010 02:40 PM, Nikolay Sivov wrote:
>> On 6/3/2010 23:35, Andrew Eikum wrote:
>>> This fixes a bug with Internet Explorer 6's Favorites menu.
>>> This function used to be named IUnknown_EnumObjects, so my guess is
>>> that the original implementor thought it'd be wise to verify the type
>>> of the object before executing IShellFolder's methods on it. Since
>>> it's now called IShellFolder_EnumObjects and explicitly takes an
>>> LPSHELLFOLDER parameter, I see no reason to do the typecheck.
>> And where is a test for that?
> In the patch.  The object returned by SHGetDesktopFolder does not have 
> CLSID_ShellFSFolder, yet it does not fail in the shlwapi EnumObjects 
> call.  Running the test with and without the functionality change 
> shows this.
> I guess I could go try to dig up some IShellFolder instance which 
> succeeds a plain IShellFolder_EnumObjects call and fails a shlwapi 
> EnumObjects call, but I wouldn't even know where to start for that.  
> If the old functionality was required, it needs a test or at least a 
> comment.  As far as current knoweldge goes, it's both simpler and more 
> correct with this patch than it was without.
No, this is not what I meant actually. The possible reason it was named 
as IUnknown_EnumObjects is the same as for the rest of similar calls. 
IUknown is a valid input for all of them and another _QueryInterface is 
performed for IID_IShellFolder is case of this function. That makes no 
sense to have such export as your patch makes it, but it's possible of 
course. I expect that is does check that IShellFolder is supported.
> Andrew

More information about the wine-devel mailing list