The SHGetFileInfo function interprets the double-dot entry as a relative path resolved directly against the application's current working directory. When executed from a directory nested two levels down, the resolved path points to a regular folder, whereas running one level down targets the drive root. Developers can resolve this discrepancy by passing the SHGFI_USEFILEATTRIBUTES flag paired with the FILE_ATTRIBUTE_DIRECTORY attribute alongside a syntactically valid path.
Key points
Shell icon lookups for relative parent entries depend directly on the active working dire…: Shell icon lookups for relative parent entries depend directly on the active working directory of the application.
Resolving the relative path against a shallow directory hierarchy causes the operating sy…: Resolving the relative path against a shallow directory hierarchy causes the operating system to return a drive icon.
Developers can guarantee a standard folder icon by combining the SHGFI_USEFILEATTRIBUTES…: Developers can guarantee a standard folder icon by combining the SHGFI_USEFILEATTRIBUTES flag with the FILE_ATTRIBUTE_DIRECTORY attribute.
Sources checked by our analysis pipeline: 1
A customer wanted their program to show a file listing with icons, and they also wanted to include an entry for the parent folder, programmatically known as .. (double period). They obtained icons by calling the SHGetFileInfo
function, but they got weird, inconsistent results when they asked for the icon of the .. parent folder.
They found that when they ran the program in a debugger, it gave them the desired folder icon 🗀. But when it ran on the customer’s system, it showed a drive icon 🖴. What’s going on? Why is the icon changing depending on who is running the program?
My psychic debugging powers¹ told me that the developer told their debugger to run the program with the current directory equal to something that is at least two directory levels away from the root. Perhaps they are using Visual Studio and accepted the default configuration that sets the current directory to $(ProjectDir), and their project directory is eomthing like C:\
Legal actions brought by educational systems across the country are culminating in a massive financial resolution concerning student welfare. The platform is addressing allegations that its design and features fostered addictive behavior among children. If finalized, this multibillion-dollar payout would resolve substantial liability stemming from the nationwide classroom impact.
The tentative multi-billion-dollar agreement aims to resolve widespread legal battles brought by educators over the platform's alleged contribution to a youth mental health crisis. Districts nationwide have redirected critical educational resources toward mental-health staff and phone bans to counter engagement features like autoplay and algorithmic recommendations. If finalized, the resolution will introduce operational safeguards for teenagers while legal actions proceed against other prominent social media plat…
Developers behind the privacy-focused operating system allege that aggressive corporate measures are actively targeting their platform. The dispute raises concerns that users may soon lose the ability to install alternative software on Pixel hardware. If realized, such restrictions would severely undermine the open firmware ecosystem supported by these devices.