From b5367ea79446f2b3158650ce999779da20ea44cb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 27 Jan 2014 14:05:47 +0000 Subject: dbx_mmap to open unencrypted mmap_sa profiles git-svn-id: http://svn.miranda-ng.org/main/trunk@7916 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbintfm.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'plugins/Db3x_mmap') diff --git a/plugins/Db3x_mmap/src/dbintfm.cpp b/plugins/Db3x_mmap/src/dbintfm.cpp index 83d113e70c..0af9c6d79a 100644 --- a/plugins/Db3x_mmap/src/dbintfm.cpp +++ b/plugins/Db3x_mmap/src/dbintfm.cpp @@ -39,10 +39,17 @@ CDb3Mmap::~CDb3Mmap() int CDb3Mmap::Load(bool bSkipInit) { int res = CDb3Base::Load(bSkipInit); - if (!res && !bSkipInit) - if (InitCrypt()) return 1; + if (res) + return res; + + if (!memcmp(&m_dbHeader.signature, &dbSignatureSA, sizeof(m_dbHeader.signature))) + memcpy(&m_dbHeader.signature, &dbSignatureIM, sizeof(m_dbHeader.signature)); - return res; + if (!bSkipInit) + if (InitCrypt()) + return EGROKPRF_CANTREAD; + + return ERROR_SUCCESS; } int CDb3Mmap::PrepareCheck() -- cgit v1.2.3