From d2c91898a866006be4bd56b00e5cd36112ca5e06 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Tue, 22 Mar 2016 15:11:48 +0000 Subject: dbx_lmdb: some fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@16522 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dbx_mdb/src/dbintf.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'plugins/Dbx_mdb/src/dbintf.cpp') 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; -- cgit v1.2.3