From 8a74e7495ce5ad39de4f5c25121a84d35df90c36 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 20 May 2018 15:08:48 +0300 Subject: CMPlugin to receive a reference to PLUGININFOEX --- protocols/MSN/src/msn.cpp | 20 +++++++++++++------- protocols/MSN/src/msn_proto.h | 7 +------ 2 files changed, 14 insertions(+), 13 deletions(-) (limited to 'protocols/MSN/src') diff --git a/protocols/MSN/src/msn.cpp b/protocols/MSN/src/msn.cpp index ac39b01399..769c3a7e07 100644 --- a/protocols/MSN/src/msn.cpp +++ b/protocols/MSN/src/msn.cpp @@ -24,6 +24,7 @@ along with this program. If not, see . #include "msn_proto.h" #include "version.h" +CMPlugin g_plugin; CLIST_INTERFACE *pcli; int &hLangpack(g_plugin.m_hLang); @@ -39,7 +40,9 @@ void MsnLinks_Destroy(void); bool g_bTerminated = false; int avsPresent = -1; -static const PLUGININFOEX pluginInfo = +///////////////////////////////////////////////////////////////////////////////////////// + +static const PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -53,9 +56,16 @@ static const PLUGININFOEX pluginInfo = {0x97724af9, 0xf3fb, 0x47d3, {0xa3, 0xbf, 0xea, 0xa9, 0x35, 0xc7, 0x4e, 0x6d}} }; +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN("MSN", pluginInfoEx) +{ + ::DisableThreadLibraryCalls(m_hInst); + SetUniqueId("wlid"); +} + extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -63,10 +73,6 @@ extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD) extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; -///////////////////////////////////////////////////////////////////////////////////////// - -CMPlugin g_plugin; - ///////////////////////////////////////////////////////////////////////////////////////// // OnModulesLoaded - finalizes plugin's configuration on load @@ -83,7 +89,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); pcli = Clist_GetInterface(); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h index da80f418fb..b88e4020bc 100644 --- a/protocols/MSN/src/msn_proto.h +++ b/protocols/MSN/src/msn_proto.h @@ -469,12 +469,7 @@ struct CMsnProto : public PROTO struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN("MSN") - { - ::DisableThreadLibraryCalls(m_hInst); - SetUniqueId("wlid"); - } + CMPlugin(); }; #endif -- cgit v1.2.3