Retrieving Security Zone for My Computer
Hi,
I'm using the following code to retrieve the security zone of shell items:
CComPtr<IInternetSecurityManager> pInternetSecurityManager;
CoInternetCreateSecurityManager(NULL, &pInternetSecurityManager, 0);
CComPtr<IShellItem> pShellItem;
SHCreateShellItem(NULL, NULL, reinterpret_cast<PCUITEMID_CHILD>(pIDL),
&pShellItem);
LPWSTR pURL = NULL;
pShellItem->GetDisplayName(SIGDN_URL, &pURL);
DWORD zone = 0;
pInternetSecurityManager->MapUrlToZone(pURL, &zone, 0);
This works for items that are part of the file system. For virtual items
like My Computer, Recycle Bin, Control Panel and so on, the code reports
zone 3, which is the Internet zone. Windows Explorer reports these items
as being in the "My Computer" zone.
How do I retrieve the zone correctly? Or is the zone of virtual items
hard coded?
Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
date: Sun, 24 Feb 2008 23:51:34 +0100
author: Timo Kunze