diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-06 16:27:44 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-06 16:27:44 +0000 |
commit | f6d53c90114069402b549aa7c0bc79044aace51d (patch) | |
tree | e6cd03b492df84a43c231b76dec0771fc9eba60a /plugins/Db3x_mmap/src/dbintf.h | |
parent | 4f39e22aface0cb33d36532151b54a5e3950f629 (diff) |
huh, finally: total database encryption, including histories
git-svn-id: http://svn.miranda-ng.org/main/trunk@7522 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src/dbintf.h')
-rw-r--r-- | plugins/Db3x_mmap/src/dbintf.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h index eb0b67535f..3e76d9a49a 100644 --- a/plugins/Db3x_mmap/src/dbintf.h +++ b/plugins/Db3x_mmap/src/dbintf.h @@ -54,6 +54,16 @@ DBHeader #define DBVT_ENCRYPTED 250
+#define NeedBytes(n) if (bytesRemaining<(n)) pBlob = (PBYTE)DBRead(ofsBlobPtr,(n),&bytesRemaining)
+#define MoveAlong(n) {int x = n; pBlob += (x); ofsBlobPtr += (x); bytesRemaining -= (x);}
+
+DWORD __forceinline GetSettingValueLength(PBYTE pSetting)
+{
+ if (pSetting[0] & DBVTF_VARIABLELENGTH)
+ return 2 + *(PWORD)(pSetting + 1);
+ return pSetting[0];
+}
+
struct DBSignature
{
char name[15];
@@ -142,8 +152,6 @@ struct DBEvent #include <poppack.h>
-#define MAXCACHEDREADSIZE 65536
-
struct CDb3Base : public MIDatabase, public MIDatabaseChecker, public MZeroedObject
{
CDb3Base(const TCHAR* tszFileName);
@@ -318,6 +326,7 @@ struct CDb3Mmap : public CDb3Base int Load(bool bSkipInit);
+ void ToggleEncryption(void);
void StoreKey(void);
void SetPassword(const TCHAR *ptszPassword);
void UpdateMenuItem(void);
@@ -326,6 +335,8 @@ struct CDb3Mmap : public CDb3Base protected:
int InitCrypt(void);
+ void ToggleEventsEncryption(HANDLE hContact);
+ void ToggleSettingsEncryption(HANDLE hContact);
protected:
void InitDialogs();
|