diff options
Diffstat (limited to 'plugins/Db3x_mmap')
-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);
|