diff options
author | George Hazan <george.hazan@gmail.com> | 2012-09-28 13:13:05 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-09-28 13:13:05 +0000 |
commit | f3cdb7545b85a2c849ad4acf4dfbf1aaf526de6b (patch) | |
tree | 3d56bd83ddcb79373e868f0b9b0378472ffa1905 /plugins/Dbx_mmap_SA | |
parent | 8adf6be866f0c4dbc2689489b04a2aba243cb650 (diff) |
database created by dbx_mmap_sa must be opened by it
git-svn-id: http://svn.miranda-ng.org/main/trunk@1714 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mmap_SA')
-rw-r--r-- | plugins/Dbx_mmap_SA/src/commonheaders.h | 2 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/src/dbintf_sa.cpp | 3 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/src/init.cpp | 2 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/src/security.cpp | 2 |
4 files changed, 6 insertions, 3 deletions
diff --git a/plugins/Dbx_mmap_SA/src/commonheaders.h b/plugins/Dbx_mmap_SA/src/commonheaders.h index 710172c241..6f4aa0b4b3 100644 --- a/plugins/Dbx_mmap_SA/src/commonheaders.h +++ b/plugins/Dbx_mmap_SA/src/commonheaders.h @@ -86,7 +86,7 @@ INT_PTR CALLBACK DlgStdNewPass(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam) INT_PTR CALLBACK DlgChangePass(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam);
void xModifyMenu(HANDLE hMenu,long flags,const TCHAR* name, HICON hIcon);
-extern DBSignature dbSignature, dbSignatureSecured;
+extern DBSignature dbSignature, dbSignatureSecured, dbSignatureNonSecured;
extern LIST<CDdxMmapSA> g_Dbs;
diff --git a/plugins/Dbx_mmap_SA/src/dbintf_sa.cpp b/plugins/Dbx_mmap_SA/src/dbintf_sa.cpp index f3c68881a5..b7dec7c908 100644 --- a/plugins/Dbx_mmap_SA/src/dbintf_sa.cpp +++ b/plugins/Dbx_mmap_SA/src/dbintf_sa.cpp @@ -32,6 +32,7 @@ extern CDdxMmapSA* g_Db; int InitDialogs(void);
DBSignature dbSignatureSecured = {"Miranda ICQ SD",0x1A};
+DBSignature dbSignatureNonSecured = {"Miranda ICQ SA",0x1A};
CDdxMmapSA::CDdxMmapSA(const TCHAR* tszFileName) :
CDb3Mmap(tszFileName)
@@ -65,6 +66,8 @@ int CDdxMmapSA::CheckDbHeaders() {
if ( memcmp(m_dbHeader.signature, &dbSignatureSecured, sizeof(m_dbHeader.signature)) == 0)
m_bEncoding = true;
+ else if ( memcmp(m_dbHeader.signature, &dbSignatureNonSecured, sizeof(m_dbHeader.signature)) == 0)
+ m_bEncoding = false;
else {
m_bEncoding = false;
if ( memcmp(m_dbHeader.signature,&dbSignature,sizeof(m_dbHeader.signature)))
diff --git a/plugins/Dbx_mmap_SA/src/init.cpp b/plugins/Dbx_mmap_SA/src/init.cpp index cea82f5c79..77bf5dc953 100644 --- a/plugins/Dbx_mmap_SA/src/init.cpp +++ b/plugins/Dbx_mmap_SA/src/init.cpp @@ -53,7 +53,7 @@ static int makeDatabase(const TCHAR *profile) {
std::auto_ptr<CDdxMmapSA> db( new CDdxMmapSA(profile));
if (db->Create() == ERROR_SUCCESS) {
- db->CreateDbHeaders();
+ db->CreateDbHeaders(dbSignatureNonSecured);
return 0;
}
diff --git a/plugins/Dbx_mmap_SA/src/security.cpp b/plugins/Dbx_mmap_SA/src/security.cpp index 8731e86f81..260ab11727 100644 --- a/plugins/Dbx_mmap_SA/src/security.cpp +++ b/plugins/Dbx_mmap_SA/src/security.cpp @@ -233,7 +233,7 @@ void CDdxMmapSA::WritePlainHeader() {
DWORD bytesWritten;
- memcpy(m_dbHeader.signature, &dbSignature, sizeof(m_dbHeader.signature));
+ memcpy(m_dbHeader.signature, &dbSignatureNonSecured, sizeof(m_dbHeader.signature));
SetFilePointer(m_hDbFile,0,NULL,FILE_BEGIN);
WriteFile(m_hDbFile,m_dbHeader.signature,sizeof(m_dbHeader.signature),&bytesWritten,NULL);
|