I've run in to a problem trying to browse a DVD/CD using the shell (on XP). The methods I've used work for hard disks/usb disks so it's a strange one. When converting from a filename to a PIDL then back again, the new filename is incorrect (just displays the drive and the first folder). For example // get the pidl of an existing file SHParseDisplayName(Le:\\music\\rock\\test.txt,......) // get the filename of the pidl Desktop->GetDisplayNameOf(pidl, SHGDN_FORPARSING...) which just returns with e:\music (missing off \rock\test.txt) This works as expected on hard disks/usb drives. I noticed that internally the PIDL's returned on the DVD drive are of a different type to normal. Usually every PIDL for a folder/file has the 3rd byte set to 0x31 for a folder, or 0x32 for a file. Folders/ files on the DVD drive have that byte set to zero. The PIDL's also seems to be missing any file/date information as SHGetDataFromIDList fails on them. It looks like GetDisplayNameOf is walking the PIDL to generate the full path and if it hits a PIDL of type 0, it stops. So in the example above we have a pidl list of my computer // PIDL with type 1F (guid) e:\ // PIDL with type 2F (Drive) music // PIDL with type 0 rock // PIDL with type 0 test.txt,......) // PIDL with type 0 So it just returns e:\music Strangely SHGetPathFromIDList does return the correct path/filename for the same pidl, (unfortunately I can't use SHGetPathFromIDList because it only works on file/folder pidls). Anyone come across this problem before or know of a work around?
CD/DVD folders have their own CLSID which is not the same as the regular filesystem folders. Probably this is to service the dual- purpose shell views of these writable media ("files waiting to be written") anyhow, strictly speaking the local folder can do whatever it likes with its pidls and GetDisplayNameOf from the desktop works only as a convenient alternative -- when it works! so you need to get the name from the CD folder itself --- www.zabkat.com