I'm trying to figure out, how to get a PIDL (or IShellItem, or IShellFolder) of a volume Guid Path (e.g. "\\?\Volume{50165421-0000-0000-0000-005d25000000}\
").
I would like to be able to invoke file operations or shell context menu items from my program on it or its child objects.
If it is mounted and accessible via drive letter or folder, no problem, but I'm struggling with unmounted volumes.
While the addressbar of Windows Explorer is not able to parse these names, it is possible to open Windows Explorer with the run command (or use ShellExecute):
- Via "Disk Management", create a new volume, without assigning a drive-letter or folder:
- using mountvol, you can see the Volume name with "no mount points" (1)
- Copy the volume path into a run command (2)
- See Windows Explorer (3)
Once opened in Windows Explorer, it can handle the paths fine, i.e. enumeration and context menu works normally.
What I've tried so far:
- All kinds of parsing function provided by the shell, i.e.
ILCreateFromPathW,
SHParseDisplayName,
IShellFolder.ParseDisplayName,
SHCreateItemFromParsingName
Actually I did NOT check a lot of IBindCtx options, because from the documentation I'm not sure, which ones to try out for this use case.
Tried the undocumented IShellURL interface shared by @RbMm here -- it displays the same error message box as the AddressBar.
From Volume Management Reference I also do not see a connection point towards PIDLs.
Tracking the starting of the volume name with ShellExecute with Process Monitor, I see that Windows Explorer is accessing
HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\?\Volume{50165421-0000-0000-0000-005D25000000}
, just before opening "\Device\HarddiskVolume3\
".
But I'm not even sure, if this is related.
Does anyone have an idea what else I could try?