summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Db3x_mmap')
-rw-r--r--plugins/Db3x_mmap/src/dbintf.h2
-rw-r--r--plugins/Db3x_mmap/src/dbsettings.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h
index e77658767e..2aa1ceea73 100644
--- a/plugins/Db3x_mmap/src/dbintf.h
+++ b/plugins/Db3x_mmap/src/dbintf.h
@@ -206,6 +206,8 @@ protected:
protected:
virtual DWORD GetSettingsGroupOfsByModuleNameOfs(DBContact *dbc,DWORD ofsContact,DWORD ofsModuleName) = 0;
+ virtual void InvalidateSettingsGroupOfsCacheEntry(DWORD ofsSettingsGroup) {}
+
virtual void DBMoveChunk(DWORD ofsDest, DWORD ofsSource, int bytes) = 0;
virtual PBYTE DBRead(DWORD ofs, int bytesRequired, int *bytesAvail) = 0;
virtual void DBWrite(DWORD ofs, PVOID pData, int bytes) = 0;
diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp
index 4f3a2e5516..4a92bf7d4a 100644
--- a/plugins/Db3x_mmap/src/dbsettings.cpp
+++ b/plugins/Db3x_mmap/src/dbsettings.cpp
@@ -612,7 +612,7 @@ STDMETHODIMP_(BOOL) CDb3Base::WriteContactSetting(HANDLE hContact, DBCONTACTWRIT
//make sure the module group exists
ofsSettingsGroup = GetSettingsGroupOfsByModuleNameOfs(&dbc,ofsContact,ofsModuleName);
if (ofsSettingsGroup == 0) { //module group didn't exist - make it
- if (tmp.value.type&DBVTF_VARIABLELENGTH) {
+ if (tmp.value.type & DBVTF_VARIABLELENGTH) {
if (tmp.value.type == DBVT_ASCIIZ || tmp.value.type == DBVT_UTF8) bytesRequired = (int)strlen(tmp.value.pszVal)+2;
else if (tmp.value.type == DBVT_BLOB) bytesRequired = tmp.value.cpbVal+2;
}
@@ -705,6 +705,7 @@ STDMETHODIMP_(BOOL) CDb3Base::WriteContactSetting(HANDLE hContact, DBCONTACTWRIT
DBContactSettings *dbcsPrev;
DWORD ofsDbcsPrev,ofsNew;
+ InvalidateSettingsGroupOfsCacheEntry(ofsSettingsGroup);
bytesRequired += (DB_SETTINGS_RESIZE_GRANULARITY-(bytesRequired%DB_SETTINGS_RESIZE_GRANULARITY))%DB_SETTINGS_RESIZE_GRANULARITY;
//find previous group to change its offset
ofsDbcsPrev = dbc.ofsFirstSettings;