diff options
Diffstat (limited to 'plugins/Db3x_mmap/src')
-rw-r--r-- | plugins/Db3x_mmap/src/dbcrypt.cpp | 9 | ||||
-rw-r--r-- | plugins/Db3x_mmap/src/dbsettings.cpp | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/plugins/Db3x_mmap/src/dbcrypt.cpp b/plugins/Db3x_mmap/src/dbcrypt.cpp index 8af1b93b2f..84b66402e3 100644 --- a/plugins/Db3x_mmap/src/dbcrypt.cpp +++ b/plugins/Db3x_mmap/src/dbcrypt.cpp @@ -132,7 +132,7 @@ int CDb3Mmap::InitCrypt() CRYPTO_PROVIDER *pProvider;
DBVARIANT dbv = { 0 };
- dbv.type = DBVT_ASCIIZ;
+ dbv.type = DBVT_BLOB;
DBCONTACTGETSETTING dbcgs = { "CryptoEngine", "Provider", &dbv };
if (GetContactSettingStr(NULL, &dbcgs)) {
LBL_CreateProvider:
@@ -145,12 +145,13 @@ LBL_CreateProvider: pProvider = ppProvs[0]; //!!!!!!!!!!!!!!!!!!
DBCONTACTWRITESETTING dbcws = { "CryptoEngine", "Provider" };
- dbcws.value.type = DBVT_ASCIIZ;
- dbcws.value.pszVal = pProvider->pszName;
+ dbcws.value.type = DBVT_BLOB;
+ dbcws.value.pbVal = (PBYTE)pProvider->pszName;
+ dbcws.value.cpbVal = (int)strlen(pProvider->pszName)+1;
WriteContactSetting(NULL, &dbcws);
}
else {
- pProvider = Crypto_GetProvider(dbv.pszVal);
+ pProvider = Crypto_GetProvider(LPCSTR(dbv.pbVal));
FreeVariant(&dbv);
if (pProvider == NULL)
goto LBL_CreateProvider;
diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp index 29e92eb393..18d14fa7ab 100644 --- a/plugins/Db3x_mmap/src/dbsettings.cpp +++ b/plugins/Db3x_mmap/src/dbsettings.cpp @@ -357,7 +357,7 @@ STDMETHODIMP_(BOOL) CDb3Base::SetSettingResident(BOOL bIsResident, const char *p STDMETHODIMP_(BOOL) CDb3Base::WriteContactSetting(HANDLE hContact, DBCONTACTWRITESETTING *dbcws)
{
- if (dbcws == NULL || dbcws->szSetting == NULL || dbcws->szModule == NULL)
+ if (dbcws == NULL || dbcws->szSetting == NULL || dbcws->szModule == NULL || m_bReadOnly)
return 1;
// the db format can't tolerate more than 255 bytes of space (incl. null) for settings+module name
|