summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb/src/dbintf.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-03-22 15:11:48 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-03-22 15:11:48 +0000
commitd2c91898a866006be4bd56b00e5cd36112ca5e06 (patch)
tree614d9d17e05739433fdbe68d247c5f199cdba019 /plugins/Dbx_mdb/src/dbintf.cpp
parentce1bf81b56ff2dad89b1f783d6377b20eebea0a4 (diff)
dbx_lmdb: some fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@16522 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb/src/dbintf.cpp')
-rw-r--r--plugins/Dbx_mdb/src/dbintf.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/Dbx_mdb/src/dbintf.cpp b/plugins/Dbx_mdb/src/dbintf.cpp
index bd9a39d64c..e129bbd600 100644
--- a/plugins/Dbx_mdb/src/dbintf.cpp
+++ b/plugins/Dbx_mdb/src/dbintf.cpp
@@ -47,6 +47,7 @@ CDbxMdb::CDbxMdb(const TCHAR *tszFileName, int iMode) :
mdb_env_create(&m_pMdbEnv);
mdb_env_set_maxdbs(m_pMdbEnv, 10);
+ mdb_env_set_userctx(m_pMdbEnv, this);
m_codePage = Langpack_GetDefaultCodePage();
m_hModHeap = HeapCreate(0, 0, 0);
@@ -209,7 +210,7 @@ bool CDbxMdb::Map()
m_dwFileSize += 0x100000;
mdb_env_set_mapsize(m_pMdbEnv, m_dwFileSize);
- unsigned int mode = MDB_NOSYNC | MDB_NOSUBDIR | MDB_NOLOCK; // nolock - miranda using m_csDbAccess lock
+ unsigned int mode = MDB_NOSYNC | MDB_NOSUBDIR | MDB_NOLOCK;
// if (m_bReadOnly)
// mode |= MDB_RDONLY;
// else
@@ -246,6 +247,12 @@ EXTERN_C void __cdecl dbpanic(void *)
TerminateProcess(GetCurrentProcess(), 255);
}
+
+EXTERN_C void LMDB_FailAssert(void *p, const char *text)
+{
+ ((CDbxMdb*)p)->DatabaseCorruption(_A2T(text));
+}
+
void CDbxMdb::DatabaseCorruption(const TCHAR *text)
{
int kill = 0;