From 35a2b1771115068077ce6db13860766e70405de1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 12 Apr 2018 18:34:27 +0300 Subject: MIDatabase became pure interface --- plugins/Dbx_mdbx/src/init.cpp | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'plugins/Dbx_mdbx') diff --git a/plugins/Dbx_mdbx/src/init.cpp b/plugins/Dbx_mdbx/src/init.cpp index f90995b02c..6efe170cb5 100644 --- a/plugins/Dbx_mdbx/src/init.cpp +++ b/plugins/Dbx_mdbx/src/init.cpp @@ -25,8 +25,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. EXTERN_C void NTAPI tls_callback(PVOID module, DWORD reason, PVOID reserved); +HINSTANCE g_hInst = nullptr; int hLangpack; +BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD reason, LPVOID reserved) +{ + g_hInst = hInstDLL; + tls_callback(hInstDLL, reason, reserved); + return TRUE; +} + +///////////////////////////////////////////////////////////////////////////////////////// + static PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), @@ -41,7 +51,13 @@ static PLUGININFOEX pluginInfo = { 0x7c3d0a33, 0x2646, 0x4001, { 0x91, 0x7, 0xf3, 0x5e, 0xa2, 0x99, 0xd2, 0x92 } } }; -HINSTANCE g_hInst = nullptr; + +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +{ + return &pluginInfo; +} + +extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_DATABASE, MIID_LAST }; ///////////////////////////////////////////////////////////////////////////////////////// @@ -60,7 +76,7 @@ static int grokHeader(const TCHAR *profile) } // returns 0 if all the APIs are injected otherwise, 1 -static MDatabaseCommon* LoadDatabase(const TCHAR *profile, BOOL bReadOnly) +static MDatabaseCommon* loadDatabase(const TCHAR *profile, BOOL bReadOnly) { // set the memory, lists & UTF8 manager mir_getLP(&pluginInfo); @@ -82,32 +98,18 @@ static DATABASELINK dblink = L"MDBX database driver", makeDatabase, grokHeader, - LoadDatabase + loadDatabase }; -///////////////////////////////////////////////////////////////////////////////////////// - -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) -{ - return &pluginInfo; -} - -extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_DATABASE, MIID_LAST }; - extern "C" __declspec(dllexport) int Load(void) { RegisterDatabasePlugin(&dblink); return 0; } +///////////////////////////////////////////////////////////////////////////////////////// + extern "C" __declspec(dllexport) int Unload(void) { return 0; } - -BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD reason, LPVOID reserved) -{ - g_hInst = hInstDLL; - tls_callback(hInstDLL, reason, reserved); - return TRUE; -} -- cgit v1.2.3