summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-11-21 13:25:26 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-11-21 13:25:26 +0000
commitb3003cc96456a60832e0a90b7ed6b847ea8b833b (patch)
treec0d06d2a1f1ff917cb78d77894eadf3df5041228 /plugins/Db3x_mmap
parent771a25d5bb880bb235a1ba188dc0fd8782a4a2f6 (diff)
more correct form of dividing mmap & mmap_sa
git-svn-id: http://svn.miranda-ng.org/main/trunk@6953 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap')
-rw-r--r--plugins/Db3x_mmap/src/dbcache.cpp12
-rw-r--r--plugins/Db3x_mmap/src/dbintf.cpp9
-rw-r--r--plugins/Db3x_mmap/src/dbintf.h4
3 files changed, 23 insertions, 2 deletions
diff --git a/plugins/Db3x_mmap/src/dbcache.cpp b/plugins/Db3x_mmap/src/dbcache.cpp
index 8862c7192f..8fb1910caf 100644
--- a/plugins/Db3x_mmap/src/dbcache.cpp
+++ b/plugins/Db3x_mmap/src/dbcache.cpp
@@ -23,6 +23,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "commonheaders.h"
+int CDb3Mmap::Load(bool bSkipInit)
+{
+ int res = CDb3Base::Load(bSkipInit);
+ if (res != ERROR_SUCCESS)
+ return res;
+
+ if (!bSkipInit)
+ return InitCrypt();
+
+ return 0;
+}
+
void CDb3Mmap::Map()
{
m_hMap = CreateFileMapping(m_hDbFile, NULL, PAGE_READWRITE, 0, m_dwFileSize, NULL);
diff --git a/plugins/Db3x_mmap/src/dbintf.cpp b/plugins/Db3x_mmap/src/dbintf.cpp
index caaa1e5a74..c4b7732b9f 100644
--- a/plugins/Db3x_mmap/src/dbintf.cpp
+++ b/plugins/Db3x_mmap/src/dbintf.cpp
@@ -91,6 +91,14 @@ CDb3Base::~CDb3Base()
}
CloseHandle(m_hDbFile);
+ DestroyHookableEvent(hContactDeletedEvent);
+ DestroyHookableEvent(hContactAddedEvent);
+ DestroyHookableEvent(hSettingChangeEvent);
+
+ DestroyHookableEvent(hEventAddedEvent);
+ DestroyHookableEvent(hEventDeletedEvent);
+ DestroyHookableEvent(hEventFilterAddedEvent);
+
DeleteCriticalSection(&m_csDbAccess);
DestroyDbInstance(this);
@@ -117,7 +125,6 @@ int CDb3Base::Load(bool bSkipInit)
if ( !bSkipInit) {
if (InitCache()) return 1;
if (InitModuleNames()) return 1;
- if (InitCrypt()) return 1;
m_bReadOnly = false;
diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h
index 80f1d32790..de26d64923 100644
--- a/plugins/Db3x_mmap/src/dbintf.h
+++ b/plugins/Db3x_mmap/src/dbintf.h
@@ -301,6 +301,8 @@ struct CDb3Mmap : public CDb3Base
CDb3Mmap(const TCHAR* ptszFileName);
~CDb3Mmap();
+ int Load(bool bSkipInit);
+
protected:
virtual DWORD GetSettingsGroupOfsByModuleNameOfs(DBContact *dbc,DWORD ofsContact,DWORD ofsModuleName);
virtual void DBMoveChunk(DWORD ofsDest, DWORD ofsSource, int bytes);
@@ -311,7 +313,7 @@ protected:
virtual int InitCache(void);
protected:
- PBYTE m_pNull;
+ PBYTE m_pNull;
void Map();
void ReMap(DWORD needed);