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

Andrew Eikum aeikum at codeweavers.com
Sat Jun 5 10:09:14 CDT 2010

> On 6/4/2010 22:13, Andrew Eikum wrote:
>> On 06/03/2010 03:47 PM, Andrew Eikum wrote:
>> So, with this in mind, here are some much more extensive tests.  As is
>> explained in the comment, Windows _does_ get the ClassID of the object
>> in this call.  But, Windows crashes when a non-IShellFolder object is
>> given to this function.  Presumably it's trying to call
>> IShellFolder_EnumObjects on it.  So it must not be using the CLSID for
>> this kind of type-checking.
> And if pointer doesn't support IPersist does it crash too?

Yes.  The test where QueryInterface_fail is TRUE tests this condition.  It
always returns E_NOINTERFACE in QI, yet EnumObjects is still called.

>> Trouble is, I have no idea what it is used for.  I tried testing most
>> of the CLSIDs in shlguid.h with different combinations of flags, none
>> of which had any effect.  It must just be looking out for a small
>> number of specific CLSIDs.  One possible guess is that it tweaks the
>> flags parameter when certain CLSIDs are detected, but none of my tests
>> turned up anything interesting.
>> Any thoughts?  Should I just send as-is?
> So it doesn't care about classid returned from IPersist. I think it's
> enough now to add tests for not-called QI for IShellFolder and a test
> for a bunch of known CLSIDs for folders. After that (if you dummy CLSID
> is allowed too) probably it's ok to remove all checks.

I'm not sure I follow.  As the tests in the patch show, QI is called up to
two times, once for IPersist and once for IPersistFolder if the first
fails.  I can certainly add tests for returning different CLSIDs, though
that seems uninteresting to me since they all behave identically.

Removing the code in shlwapi.404 will lead to test failures since Windows
_does_ make QI and GetClassID calls, it's just unknown what it does with
the data it gets.

What do you think?  Remove the tests?  Add todo_wine and remove the
'dummy' code in shlwapi.404?

Thanks for your feedback,

More information about the wine-devel mailing list