SECPidlMgr Class

template <class T>
class SECPidlMgr

SECPidlMgr

Defined in: SECPidlMgr.h

Comments

This class encapsulates the operations on PIDL. It requires a template argument that is only used to access the data in the PIDL in a type safe way. There is a very important requirements to the data in this template class T. That is, all the data in this class has to in a single contigous memory block. Generally, you don't need to override this class. However, if you are data type class T dyamically change size, you should first layout the data in a memory block before call CreateItem method giving it the memory location and the memory size. Refer to MirrorDirectory sample for an example. This class is intended to be used in the shell and namespace extension development. As documented in the Win32 SDK, the memory management should be handled using IMalloc interface obtained from the shell. So you should always use instance of this class to create and delete PIDL. Whenever a instance of this class is successfully created, it will have a usable IMalloc interface pointer.

Class Template Arguments

T

The structured data in the PIDL

Class Members

CComPtr<IMalloc>  m_spMalloc

Memory managing object

SECPidlMgr()

Constructor

void  Delete(LPITEMIDLIST pidl)

Delete the given pidl

virtual LPITEMIDLIST  CreateItem(LPBYTE pData, SEC_UINT nInSize)

Create PIDL from given data

LPITEMIDLIST  Copy(LPCITEMIDLIST pidlSrc)

Make a copy of the given pidl

T*  GetDataPointer(LPCITEMIDLIST pidl)

Get the pointer to the data in the given pidl

T*  GetLastDataPointer(LPCITEMIDLIST pidl)

Get the pointer to the data of the last pidl

SEC_UINT  GetSize(LPCITEMIDLIST pidl)

Get the totoal size of the pidl

LPITEMIDLIST  GetNextItem(LPCITEMIDLIST pidl)

Get Next pidl of the given pidl

LPITEMIDLIST  GetLastItem(LPCITEMIDLIST pidl)

Get the last pidl of the given pidl

LPITEMIDLIST  Concatenate(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)

Create a pidl that is the concatenation of the given two pidls

LPITEMIDLIST*  DupPidlArray(LPCITEMIDLIST* aSrcPidls, int nCount)

Duplicate an PIDL array

void  DeletePidlArray(LPITEMIDLIST* apidls, int nCount)

Free the memory used by the given PIDL array