Hi Stefan,
On Wednesday 25 May 2005 18:13, Stefan Dösinger wrote:
Any suggestions to the following patch?
+ SHELL32_GetItemAttributes (_IShellFolder_ (This), This->pidlRoot, &dwAttributes);
This->pidlRoot is the ITEMIDLIST of all SHITEMIDs starting from the root of the shell namespace up to the current folder. If you take a look into SHELL32_GetItemAttributes, it calls _ILIsDrive, _ILGetGUIDPointer and the like on the pidl. Those function inspect the first SHITEMID in the ITEMIDLIST only (see pidl.c). This means they will inspect the SHITEMID which represents the drive, which the ITEMIDLIST ist based on.
What you really need to do is to call SHBindToParent. This will give you a pointer to the current folders parent folder as well as the last SHITEMID of the ITEMIDLIST. Call SHELL32_GetItemAttributes with the parent folder and this last SHITEMID.
As to the caching of the file attributes: Those are already cached in the SHITEMID (see _ILGetFileAttributes in pidl.c). So you are adding a redundant level of caching and thus unnecessary complexity. IMHO it would be better to remove the IGenericFSImpl's dwAttributes member and just call SHELL32_GetItemAttributes.
Bye, -- Michael Jung mjung@iss.tu-darmstadt.de