Changeset e8add5046b79…
Parent 9e2478510012…
by
Changes to 2 files · Browse files at e8add5046b79 Showing diff from parent 9e2478510012 Diff from another changeset...
@@ -1,11 +1,14 @@ #include "stdafx.h"
-#include "CShellExtCMenu.h"
#include "TortoiseUtils.h"
#include "StringUtils.h"
#include "Dirstatecache.h"
#include "Thgstatus.h"
#include "Winstat.h"
#include "InitStatus.h"
+#include "ShellExt.h"
+
+#include "CShellExtCMenu.h"
+
#include <map>
@@ -810,3 +813,64 @@
return NOERROR;
}
+
+
+CShellExtCMenu::CShellExtCMenu(char dummy) :
+ m_ppszFileUserClickedOn(0)
+{
+ m_cRef = 0L;
+ CShellExt::IncDllRef();
+}
+
+
+CShellExtCMenu::~CShellExtCMenu()
+{
+ CShellExt::DecDllRef();
+}
+
+
+STDMETHODIMP_(ULONG) CShellExtCMenu::AddRef()
+{
+ ThgCriticalSection cs(CShellExt::GetCriticalSection());
+ return ++m_cRef;
+}
+
+
+STDMETHODIMP_(ULONG) CShellExtCMenu::Release()
+{
+ ThgCriticalSection cs(CShellExt::GetCriticalSection());
+ if(--m_cRef)
+ return m_cRef;
+ delete this;
+ return 0L;
+}
+
+
+STDMETHODIMP CShellExtCMenu::QueryInterface(REFIID riid, LPVOID FAR* ppv)
+{
+ *ppv = NULL;
+ if (IsEqualIID(riid, IID_IShellExtInit) || IsEqualIID(riid, IID_IUnknown))
+ {
+ *ppv = (LPSHELLEXTINIT) this;
+ }
+ else if (IsEqualIID(riid, IID_IContextMenu))
+ {
+ *ppv = (LPCONTEXTMENU) this;
+ }
+ else if (IsEqualIID(riid, IID_IContextMenu2))
+ {
+ *ppv = (IContextMenu2*) this;
+ }
+ else if (IsEqualIID(riid, IID_IContextMenu3))
+ {
+ *ppv = (IContextMenu3*) this;
+ }
+
+ if (*ppv)
+ {
+ AddRef();
+ return NOERROR;
+ }
+
+ return E_NOINTERFACE;
+}
|
|
@@ -142,25 +142,12 @@ CShellExt::IncDllRef();
}
-CShellExtCMenu::CShellExtCMenu(char dummy) :
- m_ppszFileUserClickedOn(0)
-{
- m_cRef = 0L;
- CShellExt::IncDllRef();
-}
-
CShellExtOverlay::~CShellExtOverlay()
{
CShellExt::DecDllRef();
}
-CShellExtCMenu::~CShellExtCMenu()
-{
- CShellExt::DecDllRef();
-}
-
-
LPCRITICAL_SECTION CShellExt::GetCriticalSection()
{
return &g_critical_section;
@@ -199,35 +186,6 @@ return E_NOINTERFACE;
}
-STDMETHODIMP CShellExtCMenu::QueryInterface(REFIID riid, LPVOID FAR* ppv)
-{
- *ppv = NULL;
- if (IsEqualIID(riid, IID_IShellExtInit) || IsEqualIID(riid, IID_IUnknown))
- {
- *ppv = (LPSHELLEXTINIT) this;
- }
- else if (IsEqualIID(riid, IID_IContextMenu))
- {
- *ppv = (LPCONTEXTMENU) this;
- }
- else if (IsEqualIID(riid, IID_IContextMenu2))
- {
- *ppv = (IContextMenu2*) this;
- }
- else if (IsEqualIID(riid, IID_IContextMenu3))
- {
- *ppv = (IContextMenu3*) this;
- }
-
- if (*ppv)
- {
- AddRef();
- return NOERROR;
- }
-
- return E_NOINTERFACE;
-}
-
STDMETHODIMP_(ULONG) CShellExtOverlay::AddRef()
{
@@ -235,11 +193,6 @@ return ++m_cRef;
}
-STDMETHODIMP_(ULONG) CShellExtCMenu::AddRef()
-{
- ThgCriticalSection cs(CShellExt::GetCriticalSection());
- return ++m_cRef;
-}
STDMETHODIMP_(ULONG) CShellExtOverlay::Release()
@@ -250,12 +203,3 @@ delete this;
return 0L;
}
-
-STDMETHODIMP_(ULONG) CShellExtCMenu::Release()
-{
- ThgCriticalSection cs(CShellExt::GetCriticalSection());
- if(--m_cRef)
- return m_cRef;
- delete this;
- return 0L;
-}
|
Loading...