The Shell Namespace
This is a short introduction to the Windows shell name space which may be of interest for advanced users.
The Windows shell uses a single hierarchical name space to organize all objects such as files, storage devices, printers, network resources and anything else that can be viewed using the Explorer. The root of this unified name space is the Windows desktop. While similar to a file system's directory structure, the name space contains more types of objects then just files and directories.
Shell Folders
Windows uses a data structure that represents the hierarchy of objects all the way from the desktop to every item that can be seen in the Explorer. From the desktop you can get to drives, Control Panel, Printers and Dial-UP Networking. Look at the left pane of the Explorer to see the hierarchy of objects clearly. These items are called virtual folders, virtual because they refer to items in the name space that can contain other name space items, as opposed to groups of files. An application can use shell functions to retrieve the locations of these special folders.
Because there are many kinds of folders and file objects, each folder is an OLE component object model (COM) object that can enumerate its contents and carry out other actions. More precisely, each folder implements the IShellFolder interface. Retrieving the IShellFolder interface for a shell folder is referred to as binding to the folder.
Item Identifiers
Objects in the shell namespace are assigned item identifiers and item identifier lists. An item identifier uniquely identifies an item within its parent folder. An item identifier list uniquely identifies an item within the shell namespace by tracing a path to the item from a known point — usually the desktop. A pointer to an item identifier list (PIDL) is used throughout the shell to identify an item.
Item identifiers (often referenced as PIDLs) are much like the file names and paths, respectively, used in a file system. However, they share this important difference: item identifiers are binary data structures that never appear to the user. Item names that can be shown to the user (called display names) are described in Display Names. Item identifier lists are almost always allocated using CoTaskMemAlloc(). For example, some shell functions create an item identifier list and return a PIDL to it. In such cases, it is usually your responsibility to make sure the application frees the PIDL that is using the shell's allocator. You can do this by calling CoTaskMemFree().