summaryrefslogtreecommitdiff
path: root/plugins/Dbx_sqlite
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-01-08 14:54:51 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-01-08 14:54:51 +0300
commit64579d553e4089d55c136140bd0058696d2cf526 (patch)
tree7b7e6c5cd03b9060bd7080b5981938005436b432 /plugins/Dbx_sqlite
parentdae0d079ad629d499034ff911e0b1a807c19fce0 (diff)
another bunch of duplicate code moved to the core
Diffstat (limited to 'plugins/Dbx_sqlite')
-rw-r--r--plugins/Dbx_sqlite/dbx_sqlite.vcxproj1
-rw-r--r--plugins/Dbx_sqlite/dbx_sqlite.vcxproj.filters3
-rw-r--r--plugins/Dbx_sqlite/res/dbx_sqlite.rc46
-rw-r--r--plugins/Dbx_sqlite/src/dbcrypt.cpp11
-rwxr-xr-xplugins/Dbx_sqlite/src/dbintf.h2
-rw-r--r--plugins/Dbx_sqlite/src/stdafx.h5
6 files changed, 19 insertions, 49 deletions
diff --git a/plugins/Dbx_sqlite/dbx_sqlite.vcxproj b/plugins/Dbx_sqlite/dbx_sqlite.vcxproj
index 3cfd971be6..ef4e8a8b49 100644
--- a/plugins/Dbx_sqlite/dbx_sqlite.vcxproj
+++ b/plugins/Dbx_sqlite/dbx_sqlite.vcxproj
@@ -32,6 +32,7 @@
</ImportGroup>
<ItemGroup>
<ClCompile Include="src\dbcontacts.cpp" />
+ <ClCompile Include="src\dbcrypt.cpp" />
<ClCompile Include="src\dbevents.cpp" />
<ClCompile Include="src\dbintf.cpp" />
<ClCompile Include="src\dbsettings.cpp" />
diff --git a/plugins/Dbx_sqlite/dbx_sqlite.vcxproj.filters b/plugins/Dbx_sqlite/dbx_sqlite.vcxproj.filters
index e1d6d3b7b0..cda2246184 100644
--- a/plugins/Dbx_sqlite/dbx_sqlite.vcxproj.filters
+++ b/plugins/Dbx_sqlite/dbx_sqlite.vcxproj.filters
@@ -20,6 +20,9 @@
<ClCompile Include="src\stdafx.cxx">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\dbcrypt.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\dbintf.h">
diff --git a/plugins/Dbx_sqlite/res/dbx_sqlite.rc b/plugins/Dbx_sqlite/res/dbx_sqlite.rc
index 94f7d5811b..141e211876 100644
--- a/plugins/Dbx_sqlite/res/dbx_sqlite.rc
+++ b/plugins/Dbx_sqlite/res/dbx_sqlite.rc
@@ -12,52 +12,6 @@
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
-// Русский (Россия) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
-LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
-#pragma code_page(1251)
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_SELECT_CRYPTOPROVIDER DIALOGEX 0, 0, 229, 76
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Select crypto provider"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- DEFPUSHBUTTON "OK",IDOK,113,55,50,14
- PUSHBUTTON "Cancel",IDCANCEL,172,55,50,14
- COMBOBOX IDC_SELECTCRYPT_COMBO,16,14,199,30,CBS_DROPDOWNLIST,WS_EX_WINDOWEDGE | WS_EX_CONTROLPARENT
- LTEXT "",IDC_CRYPTOPROVIDER_DESCR,18,34,197,14,NOT WS_GROUP
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_SELECT_CRYPTOPROVIDER, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 222
- TOPMARGIN, 7
- BOTTOMMARGIN, 69
- END
-END
-#endif // APSTUDIO_INVOKED
-
-#endif // Русский (Россия) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
// Английский (США) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
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 <memory>
#include <malloc.h>
-#include <newpluginapi.h>
#include <win2k.h>
#include <assert.h>
-#include <m_core.h>
-#include <m_system.h>
+#include <newpluginapi.h>
+#include <m_crypto.h>
#include <m_database.h>
#include <m_protocols.h>
#include <m_metacontacts.h>