On 6/4/2010 22:13, Andrew Eikum wrote:
On 06/03/2010 03:47 PM, Andrew Eikum wrote:
On 06/03/2010 03:12 PM, Nikolay Sivov wrote:
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.
Okay, I see what you're saying now. I hadn't thought of that. After some quick tests, I think you're on the right path. I'll work on fixing it. Thanks!
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?
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.
Andrew