I'm trying to implement Manipulating the zone identifier to specify where a file was download from – The Old New Thing - MSDN blogs in Python.
At CoCreateInstance
:
pythoncom.CoCreateInstance(
pywintypes.IID('{0968e258-16c7-4dba-aa86-462dd61e31a3}'), #CLSID_PersistentZoneIdentifier
None,pythoncom.CLSCTX_ALL,
pywintypes.IID('{cd45f185-1b21-48e2-967b-ead743a8914e}')) #IID_IZoneIdentifier
I get an error:
TypeError: There is no interface object registered that supports this IID
(No stacktrace as this is an extension function)
If I replace the IZoneIdentifier
IID with pythoncom.IID_IUnknown
or pythoncom.IID_IPersistFile
, it works, but a QueryInterface
with the right IID fails with the same error.
Indeed, in HKCR\Interface
, I see nothing like IZoneIdentifier
but do see an IPersistFile
.
Having disassembled urlmon.dll
, I see that it indeed implements the interface, but doesn't register it in its DllRegisterServer
. Searching further, I see that IPersistFile
is being registered by ole32.dll
- but not IZoneIdentifier
.
MSDN documents this interface to be available since IE6. But it's not there in either IE7 or IE8. Since this is XP (and with all the updates allegedly), I've nothing else to try.
Likewise, the interface is present in Windows SDK 7.0 in the urlmon.h
file mentioned in the MSDN article.
The questions are:
- Was this interface silently dropped in favour of something else without MSDN reflecting that or something? Alternatively, is this a known issue? Is it available in later versions of IE?
- What components do
ole32.dll
andurlmon.dll
pertain to (so I can try (un)installing updates for them)?