diff options
author | George Hazan <george.hazan@gmail.com> | 2013-11-22 22:23:21 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-11-22 22:23:21 +0000 |
commit | b7eb87730aeff6ddfe09c7786db229a06818b886 (patch) | |
tree | cccff70b6713035ac0270956f9283f5d5b4bb141 | |
parent | 83f5aeeff8b6ac9cdcfa668ef9d98f23cbd7846c (diff) |
dbx_mmap to open unencrypted mmap_sa profiles
git-svn-id: http://svn.miranda-ng.org/main/trunk@6962 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/Db3x_mmap/src/commonheaders.h | 2 | ||||
-rw-r--r-- | plugins/Db3x_mmap/src/dbheaders.cpp | 3 | ||||
-rw-r--r-- | plugins/Db3x_mmap/src/dbintf.cpp | 5 |
3 files changed, 6 insertions, 4 deletions
diff --git a/plugins/Db3x_mmap/src/commonheaders.h b/plugins/Db3x_mmap/src/commonheaders.h index 12286e83d6..811535f4d2 100644 --- a/plugins/Db3x_mmap/src/commonheaders.h +++ b/plugins/Db3x_mmap/src/commonheaders.h @@ -42,7 +42,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "version.h"
extern LIST<CDb3Mmap> g_Dbs;
-extern DBSignature dbSignature;
+extern DBSignature dbSignature, dbSignatureSA;
#ifdef __GNUC__
#define mir_i64(x) (x##LL)
diff --git a/plugins/Db3x_mmap/src/dbheaders.cpp b/plugins/Db3x_mmap/src/dbheaders.cpp index 3e070e9ffd..2a703a97d3 100644 --- a/plugins/Db3x_mmap/src/dbheaders.cpp +++ b/plugins/Db3x_mmap/src/dbheaders.cpp @@ -54,7 +54,8 @@ int CDb3Base::CreateDbHeaders(const DBSignature& _sign) int CDb3Base::CheckDbHeaders()
{
- if (memcmp(m_dbHeader.signature, &dbSignature, sizeof(m_dbHeader.signature)))
+ if (memcmp(m_dbHeader.signature, &dbSignature, sizeof(m_dbHeader.signature)) &&
+ memcmp(m_dbHeader.signature, &dbSignatureSA, sizeof(m_dbHeader.signature)))
return EGROKPRF_UNKHEADER;
if (m_dbHeader.version != DB_THIS_VERSION)
diff --git a/plugins/Db3x_mmap/src/dbintf.cpp b/plugins/Db3x_mmap/src/dbintf.cpp index 394904b8b2..77df014472 100644 --- a/plugins/Db3x_mmap/src/dbintf.cpp +++ b/plugins/Db3x_mmap/src/dbintf.cpp @@ -23,7 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h"
-DBSignature dbSignature = {"Miranda ICQ DB",0x1A};
+DBSignature dbSignature = { "Miranda ICQ DB", 0x1A };
+DBSignature dbSignatureSA = { "Miranda ICQ SA", 0x1A };
static int ModCompare(const ModuleName *mn1, const ModuleName *mn2 )
{
@@ -87,7 +88,7 @@ CDb3Base::~CDb3Base() if (!m_bReadOnly) {
DWORD bytesWritten;
SetFilePointer(m_hDbFile, 0, NULL, FILE_BEGIN);
- WriteFile(m_hDbFile, &dbSignature, 1, &bytesWritten, NULL);
+ WriteFile(m_hDbFile, &dbSignature, sizeof(dbSignature), &bytesWritten, NULL);
}
CloseHandle(m_hDbFile);
|