1 // TortoiseOverlays - an overlay handler for Tortoise clients
2 // Copyright (C) 2007 - TortoiseSVN
5 #pragma warning (disable : 4786)
7 // Initialize GUIDs (should be done only and at-least once per DLL/EXE)
14 // *********************** CShellExt *************************
15 CShellExt::CShellExt(FileState state
)
24 CShellExt::~CShellExt()
30 STDMETHODIMP
CShellExt::QueryInterface(REFIID riid
, LPVOID FAR
*ppv
)
34 if (IsEqualIID(riid
, IID_IShellExtInit
) || IsEqualIID(riid
, IID_IUnknown
))
36 *ppv
= (LPSHELLEXTINIT
)this;
38 else if (IsEqualIID(riid
, IID_IContextMenu
))
40 *ppv
= (LPCONTEXTMENU
)this;
42 else if (IsEqualIID(riid
, IID_IContextMenu2
))
44 *ppv
= (LPCONTEXTMENU2
)this;
46 else if (IsEqualIID(riid
, IID_IContextMenu3
))
48 *ppv
= (LPCONTEXTMENU3
)this;
50 else if (IsEqualIID(riid
, IID_IShellIconOverlayIdentifier
))
52 *ppv
= (IShellIconOverlayIdentifier
*)this;
54 else if (IsEqualIID(riid
, IID_IShellPropSheetExt
))
56 *ppv
= (LPSHELLPROPSHEETEXT
)this;
68 STDMETHODIMP_(ULONG
) CShellExt::AddRef()
73 STDMETHODIMP_(ULONG
) CShellExt::Release()
78 for (vector
<DLLPointers
>::iterator it
= m_dllpointers
.begin(); it
!= m_dllpointers
.end(); ++it
)
80 if (it
->pShellIconOverlayIdentifier
!= NULL
)
81 it
->pShellIconOverlayIdentifier
->Release();
83 FreeLibrary(it
->hDll
);
86 it
->pDllGetClassObject
= NULL
;
87 it
->pDllCanUnloadNow
= NULL
;
88 it
->pShellIconOverlayIdentifier
= NULL
;
91 m_dllpointers
.clear();