summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-28 14:29:31 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-28 14:29:31 +0300
commita905c9c3f92fd54f37a5466649ac378db69e7cb0 (patch)
tree87a60dadfbf9fd8d916ea9100c26b6e314293242 /src
parentd75fed3bfc9c252f5d20b889e0bec95fb0a4527e (diff)
all protocols rewritten to CMPluginBase
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/CMPluginBase.cpp21
-rw-r--r--src/mir_app/src/mir_app.def69
-rw-r--r--src/mir_app/src/mir_app64.def69
3 files changed, 86 insertions, 73 deletions
diff --git a/src/mir_app/src/CMPluginBase.cpp b/src/mir_app/src/CMPluginBase.cpp
index a6dad00e44..8a17a6ac8e 100644
--- a/src/mir_app/src/CMPluginBase.cpp
+++ b/src/mir_app/src/CMPluginBase.cpp
@@ -24,12 +24,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-CMPlugin::CMPlugin(const char *moduleName) :
+CMPluginBase::CMPluginBase(const char *moduleName) :
m_szModuleName(moduleName)
{
}
-CMPlugin::~CMPlugin()
+CMPluginBase::~CMPluginBase()
{
if (m_hLogger) {
mir_closeLog(m_hLogger);
@@ -37,14 +37,14 @@ CMPlugin::~CMPlugin()
}
}
-void CMPlugin::tryOpenLog()
+void CMPluginBase::tryOpenLog()
{
wchar_t path[MAX_PATH];
mir_snwprintf(path, L"%s\\%s.txt", VARSW(L"%miranda_logpath%"), m_szModuleName);
m_hLogger = mir_createLog(m_szModuleName, nullptr, path, 0);
}
-void CMPlugin::debugLogA(LPCSTR szFormat, ...)
+void CMPluginBase::debugLogA(LPCSTR szFormat, ...)
{
if (m_hLogger == nullptr)
tryOpenLog();
@@ -55,7 +55,7 @@ void CMPlugin::debugLogA(LPCSTR szFormat, ...)
va_end(args);
}
-void CMPlugin::debugLogW(LPCWSTR wszFormat, ...)
+void CMPluginBase::debugLogW(LPCWSTR wszFormat, ...)
{
if (m_hLogger == nullptr)
tryOpenLog();
@@ -65,3 +65,14 @@ void CMPlugin::debugLogW(LPCWSTR wszFormat, ...)
mir_writeLogVW(m_hLogger, wszFormat, args);
va_end(args);
}
+
+void CMPluginBase::RegisterProtocol(int type, pfnInitProto fnInit, pfnUninitProto fnUninit)
+{
+ PROTOCOLDESCRIPTOR pd = {};
+ pd.cbSize = (fnInit == nullptr) ? PROTOCOLDESCRIPTOR_V3_SIZE : sizeof(pd);
+ pd.szName = (char*)m_szModuleName;
+ pd.type = type;
+ pd.fnInit = fnInit;
+ pd.fnUninit = fnUninit;
+ Proto_RegisterModule(&pd);
+}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index da203dd583..97445ad173 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -492,37 +492,38 @@ GetDatabasePlugin @508
SetServiceModePlugin @510
Proto_CreateAccount @511
Proto_ActivateAccount @512
-??0CMPlugin@@IAE@PBD@Z @513 NONAME
-??1CMPlugin@@IAE@XZ @514 NONAME
-??4CMPlugin@@QAEAAV0@ABV0@@Z @515 NONAME
-?debugLogA@CMPlugin@@QAAXPBDZZ @516 NONAME
-?debugLogW@CMPlugin@@QAAXPB_WZZ @517 NONAME
-?delSetting@CMPlugin@@QAEHIPBD@Z @518 NONAME
-?delSetting@CMPlugin@@QAEHPBD@Z @519 NONAME
-?getBool@CMPlugin@@QAE_NIPBD_N@Z @520 NONAME
-?getBool@CMPlugin@@QAE_NPBD_N@Z @521 NONAME
-?getByte@CMPlugin@@QAEHIPBDE@Z @522 NONAME
-?getByte@CMPlugin@@QAEHPBDE@Z @523 NONAME
-?getDword@CMPlugin@@QAEKIPBDK@Z @524 NONAME
-?getDword@CMPlugin@@QAEKPBDK@Z @525 NONAME
-?getString@CMPlugin@@QAEHIPBDPAUDBVARIANT@@@Z @526 NONAME
-?getString@CMPlugin@@QAEHPBDPAUDBVARIANT@@@Z @527 NONAME
-?getStringA@CMPlugin@@QAEPADIPBD@Z @528 NONAME
-?getStringA@CMPlugin@@QAEPADPBD@Z @529 NONAME
-?getWString@CMPlugin@@QAEHIPBDPAUDBVARIANT@@@Z @530 NONAME
-?getWString@CMPlugin@@QAEHPBDPAUDBVARIANT@@@Z @531 NONAME
-?getWStringA@CMPlugin@@QAEPA_WIPBD@Z @532 NONAME
-?getWStringA@CMPlugin@@QAEPA_WPBD@Z @533 NONAME
-?getWord@CMPlugin@@QAEHIPBDG@Z @534 NONAME
-?getWord@CMPlugin@@QAEHPBDG@Z @535 NONAME
-?setByte@CMPlugin@@QAEXIPBDE@Z @536 NONAME
-?setByte@CMPlugin@@QAEXPBDE@Z @537 NONAME
-?setDword@CMPlugin@@QAEXIPBDK@Z @538 NONAME
-?setDword@CMPlugin@@QAEXPBDK@Z @539 NONAME
-?setString@CMPlugin@@QAEXIPBD0@Z @540 NONAME
-?setString@CMPlugin@@QAEXPBD0@Z @541 NONAME
-?setWString@CMPlugin@@QAEXIPBDPB_W@Z @542 NONAME
-?setWString@CMPlugin@@QAEXPBDPB_W@Z @543 NONAME
-?setWord@CMPlugin@@QAEXIPBDG@Z @544 NONAME
-?setWord@CMPlugin@@QAEXPBDG@Z @545 NONAME
-?tryOpenLog@CMPlugin@@AAEXXZ @546 NONAME
+??0CMPluginBase@@IAE@PBD@Z @513 NONAME
+??1CMPluginBase@@IAE@XZ @514 NONAME
+??4CMPluginBase@@QAEAAV0@ABV0@@Z @515 NONAME
+?debugLogA@CMPluginBase@@QAAXPBDZZ @516 NONAME
+?debugLogW@CMPluginBase@@QAAXPB_WZZ @517 NONAME
+?delSetting@CMPluginBase@@QAEHIPBD@Z @518 NONAME
+?delSetting@CMPluginBase@@QAEHPBD@Z @519 NONAME
+?getBool@CMPluginBase@@QAE_NIPBD_N@Z @520 NONAME
+?getBool@CMPluginBase@@QAE_NPBD_N@Z @521 NONAME
+?getByte@CMPluginBase@@QAEHIPBDE@Z @522 NONAME
+?getByte@CMPluginBase@@QAEHPBDE@Z @523 NONAME
+?getDword@CMPluginBase@@QAEKIPBDK@Z @524 NONAME
+?getDword@CMPluginBase@@QAEKPBDK@Z @525 NONAME
+?getString@CMPluginBase@@QAEHIPBDPAUDBVARIANT@@@Z @526 NONAME
+?getString@CMPluginBase@@QAEHPBDPAUDBVARIANT@@@Z @527 NONAME
+?getStringA@CMPluginBase@@QAEPADIPBD@Z @528 NONAME
+?getStringA@CMPluginBase@@QAEPADPBD@Z @529 NONAME
+?getWString@CMPluginBase@@QAEHIPBDPAUDBVARIANT@@@Z @530 NONAME
+?getWString@CMPluginBase@@QAEHPBDPAUDBVARIANT@@@Z @531 NONAME
+?getWStringA@CMPluginBase@@QAEPA_WIPBD@Z @532 NONAME
+?getWStringA@CMPluginBase@@QAEPA_WPBD@Z @533 NONAME
+?getWord@CMPluginBase@@QAEHIPBDG@Z @534 NONAME
+?getWord@CMPluginBase@@QAEHPBDG@Z @535 NONAME
+?setByte@CMPluginBase@@QAEXIPBDE@Z @536 NONAME
+?setByte@CMPluginBase@@QAEXPBDE@Z @537 NONAME
+?setDword@CMPluginBase@@QAEXIPBDK@Z @538 NONAME
+?setDword@CMPluginBase@@QAEXPBDK@Z @539 NONAME
+?setString@CMPluginBase@@QAEXIPBD0@Z @540 NONAME
+?setString@CMPluginBase@@QAEXPBD0@Z @541 NONAME
+?setWString@CMPluginBase@@QAEXIPBDPB_W@Z @542 NONAME
+?setWString@CMPluginBase@@QAEXPBDPB_W@Z @543 NONAME
+?setWord@CMPluginBase@@QAEXIPBDG@Z @544 NONAME
+?setWord@CMPluginBase@@QAEXPBDG@Z @545 NONAME
+?tryOpenLog@CMPluginBase@@AAEXXZ @546 NONAME
+?RegisterProtocol@CMPluginBase@@IAEXHP6APAUPROTO_INTERFACE@@PBDPB_W@ZP6AHPAU2@@Z@Z @547 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 012dd53097..fbc4904145 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -492,37 +492,38 @@ GetDatabasePlugin @508
SetServiceModePlugin @510
Proto_CreateAccount @511
Proto_ActivateAccount @512
-??0CMPlugin@@IEAA@PEBD@Z @513 NONAME
-??1CMPlugin@@IEAA@XZ @514 NONAME
-??4CMPlugin@@QEAAAEAV0@AEBV0@@Z @515 NONAME
-?debugLogA@CMPlugin@@QEAAXPEBDZZ @516 NONAME
-?debugLogW@CMPlugin@@QEAAXPEB_WZZ @517 NONAME
-?delSetting@CMPlugin@@QEAA_JIPEBD@Z @518 NONAME
-?delSetting@CMPlugin@@QEAA_JPEBD@Z @519 NONAME
-?getBool@CMPlugin@@QEAA_NIPEBD_N@Z @520 NONAME
-?getBool@CMPlugin@@QEAA_NPEBD_N@Z @521 NONAME
-?getByte@CMPlugin@@QEAAHIPEBDE@Z @522 NONAME
-?getByte@CMPlugin@@QEAAHPEBDE@Z @523 NONAME
-?getDword@CMPlugin@@QEAAKIPEBDK@Z @524 NONAME
-?getDword@CMPlugin@@QEAAKPEBDK@Z @525 NONAME
-?getString@CMPlugin@@QEAA_JIPEBDPEAUDBVARIANT@@@Z @526 NONAME
-?getString@CMPlugin@@QEAA_JPEBDPEAUDBVARIANT@@@Z @527 NONAME
-?getStringA@CMPlugin@@QEAAPEADIPEBD@Z @528 NONAME
-?getStringA@CMPlugin@@QEAAPEADPEBD@Z @529 NONAME
-?getWString@CMPlugin@@QEAA_JIPEBDPEAUDBVARIANT@@@Z @530 NONAME
-?getWString@CMPlugin@@QEAA_JPEBDPEAUDBVARIANT@@@Z @531 NONAME
-?getWStringA@CMPlugin@@QEAAPEA_WIPEBD@Z @532 NONAME
-?getWStringA@CMPlugin@@QEAAPEA_WPEBD@Z @533 NONAME
-?getWord@CMPlugin@@QEAAHIPEBDG@Z @534 NONAME
-?getWord@CMPlugin@@QEAAHPEBDG@Z @535 NONAME
-?setByte@CMPlugin@@QEAAXIPEBDE@Z @536 NONAME
-?setByte@CMPlugin@@QEAAXPEBDE@Z @537 NONAME
-?setDword@CMPlugin@@QEAAXIPEBDK@Z @538 NONAME
-?setDword@CMPlugin@@QEAAXPEBDK@Z @539 NONAME
-?setString@CMPlugin@@QEAAXIPEBD0@Z @540 NONAME
-?setString@CMPlugin@@QEAAXPEBD0@Z @541 NONAME
-?setWString@CMPlugin@@QEAAXIPEBDPEB_W@Z @542 NONAME
-?setWString@CMPlugin@@QEAAXPEBDPEB_W@Z @543 NONAME
-?setWord@CMPlugin@@QEAAXIPEBDG@Z @544 NONAME
-?setWord@CMPlugin@@QEAAXPEBDG@Z @545 NONAME
-?tryOpenLog@CMPlugin@@AEAAXXZ @546 NONAME
+??0CMPluginBase@@IEAA@PEBD@Z @513 NONAME
+??1CMPluginBase@@IEAA@XZ @514 NONAME
+??4CMPluginBase@@QEAAAEAV0@AEBV0@@Z @515 NONAME
+?debugLogA@CMPluginBase@@QEAAXPEBDZZ @516 NONAME
+?debugLogW@CMPluginBase@@QEAAXPEB_WZZ @517 NONAME
+?delSetting@CMPluginBase@@QEAA_JIPEBD@Z @518 NONAME
+?delSetting@CMPluginBase@@QEAA_JPEBD@Z @519 NONAME
+?getBool@CMPluginBase@@QEAA_NIPEBD_N@Z @520 NONAME
+?getBool@CMPluginBase@@QEAA_NPEBD_N@Z @521 NONAME
+?getByte@CMPluginBase@@QEAAHIPEBDE@Z @522 NONAME
+?getByte@CMPluginBase@@QEAAHPEBDE@Z @523 NONAME
+?getDword@CMPluginBase@@QEAAKIPEBDK@Z @524 NONAME
+?getDword@CMPluginBase@@QEAAKPEBDK@Z @525 NONAME
+?getString@CMPluginBase@@QEAA_JIPEBDPEAUDBVARIANT@@@Z @526 NONAME
+?getString@CMPluginBase@@QEAA_JPEBDPEAUDBVARIANT@@@Z @527 NONAME
+?getStringA@CMPluginBase@@QEAAPEADIPEBD@Z @528 NONAME
+?getStringA@CMPluginBase@@QEAAPEADPEBD@Z @529 NONAME
+?getWString@CMPluginBase@@QEAA_JIPEBDPEAUDBVARIANT@@@Z @530 NONAME
+?getWString@CMPluginBase@@QEAA_JPEBDPEAUDBVARIANT@@@Z @531 NONAME
+?getWStringA@CMPluginBase@@QEAAPEA_WIPEBD@Z @532 NONAME
+?getWStringA@CMPluginBase@@QEAAPEA_WPEBD@Z @533 NONAME
+?getWord@CMPluginBase@@QEAAHIPEBDG@Z @534 NONAME
+?getWord@CMPluginBase@@QEAAHPEBDG@Z @535 NONAME
+?setByte@CMPluginBase@@QEAAXIPEBDE@Z @536 NONAME
+?setByte@CMPluginBase@@QEAAXPEBDE@Z @537 NONAME
+?setDword@CMPluginBase@@QEAAXIPEBDK@Z @538 NONAME
+?setDword@CMPluginBase@@QEAAXPEBDK@Z @539 NONAME
+?setString@CMPluginBase@@QEAAXIPEBD0@Z @540 NONAME
+?setString@CMPluginBase@@QEAAXPEBD0@Z @541 NONAME
+?setWString@CMPluginBase@@QEAAXIPEBDPEB_W@Z @542 NONAME
+?setWString@CMPluginBase@@QEAAXPEBDPEB_W@Z @543 NONAME
+?setWord@CMPluginBase@@QEAAXIPEBDG@Z @544 NONAME
+?setWord@CMPluginBase@@QEAAXPEBDG@Z @545 NONAME
+?tryOpenLog@CMPluginBase@@AEAAXXZ @546 NONAME
+?RegisterProtocol@CMPluginBase@@IEAAXHP6APEAUPROTO_INTERFACE@@PEBDPEB_W@ZP6AHPEAU2@@Z@Z @547 NONAME