From d84c40216b5e60224eb365f633b5f142d459fc9e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 25 Feb 2014 19:51:01 +0000 Subject: merge from branch git-svn-id: http://svn.miranda-ng.org/main/trunk@8274 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbheaders.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'plugins/Db3x_mmap/src/dbheaders.cpp') diff --git a/plugins/Db3x_mmap/src/dbheaders.cpp b/plugins/Db3x_mmap/src/dbheaders.cpp index de8ce57bac..102fd56fac 100644 --- a/plugins/Db3x_mmap/src/dbheaders.cpp +++ b/plugins/Db3x_mmap/src/dbheaders.cpp @@ -31,12 +31,12 @@ int CDb3Mmap::CreateDbHeaders(const DBSignature& _sign) CopyMemory(m_dbHeader.signature, &_sign, sizeof(m_dbHeader.signature)); - m_dbHeader.version = DB_095_VERSION; + m_dbHeader.version = DB_095_1_VERSION; m_dbHeader.ofsFileEnd = sizeof(struct DBHeader); m_dbHeader.slackSpace = 0; m_dbHeader.contactCount = 0; m_dbHeader.ofsFirstContact = 0; - m_dbHeader.ofsFirstModuleName = 0; + m_dbHeader.ofsModuleNames = 0; m_dbHeader.ofsUser = 0; //create user m_dbHeader.ofsUser = m_dbHeader.ofsFileEnd; @@ -59,8 +59,15 @@ int CDb3Mmap::CheckDbHeaders() memcmp(m_dbHeader.signature, &dbSignatureIM, sizeof(m_dbHeader.signature))) return EGROKPRF_UNKHEADER; - if (m_dbHeader.version != DB_095_VERSION && m_dbHeader.version != DB_094_VERSION && m_dbHeader.version != DB_OLD_VERSION) + switch (m_dbHeader.version) { + case DB_095_1_VERSION: + case DB_095_VERSION: + case DB_094_VERSION: + case DB_OLD_VERSION: + break; + default: return EGROKPRF_VERNEWER; + } if (m_dbHeader.ofsUser == 0) return EGROKPRF_DAMAGED; @@ -72,4 +79,4 @@ void CDb3Mmap::WriteSignature(DBSignature &sign) { memcpy(&m_dbHeader.signature, &sign, sizeof(DBSignature)); DBWrite(0, &sign, sizeof(DBSignature)); -} \ No newline at end of file +} -- cgit v1.2.3