Click here to Skip to main content
13,829,956 members
Click here to Skip to main content
Add your own
alternative version


28 bookmarked
Posted 15 Feb 2002

Namespace Extensions: the IDelegateFolder mystery

, 15 Feb 2002
Rate this:
Please Sign up or sign in to vote.
Documentation for the undocumented interface IDelegateFolder

Since Internet Explorer 4, the shell namespace contains an "Internet Explorer" item.

This Internet Explorer forms a special junction point where you can include your own namespace extensions.

Microsoft uses this for their FTP folders. You can add your own by registering a url prefix in the registry. Copy the entries that are used in HKEY_CLASSES_ROOT\ftp.

However, something strange is going on. You don't see the root item of this namespace extension displayed in explorer. There is no item named "ftp folders" that is the root of all ftp folders. Instead, the "Internet Explorer" item functions as the root.

This has a very strange implication: The Internet Explorer root item had to understand the pidls of all underlying namespaces.

The solution: Internet Explorer will embed the pidls of all namespace extensions in its own pidls. The mechanism used to accomplish this is IDelegateFolder.

Using IDelegateFolder, your namespace extension will receive an IMalloc interface. The Alloc function of this IMalloc will allocate an Internet Explorer pidl that points to your namespace extension and has empty room to put your own pidl in.

This is the IID of IDelegateFolder:

// {ADD8BA80-002B-11D0-8F0F-00C04FD7D062}
            0xADD8BA80L, 0x002B, 0x11D0, 0x8F, 0x0F, 0x00, 0xC0, 0x4F, 0xD7, 0xD0, 0x62);

This is the interface definition:

DECLARE_INTERFACE_(IDelegateFolder, IUnknown)
	// IUnknown methods
	STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;

	// IDelegateFolder methods
	STDMETHOD(SetItemAlloc)(THIS_ IMalloc *pMalloc) PURE;

After instantiating your namespace extension, Internet Explorer will query for the IDelegateFolder interface and call SetItemAlloc, passing an IMalloc interface. You have to store this interface.

From this moment on, when ever you have to create a pidl, you have to follow these steps:

  • Call the Alloc function of this IMalloc
  • Insert your own complete pidl (including the size) at offset 4 of the returned buffer
  • Return this buffer as your own pidl

The returned buffer will already be a pidl, starting with the size (2 bytes) and then a 2 bytes signature (0x61 0x03).

All the pidls that will be passed to your namespace extension will also have this format. This means you will find your own pidl at offset 4.

The pidls are still freed the normal way, using the shell allocator.

If your namespace extensions has subfolders, then these subfolders follow the normal system. The first id in the list will be the special Internet Explorer pidl, all the others that follow are your own normal pidls.

This is not a clean solution that was chosen by Microsoft. It would have been much easier if the Internet Explorer root node would do the insertion and extraction of the embedded pidl, eliminating the need for this interface.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Henk Devos
Web Developer
Belgium Belgium
Henk studied computer science at the University of Ghent, specializing in theoretical computer science.
He is now working for Artwork Systems, Belgium, and Whirling Dervishes Software, Belgium.
Henk knows a little something about networking, graphics, object-oriented design, AI, embedded systems. He knows most of the PDF specs by heart.
Henk developed NSELib, the NameSpace Extension Library.
You can find his latest freeware software at It contains a namespace extension that puts the registry in Windows Explorer. The newest commercial project is Alpha ZIP, an explorer-embedded ZIP file utility.

You may also be interested in...

Comments and Discussions

QuestionUsing a namespace extension with a custom protocol Pin
be mo22-Jun-06 22:50
memberbe mo22-Jun-06 22:50 
QuestionHow to add namespace extensions to the backup window, so I can backup. Pin
greenjade8009-Aug-04 14:26
membergreenjade8009-Aug-04 14:26 
Generaloffset Pin
Anonymous27-Jul-04 21:02
memberAnonymous27-Jul-04 21:02 
GeneralRe: offset Pin
Henk Devos27-Jul-04 23:32
memberHenk Devos27-Jul-04 23:32 
QuestionHow I display the background directory context menu? Pin
Miguel Matos1-Oct-03 2:10
memberMiguel Matos1-Oct-03 2:10 
AnswerRe: How I display the background directory context menu? Pin
Henk Devos1-Oct-03 2:36
memberHenk Devos1-Oct-03 2:36 
GeneralRe: How I display the background directory context menu? Pin
Miguel Matos1-Oct-03 6:07
memberMiguel Matos1-Oct-03 6:07 
GeneralIDelegateFolder not registered in W2K Pin
ayeka27-May-03 21:42
memberayeka27-May-03 21:42 
GeneralRe: IDelegateFolder not registered in W2K Pin
Henk Devos27-May-03 22:31
memberHenk Devos27-May-03 22:31 
Generaljust curious... Pin
umeca7413-Oct-02 1:12
memberumeca7413-Oct-02 1:12 
GeneralRe: just curious... Pin
Henk Devos13-Oct-02 8:33
memberHenk Devos13-Oct-02 8:33 
Question(where is) API defn for my own protocol handler? Pin
Relishguy19-Mar-02 11:39
memberRelishguy19-Mar-02 11:39 
AnswerRe: (where is) API defn for my own protocol handler? Pin
Relishguy19-Mar-02 14:43
memberRelishguy19-Mar-02 14:43 
GeneralRe: (where is) API defn for my own protocol handler? Pin
Henk Devos22-Mar-02 8:06
memberHenk Devos22-Mar-02 8:06 
QuestionWhy root there? Pin
_Magnus_18-Feb-02 5:09
member_Magnus_18-Feb-02 5:09 
AnswerRe: Why root there? Pin
Henk Devos18-Feb-02 5:13
memberHenk Devos18-Feb-02 5:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web01 | 2.8.190114.1 | Last Updated 16 Feb 2002
Article Copyright 2002 by Henk Devos
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid