A customer was having trouble with their shell namespace extension:
When we click the [+] button next to our shell namespace extension in the folder tree view, the tree view shows both files and folders, even though it’s supposed to show only folders. Our
IShellFolder::does return the correct values for
SFGAO_(including it for the folders and omitting it for the non-folders). What are we doing wrong?
The tree view enumerates the children of a folder by calling
IShellFolder:: and passing the
SHCONTF_ flag while omitting the
SHCONTF_ flag. This means that it is only interested in enumerating child folders. Child non-folders should be excluded from the enumeration.
It so happens that the customer’s shell namespace extension was not respecting the
SHCONTF_ flags; it always enumerated all objects regardless of what the caller requested.
Fixing the enumerator fixed the problem.