From 64579d553e4089d55c136140bd0058696d2cf526 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 8 Jan 2021 14:54:51 +0300 Subject: another bunch of duplicate code moved to the core --- plugins/Dbx_sqlite/src/dbcrypt.cpp | 11 +++++++++++ plugins/Dbx_sqlite/src/dbintf.h | 2 ++ plugins/Dbx_sqlite/src/stdafx.h | 5 ++--- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 plugins/Dbx_sqlite/src/dbcrypt.cpp (limited to 'plugins/Dbx_sqlite/src') diff --git a/plugins/Dbx_sqlite/src/dbcrypt.cpp b/plugins/Dbx_sqlite/src/dbcrypt.cpp new file mode 100644 index 0000000000..f0dca5a0bc --- /dev/null +++ b/plugins/Dbx_sqlite/src/dbcrypt.cpp @@ -0,0 +1,11 @@ +#include "stdafx.h" + +STDMETHODIMP_(BOOL) CDbxSQLite::StoreProvider(CRYPTO_PROVIDER *pProvider) +{ + DBCONTACTWRITESETTING dbcws = { "CryptoEngine", "Provider" }; + dbcws.value.type = DBVT_BLOB; + dbcws.value.pbVal = (PBYTE)pProvider->pszName; + dbcws.value.cpbVal = (WORD)mir_strlen(pProvider->pszName) + 1; + WriteContactSetting(0, &dbcws); + return TRUE; +} diff --git a/plugins/Dbx_sqlite/src/dbintf.h b/plugins/Dbx_sqlite/src/dbintf.h index 9fb06f84d8..ca220289c0 100755 --- a/plugins/Dbx_sqlite/src/dbintf.h +++ b/plugins/Dbx_sqlite/src/dbintf.h @@ -91,6 +91,8 @@ public: STDMETHODIMP_(BOOL) EnumModuleNames(DBMODULEENUMPROC pFunc, void *pParam) override; + STDMETHODIMP_(BOOL) StoreProvider(CRYPTO_PROVIDER*); + STDMETHODIMP_(BOOL) WriteContactSettingWorker(MCONTACT contactID, DBCONTACTWRITESETTING &dbcws) override; STDMETHODIMP_(BOOL) DeleteContactSetting(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting) override; STDMETHODIMP_(BOOL) EnumContactSettings(MCONTACT hContact, DBSETTINGENUMPROC pfnEnumProc, const char *szModule, void *param) override; diff --git a/plugins/Dbx_sqlite/src/stdafx.h b/plugins/Dbx_sqlite/src/stdafx.h index d1cbb5ec17..edeed11711 100644 --- a/plugins/Dbx_sqlite/src/stdafx.h +++ b/plugins/Dbx_sqlite/src/stdafx.h @@ -6,12 +6,11 @@ #include #include -#include #include #include -#include -#include +#include +#include #include #include #include -- cgit v1.2.3