summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/AVS/src/main.cpp6
-rw-r--r--plugins/AddContactPlus/src/main.cpp7
-rw-r--r--plugins/Alarms/src/alarms.cpp6
-rw-r--r--plugins/AssocMgr/src/main.cpp6
-rw-r--r--plugins/AuthState/src/main.cpp7
-rw-r--r--plugins/AutoShutdown/src/main.cpp7
-rw-r--r--plugins/AvatarHistory/src/AvatarHistory.cpp7
-rw-r--r--plugins/BasicHistory/src/BasicHistory.cpp6
-rw-r--r--plugins/BossKeyPlus/src/BossKey.cpp7
-rw-r--r--plugins/BuddyExpectator/src/BuddyExpectator.cpp6
-rw-r--r--plugins/CSList/cslist.cpp24
-rw-r--r--plugins/CSList/cslist.h17
-rw-r--r--plugins/Chat/src/main.cpp6
-rw-r--r--plugins/ClientChangeNotify/src/ClientChangeNotify.cpp6
-rw-r--r--plugins/Clist_classic/src/init.cpp6
-rw-r--r--plugins/Clist_modern/src/init.cpp6
-rw-r--r--plugins/Clist_mw/src/init.cpp6
-rw-r--r--plugins/Clist_nicer/SRC/init.cpp7
-rw-r--r--plugins/Clist_nicer/skineditor/src/main.cpp10
-rw-r--r--plugins/CmdLine/src/CmdLine.cpp7
-rw-r--r--plugins/Console/src/init.cpp6
-rw-r--r--plugins/ContactsPlus/main.cpp6
-rw-r--r--plugins/CountryFlags/main.cpp8
-rw-r--r--plugins/CryptoPP/commonheaders.cpp1
-rw-r--r--plugins/CryptoPP/commonheaders.h2
-rw-r--r--plugins/CryptoPP/main.cpp7
-rw-r--r--plugins/Db3x/init.cpp6
-rw-r--r--plugins/Db3x_mmap/init.cpp9
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/main.cpp9
-rw-r--r--plugins/Dbx_mmap_SA/init.cpp6
-rw-r--r--plugins/Dbx_tree/init.cpp7
-rw-r--r--plugins/ExtraIcons/extraicons.cpp6
-rw-r--r--plugins/FTPFileYM/ftpfile.cpp6
-rw-r--r--plugins/FavContacts/src/main.cpp6
-rw-r--r--plugins/FingerPrintModPlus/src/fingerprint.cpp41
-rw-r--r--plugins/FlashAvatars/cflash.cpp10
-rw-r--r--plugins/Folders/folders.cpp7
-rw-r--r--plugins/FreeImage/Miranda/main.cpp14
-rw-r--r--plugins/Gender/main.cpp6
-rw-r--r--plugins/IEView/ieview_main.cpp7
-rw-r--r--plugins/IgnoreState/main.cpp6
-rw-r--r--plugins/Import/main.cpp9
-rw-r--r--plugins/LangMan/main.cpp6
-rw-r--r--plugins/ListeningTo/listeningto.cpp6
-rw-r--r--plugins/MenuItemEx/main.cpp4
-rw-r--r--plugins/MenuItemEx/menuex.h1
-rw-r--r--plugins/MetaContacts/meta_main.cpp6
-rw-r--r--plugins/MyDetails/mydetails.cpp2
-rw-r--r--plugins/NewAwaySysMod/AwaySys.cpp6
-rw-r--r--plugins/NewEventNotify/main.cpp6
-rw-r--r--plugins/NewXstatusNotify/main.cpp6
-rw-r--r--plugins/PasteIt/PasteIt.cpp6
-rw-r--r--plugins/Popup/src/main.cpp6
-rw-r--r--plugins/Rate/main.cpp6
-rw-r--r--plugins/RecentContacts/RecentContacts.cpp7
-rw-r--r--plugins/SMS/main.cpp2
-rw-r--r--plugins/SRMM/srmm.cpp6
-rw-r--r--plugins/Scriver/srmm.cpp6
-rw-r--r--plugins/SecureIM/commonheaders.cpp61
-rw-r--r--plugins/SecureIM/commonheaders.h12
-rw-r--r--plugins/SecureIM/main.cpp21
-rw-r--r--plugins/SendScreenshotPlus/Main.cpp5
-rw-r--r--plugins/Sessions/Src/Main.cpp6
-rw-r--r--plugins/SimpleStatusMsg/main.cpp7
-rw-r--r--plugins/SmartAutoAway/saa.cpp2
-rw-r--r--plugins/SmartAutoAway/saani.c2
-rw-r--r--plugins/SmartAutoReplier/SAR.cpp2
-rw-r--r--plugins/SmileyAdd/main.cpp8
-rw-r--r--plugins/SpellChecker/spellchecker.cpp8
-rw-r--r--plugins/Svc_crshdmp/crshdmp.cpp10
-rw-r--r--plugins/Svc_dbepp/main.cpp6
-rw-r--r--plugins/Svc_vi/main.cpp7
-rw-r--r--plugins/TabSRMM/src/srmm.cpp7
-rw-r--r--plugins/TipperYM/tipper.cpp6
-rw-r--r--plugins/TooltipNotify/src/main.cpp6
-rw-r--r--plugins/UserInfoEx/init.cpp21
-rw-r--r--plugins/W7UI/main.cpp6
-rw-r--r--plugins/WhenWasIt/WhenWasIt.cpp7
-rw-r--r--plugins/XSoundNotify/xsn_main.cpp2
-rw-r--r--plugins/YAPP/popups2.cpp7
-rw-r--r--plugins/testplugin/testplug.c2
-rw-r--r--protocols/AimOscar/aim.cpp6
-rw-r--r--protocols/FacebookRM/main.cpp6
-rw-r--r--protocols/Gadu-Gadu/gg.cpp7
-rw-r--r--protocols/IRCG/main.cpp7
-rw-r--r--protocols/IcqOscarJ/init.cpp6
-rw-r--r--protocols/JabberG/docs/changelog_jabber.txt2
-rw-r--r--protocols/JabberG/jabber.cpp11
-rw-r--r--protocols/MRA/Mra.cpp9
-rw-r--r--protocols/MSN/msn.cpp9
-rw-r--r--protocols/NewsAggregator/Src/NewsAggregator.cpp7
-rw-r--r--protocols/Omegle/main.cpp6
-rw-r--r--protocols/Quotes/Forex.cpp8
-rw-r--r--protocols/Tlen/tlen.c2
-rw-r--r--protocols/Tlen/tlen_czaty/mucc.cpp2
-rw-r--r--protocols/Twitter/main.cpp6
-rw-r--r--protocols/Weather/weather.cpp8
-rw-r--r--protocols/YAMN/main.cpp7
-rw-r--r--protocols/Yahoo/main.cpp9
-rw-r--r--src/core/stdauth/main.cpp7
-rw-r--r--src/core/stdautoaway/main.cpp7
-rw-r--r--src/core/stdaway/main.cpp7
-rw-r--r--src/core/stdemail/main.cpp7
-rw-r--r--src/core/stdfile/main.cpp7
-rw-r--r--src/core/stdhelp/main.cpp7
-rw-r--r--src/core/stdidle/main.cpp7
-rw-r--r--src/core/stduihist/main.cpp7
-rw-r--r--src/core/stdurl/main.cpp7
-rw-r--r--src/core/stduserinfo/main.cpp7
-rw-r--r--src/core/stduseronline/main.cpp7
-rw-r--r--src/miranda32_10.vcxproj3
-rw-r--r--src/miranda32_10.vcxproj.filters3
-rw-r--r--src/modules/plugins/dll_sniffer.cpp150
-rw-r--r--src/modules/plugins/newplugins.cpp151
-rw-r--r--src/modules/plugins/pluginopts.cpp2
-rw-r--r--src/modules/plugins/plugins.h7
116 files changed, 389 insertions, 770 deletions
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp
index eb690a3b9b..6317c9ede5 100644
--- a/plugins/AVS/src/main.cpp
+++ b/plugins/AVS/src/main.cpp
@@ -2460,11 +2460,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD mirand
return &pluginInfoEx;
}
-static const MUUID interfaces[] = { { 0xece29554, 0x1cf0, 0x41da, { 0x85, 0x82, 0xfb, 0xe8, 0x45, 0x5c, 0x6b, 0xec } }, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { { 0xece29554, 0x1cf0, 0x41da, { 0x85, 0x82, 0xfb, 0xe8, 0x45, 0x5c, 0x6b, 0xec } }, MIID_LAST};
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp
index a1ca7e680a..c81962fb5e 100644
--- a/plugins/AddContactPlus/src/main.cpp
+++ b/plugins/AddContactPlus/src/main.cpp
@@ -40,8 +40,6 @@ PLUGININFOEX pluginInfo = {
{ 0x6471d451, 0x2fe0, 0x4ee2, { 0x85, 0xe, 0x9f, 0x84, 0xf3, 0xc0, 0xd1, 0x87 } }
};
-static const MUUID interfaces[] = {MIID_ADDCONTACTPLUS, MIID_LAST};
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInst = hinstDLL;
@@ -53,10 +51,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_ADDCONTACTPLUS, MIID_LAST};
INT_PTR AddContactPlusDialog(WPARAM, LPARAM)
{
diff --git a/plugins/Alarms/src/alarms.cpp b/plugins/Alarms/src/alarms.cpp
index 42f90c6014..faf5d04e37 100644
--- a/plugins/Alarms/src/alarms.cpp
+++ b/plugins/Alarms/src/alarms.cpp
@@ -53,11 +53,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_ALARMS, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_ALARMS, MIID_LAST};
static int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
diff --git a/plugins/AssocMgr/src/main.cpp b/plugins/AssocMgr/src/main.cpp
index e6095c25c4..fdb9e09a61 100644
--- a/plugins/AssocMgr/src/main.cpp
+++ b/plugins/AssocMgr/src/main.cpp
@@ -39,7 +39,6 @@ PLUGININFOEX pluginInfo={
// {52685CD7-0EC7-44c1-A1A6-381612418202}
{0x52685cd7,0xec7,0x44c1,{0xa1,0xa6,0x38,0x16,0x12,0x41,0x82,0x2}}
};
-static const MUUID interfaces[]={MIID_ASSOCMGR,MIID_AUTORUN,MIID_LAST};
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
@@ -91,10 +90,7 @@ extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD m
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_ASSOCMGR, MIID_AUTORUN, MIID_LAST};
extern "C" __declspec(dllexport) int Load(void)
{
diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp
index d15b136d86..8494d0b9a3 100644
--- a/plugins/AuthState/src/main.cpp
+++ b/plugins/AuthState/src/main.cpp
@@ -69,12 +69,7 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvRese
/* 236CBB9A-57D2-419D-B5CB-0DF5926E921C */
#define MIID_AUTHSTATE {0x236cbb9a, 0x57d2, 0x419d, {0xb5, 0xcb, 0x0d, 0xf5, 0x92, 0x6e, 0x92, 0x1c}}
-
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- static const MUUID interfaces[] = {MIID_AUTHSTATE, MIID_LAST};
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_AUTHSTATE, MIID_LAST};
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
diff --git a/plugins/AutoShutdown/src/main.cpp b/plugins/AutoShutdown/src/main.cpp
index 31b4bbb7d7..bab9223516 100644
--- a/plugins/AutoShutdown/src/main.cpp
+++ b/plugins/AutoShutdown/src/main.cpp
@@ -40,8 +40,6 @@ PLUGININFOEX pluginInfo={
{0x9de24579,0x5c5c,0x49aa,{0x80,0xe8,0x4d,0x38,0xe4,0x34,0x4e,0x63}},
};
-static const MUUID interfaces[]={MIID_SHUTDOWN,MIID_LAST};
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, VOID *pReserved)
{
hInst = hinstDLL;
@@ -90,10 +88,7 @@ extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD m
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[]={MIID_SHUTDOWN,MIID_LAST};
extern "C" __declspec(dllexport) int Load(void)
{
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp
index 3b6e3a1b85..26c9a8c612 100644
--- a/plugins/AvatarHistory/src/AvatarHistory.cpp
+++ b/plugins/AvatarHistory/src/AvatarHistory.cpp
@@ -82,12 +82,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = { MIID_AVATAR_CHANGE_LOGGER, MIID_AVATAR_CHANGE_NOTIFIER, MIID_LAST };
-
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_AVATAR_CHANGE_LOGGER, MIID_AVATAR_CHANGE_NOTIFIER, MIID_LAST };
static INT_PTR CALLBACK FirstRunDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp
index 8f198f9527..1934c7d81d 100644
--- a/plugins/BasicHistory/src/BasicHistory.cpp
+++ b/plugins/BasicHistory/src/BasicHistory.cpp
@@ -70,11 +70,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_UIHISTORY, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_UIHISTORY, MIID_LAST};
void InitScheduler();
void DeinitScheduler();
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp
index e94bc5a239..cba063070e 100644
--- a/plugins/BossKeyPlus/src/BossKey.cpp
+++ b/plugins/BossKeyPlus/src/BossKey.cpp
@@ -80,12 +80,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-
-static const MUUID interfaces[] = { MIID_BOSSKEY, MIID_LAST };
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_BOSSKEY, MIID_LAST };
static BOOL IsAeroMode()
{
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
index 08a3f8e8d2..ff0382bd61 100644
--- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp
+++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
@@ -76,11 +76,7 @@ PLUGININFOEX pluginInfo = {
/* 2D84F403-91F3-4E60-BF02-16C2F1716D86 */
#define MIID_BUDDYEXPECTATOR {0x2d84f403, 0x91f3, 0x4e60, {0xbf, 0x02, 0x16, 0xc2, 0xf1, 0x71, 0x6d, 0x86}}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- static const MUUID interfaces[] = {MIID_BUDDYEXPECTATOR, MIID_LAST};
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_BUDDYEXPECTATOR, MIID_LAST};
extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
{
diff --git a/plugins/CSList/cslist.cpp b/plugins/CSList/cslist.cpp
index ff4870f4d4..b8078ae1be 100644
--- a/plugins/CSList/cslist.cpp
+++ b/plugins/CSList/cslist.cpp
@@ -45,6 +45,22 @@
SortedList *servicesList;
int hLangpack;
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { PLUGIN_GUUID, MIID_LAST };
+
+PLUGININFOEX pluginInfoEx =
+{
+ sizeof(PLUGININFOEX),
+ __PLUGIN_NAME,
+ PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
+ __DESCRIPTION,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ UNICODE_AWARE,
+ PLUGIN_GUUID
+};
+
// ====[ MAIN ]===============================================================
BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
@@ -62,14 +78,6 @@ extern "C" __declspec( dllexport ) PLUGININFOEX* MirandaPluginInfoEx( DWORD mira
return &pluginInfoEx;
}
-// ====[ INTERFACES ]=========================================================
-
-extern "C" __declspec( dllexport ) const MUUID* MirandaPluginInterfaces( void )
-{
- return interfaces;
-}
-
-
// ====[ LOADER ]=============================================================
extern "C" __declspec( dllexport ) int Load( )
diff --git a/plugins/CSList/cslist.h b/plugins/CSList/cslist.h
index 5365b75774..7a4f0f8e75 100644
--- a/plugins/CSList/cslist.h
+++ b/plugins/CSList/cslist.h
@@ -623,22 +623,6 @@ BOOL CSList::bAccountsSupported = FALSE;
// ====[ GLOBALS ]============================================================
-static const MUUID interfaces[] = { PLUGIN_GUUID, MIID_LAST };
-
-PLUGININFOEX pluginInfoEx =
-{
- sizeof(PLUGININFOEX),
- __PLUGIN_NAME,
- PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
- __DESCRIPTION,
- __AUTHOR,
- __AUTHOREMAIL,
- __COPYRIGHT,
- __AUTHORWEB,
- UNICODE_AWARE,
- PLUGIN_GUUID
-};
-
CSList* cslist = NULL;
// ====[ INIT STUFF ]=========================================================
@@ -646,7 +630,6 @@ CSList* cslist = NULL;
BOOL WINAPI DllMain( HINSTANCE, DWORD, LPVOID );
extern "C" __declspec( dllexport ) PLUGININFOEX* MirandaPluginInfoEx( DWORD );
-extern "C" __declspec( dllexport ) const MUUID* MirandaPluginInterfaces( void );
extern "C" __declspec( dllexport ) int Load(void);
extern "C" __declspec( dllexport ) int Unload( void );
diff --git a/plugins/Chat/src/main.cpp b/plugins/Chat/src/main.cpp
index ef631c5508..97507b1ff4 100644
--- a/plugins/Chat/src/main.cpp
+++ b/plugins/Chat/src/main.cpp
@@ -74,11 +74,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_CHAT, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_CHAT, MIID_LAST};
extern "C" __declspec(dllexport) int Load(void)
{
diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp
index f90aaed838..b2232d7a44 100644
--- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp
+++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp
@@ -60,11 +60,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
#define MIID_CLIENTCHANGENOTIFY {0xe9d1f0d4, 0xd65d, 0x4840, {0x87, 0xbd, 0x59, 0xd7, 0xb4, 0x70, 0x2c, 0x47}}
// {E9D1F0D4-D65D-4840-87BD-59D7B4702C47}
-static const MUUID interfaces[] = {MIID_CLIENTCHANGENOTIFY, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_CLIENTCHANGENOTIFY, MIID_LAST};
extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
{
diff --git a/plugins/Clist_classic/src/init.cpp b/plugins/Clist_classic/src/init.cpp
index 3e497d1739..c8c580acf1 100644
--- a/plugins/Clist_classic/src/init.cpp
+++ b/plugins/Clist_classic/src/init.cpp
@@ -78,11 +78,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD miranda
/////////////////////////////////////////////////////////////////////////////////////////
// returns plugin's interfaces information
-static const MUUID interfaces[] = {MIID_CLIST, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_CLIST, MIID_LAST};
/////////////////////////////////////////////////////////////////////////////////////////
// called when number of accounts has been changed
diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp
index 3faaa7e1dd..852c800064 100644
--- a/plugins/Clist_modern/src/init.cpp
+++ b/plugins/Clist_modern/src/init.cpp
@@ -69,12 +69,8 @@ PLUGININFOEX pluginInfo = {
//{043909B6-AAD8-4d82-8EB5-9F64CFE867CD}
{0x43909b6, 0xaad8, 0x4d82, { 0x8e, 0xb5, 0x9f, 0x64, 0xcf, 0xe8, 0x67, 0xcd }}
};
-static const MUUID interfaces[] = {MIID_CLIST, MIID_LAST};
-PLUGININTERFACE const MUUID * MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_CLIST, MIID_LAST};
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD dwReason, LPVOID reserved)
{
diff --git a/plugins/Clist_mw/src/init.cpp b/plugins/Clist_mw/src/init.cpp
index 2bec98ea31..4e323840d0 100644
--- a/plugins/Clist_mw/src/init.cpp
+++ b/plugins/Clist_mw/src/init.cpp
@@ -101,11 +101,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_CLIST, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_CLIST, MIID_LAST};
int LoadContactListModule(void);
int LoadCLCModule(void);
diff --git a/plugins/Clist_nicer/SRC/init.cpp b/plugins/Clist_nicer/SRC/init.cpp
index 18f9a65158..7ba7dcdf6d 100644
--- a/plugins/Clist_nicer/SRC/init.cpp
+++ b/plugins/Clist_nicer/SRC/init.cpp
@@ -173,12 +173,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD mirand
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_CLIST, MIID_LAST};
-
-extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_CLIST, MIID_LAST};
int LoadContactListModule(void);
int LoadCLCModule(void);
diff --git a/plugins/Clist_nicer/skineditor/src/main.cpp b/plugins/Clist_nicer/skineditor/src/main.cpp
index de1996f2f5..8f556460fc 100644
--- a/plugins/Clist_nicer/skineditor/src/main.cpp
+++ b/plugins/Clist_nicer/skineditor/src/main.cpp
@@ -924,11 +924,13 @@ extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD mirand
/*
* define our own MUUID, since this is a special plugin...
*/
-extern "C" static const MUUID interfaces[] = {MIID_TESTPLUGIN, { 0x70ff4eef, 0xcb7b, 0x4d88, { 0x85, 0x60, 0x7d, 0xe3, 0xa6, 0x68, 0x5c, 0xe3 }}, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
+
+extern "C" extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] =
{
- return interfaces;
-}
+ MIID_TESTPLUGIN,
+ { 0x70ff4eef, 0xcb7b, 0x4d88, { 0x85, 0x60, 0x7d, 0xe3, 0xa6, 0x68, 0x5c, 0xe3 }},
+ MIID_LAST
+};
static int ModulesLoaded(WPARAM wParam, LPARAM lParam)
{
diff --git a/plugins/CmdLine/src/CmdLine.cpp b/plugins/CmdLine/src/CmdLine.cpp
index 4d19c19ccc..ae044469d2 100644
--- a/plugins/CmdLine/src/CmdLine.cpp
+++ b/plugins/CmdLine/src/CmdLine.cpp
@@ -42,12 +42,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_CMDLINE, MIID_LAST};
-
-extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces()
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_CMDLINE, MIID_LAST};
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/plugins/Console/src/init.cpp b/plugins/Console/src/init.cpp
index 58943d2c6a..593b7790f3 100644
--- a/plugins/Console/src/init.cpp
+++ b/plugins/Console/src/init.cpp
@@ -52,11 +52,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
}
// we implement service mode interface
-static const MUUID interfaces[] = {MIID_LOGWINDOW, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_LOGWINDOW, MIID_LAST};
extern "C" __declspec(dllexport) int Load(void)
{
diff --git a/plugins/ContactsPlus/main.cpp b/plugins/ContactsPlus/main.cpp
index 5c2d67ad6a..da43554c29 100644
--- a/plugins/ContactsPlus/main.cpp
+++ b/plugins/ContactsPlus/main.cpp
@@ -272,11 +272,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_SRCONTACTS, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_SRCONTACTS, MIID_LAST};
extern "C" __declspec(dllexport) int Load(void)
{
diff --git a/plugins/CountryFlags/main.cpp b/plugins/CountryFlags/main.cpp
index 1f3e80ba04..462672292a 100644
--- a/plugins/CountryFlags/main.cpp
+++ b/plugins/CountryFlags/main.cpp
@@ -38,7 +38,8 @@ static PLUGININFOEX pluginInfo={
// {68C36842-3D95-4f4a-AB81-014D6593863B}
{0x68c36842,0x3d95,0x4f4a,{0xab,0x81,0x1,0x4d,0x65,0x93,0x86,0x3b}}
};
-static const MUUID interfaces[]={MIID_FLAGS,MIID_LAST};
+
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[]={MIID_FLAGS,MIID_LAST};
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
@@ -80,11 +81,6 @@ extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD m
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
-
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfo);
diff --git a/plugins/CryptoPP/commonheaders.cpp b/plugins/CryptoPP/commonheaders.cpp
index 395da89d5f..04a92adb1c 100644
--- a/plugins/CryptoPP/commonheaders.cpp
+++ b/plugins/CryptoPP/commonheaders.cpp
@@ -3,7 +3,6 @@
LPCSTR szModuleName = MODULENAME;
LPCSTR szVersionStr = MODULENAME" DLL ("__VERSION_STRING")";
HINSTANCE g_hInst;
-MUUID interfaces[] = {MIID_CRYPTOPP, MIID_LAST};
HANDLE hPGPPRIV = NULL;
HANDLE hRSA4096 = NULL;
diff --git a/plugins/CryptoPP/commonheaders.h b/plugins/CryptoPP/commonheaders.h
index 4f2ff10845..4e94917d78 100644
--- a/plugins/CryptoPP/commonheaders.h
+++ b/plugins/CryptoPP/commonheaders.h
@@ -79,7 +79,6 @@ extern BOOL isVista;
// shared vars
extern HINSTANCE g_hInst;
extern PLUGININFOEX pluginInfoEx;
-extern MUUID interfaces[];
extern HANDLE hPGPPRIV;
extern HANDLE hRSA4096;
@@ -107,7 +106,6 @@ extern "C" {
DLLEXPORT int Load(PLUGINLINK *);
DLLEXPORT PLUGININFOEX *MirandaPluginInfoEx(DWORD);
- DLLEXPORT MUUID* MirandaPluginInterfaces(void);
DLLEXPORT int Unload();
DLLEXPORT HANDLE __cdecl cpp_create_context(int); // create crypt-context
diff --git a/plugins/CryptoPP/main.cpp b/plugins/CryptoPP/main.cpp
index 2a2639d74a..b5fcf6ad01 100644
--- a/plugins/CryptoPP/main.cpp
+++ b/plugins/CryptoPP/main.cpp
@@ -28,16 +28,13 @@ BOOL WINAPI DllMain(HINSTANCE hInst, DWORD dwReason, LPVOID)
return TRUE;
}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_CRYPTOPP, MIID_LAST};
+
PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
return &pluginInfoEx;
}
-MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
-
int onModulesLoaded(WPARAM wParam,LPARAM lParam)
{
// updater plugin support
diff --git a/plugins/Db3x/init.cpp b/plugins/Db3x/init.cpp
index 63f752beb6..f9b1269bda 100644
--- a/plugins/Db3x/init.cpp
+++ b/plugins/Db3x/init.cpp
@@ -163,11 +163,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD mirand
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_DATABASE, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_DATABASE, MIID_LAST};
extern "C" __declspec(dllexport) int Load(void)
{
diff --git a/plugins/Db3x_mmap/init.cpp b/plugins/Db3x_mmap/init.cpp
index dd9e9a36db..dbb83d76ab 100644
--- a/plugins/Db3x_mmap/init.cpp
+++ b/plugins/Db3x_mmap/init.cpp
@@ -40,8 +40,7 @@ static PLUGININFOEX pluginInfo = {
{0xf7a6b27c, 0x9d9c, 0x4a42, { 0xbe, 0x86, 0xa4, 0x48, 0xae, 0x10, 0x91, 0x61 }} //{F7A6B27C-9D9C-4a42-BE86-A448AE109161}
};
-HINSTANCE g_hInst=NULL;
-
+HINSTANCE g_hInst = NULL;
static int getCapability( int flag )
{
@@ -165,11 +164,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD mirand
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_DATABASE, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_DATABASE, MIID_LAST};
extern "C" __declspec(dllexport) int Load(void)
{
diff --git a/plugins/Dbx_mmap_SA/Import_SA/main.cpp b/plugins/Dbx_mmap_SA/Import_SA/main.cpp
index 2d0a4f5e26..d464f8bb55 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/main.cpp
+++ b/plugins/Dbx_mmap_SA/Import_SA/main.cpp
@@ -86,14 +86,9 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
}
/////////////////////////////////////////////////////////////////////////////////////////
-// MirandaPluginInterfaces - returns the protocol interface to the core
+// MirandaInterfaces - returns the protocol interface to the core
-static const MUUID interfaces[] = {MIID_IMPORT, MIID_LAST};
-
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_IMPORT, MIID_LAST};
/////////////////////////////////////////////////////////////////////////////////////////
// Performs a primary set of actions upon plugin loading
diff --git a/plugins/Dbx_mmap_SA/init.cpp b/plugins/Dbx_mmap_SA/init.cpp
index 30c1254c16..4996bed435 100644
--- a/plugins/Dbx_mmap_SA/init.cpp
+++ b/plugins/Dbx_mmap_SA/init.cpp
@@ -185,11 +185,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD mirand
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_DATABASE, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_DATABASE, MIID_LAST};
extern "C" __declspec(dllexport) int Load(void)
{
diff --git a/plugins/Dbx_tree/init.cpp b/plugins/Dbx_tree/init.cpp
index fc3c088146..0ad9e6721b 100644
--- a/plugins/Dbx_tree/init.cpp
+++ b/plugins/Dbx_tree/init.cpp
@@ -26,12 +26,10 @@ HINSTANCE hInstance = NULL;
int hLangpack;
static const DWORD gMinMirVer = 0x00080000;
-static const MUUID gInterfaces[] = {MIID_DATABASE, MIID_LAST};
// {28F45248-8C9C-4bee-9307-7BCF3E12BF99}
static const MUUID gGUID =
{ 0x28f45248, 0x8c9c, 0x4bee, { 0x93, 0x07, 0x7b, 0xcf, 0x3e, 0x12, 0xbf, 0x99 } };
-
static PLUGININFOEX gPluginInfoEx = {
sizeof(PLUGININFOEX),
gInternalNameLong,
@@ -55,10 +53,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD Mirand
return &gPluginInfoEx;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return gInterfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_DATABASE, MIID_LAST};
extern "C" __declspec(dllexport) int Load(void)
{
diff --git a/plugins/ExtraIcons/extraicons.cpp b/plugins/ExtraIcons/extraicons.cpp
index f193de7633..e468137300 100644
--- a/plugins/ExtraIcons/extraicons.cpp
+++ b/plugins/ExtraIcons/extraicons.cpp
@@ -72,11 +72,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = { MIID_EXTRAICONSSERVICE, MIID_LAST };
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_EXTRAICONSSERVICE, MIID_LAST };
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/plugins/FTPFileYM/ftpfile.cpp b/plugins/FTPFileYM/ftpfile.cpp
index 461c59b552..94f6d7c291 100644
--- a/plugins/FTPFileYM/ftpfile.cpp
+++ b/plugins/FTPFileYM/ftpfile.cpp
@@ -66,11 +66,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfoEx;
}
-static const MUUID interfaces[] = {MIID_FTPFILE, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_FTPFILE, MIID_LAST};
//------------ INIT FUNCTIONS ------------//
diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp
index 88e6912edf..77fe9fada0 100644
--- a/plugins/FavContacts/src/main.cpp
+++ b/plugins/FavContacts/src/main.cpp
@@ -106,11 +106,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces(void)
-{
- static const MUUID interfaces[] = { MIID_FAVCONTACTS, MIID_LAST };
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_FAVCONTACTS, MIID_LAST };
static __forceinline COLORREF sttShadeColor(COLORREF clLine1, COLORREF clBack)
{
diff --git a/plugins/FingerPrintModPlus/src/fingerprint.cpp b/plugins/FingerPrintModPlus/src/fingerprint.cpp
index e0813579b5..743f282f26 100644
--- a/plugins/FingerPrintModPlus/src/fingerprint.cpp
+++ b/plugins/FingerPrintModPlus/src/fingerprint.cpp
@@ -35,7 +35,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//#define _qtoupper(_c) (((_c) >= 'a' && (_c) <= 'z') ? ((_c) & 0x5F) : (_c))
void InitFingerEvents();
-void UninitFingerEvents();
void FASTCALL ClearFI();
int OnIconsChanged(WPARAM wParam, LPARAM lParam);
@@ -76,10 +75,6 @@ BOOL g_bCList_Extra_Set_Icon_ServiceExist = FALSE;
HANDLE hHeap = NULL;
HANDLE hExtraImageListRebuild = NULL; // hook event handle for ME_CLIST_EXTRA_LIST_REBUILD
HANDLE hExtraImageApply = NULL; // hook event handle for ME_CLIST_EXTRA_IMAGE_APPLY
-HANDLE hContactSettingChanged = NULL; // hook event handle for ME_DB_CONTACT_SETTINGCHANGED
-HANDLE hOptInitialise = NULL; // hook event handle for ME_OPT_INITIALISE
-HANDLE hIconsChanged = NULL; // hook event handle for ME_SKIN2_ICONSCHANGED
-HANDLE hPreShutdown = NULL; // hook event handle for ME_SYSTEM_PRESHUTDOWN
HANDLE hExtraIconClick = NULL; // hook event handle for ME_CLIST_EXTRA_CLICK
HANDLE compClientServA = NULL;
@@ -145,11 +140,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirand
return &pluginInfoEx;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces()
-{
- static const MUUID interfaces[] = {MIID_THIS_PLUGIN, MIID_FINGERPRINT, MIID_LAST };
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_FINGERPRINT, MIID_LAST };
extern "C" int __declspec(dllexport) Load(void)
{
@@ -157,7 +148,7 @@ extern "C" int __declspec(dllexport) Load(void)
mir_getLP(&pluginInfoEx);
hStaticHooks[0] = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
- hPreShutdown = HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
compClientServA = CreateServiceFunction(MS_FP_SAMECLIENTS, ServiceSameClientsA);
getClientIconA = CreateServiceFunction(MS_FP_GETCLIENTICON, ServiceGetClientIconA);
@@ -233,17 +224,15 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
int i;
- char szVersion[16];
-
g_LPCodePage = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
g_bExtraIcon_Register_ServiceExist = ServiceExists(MS_EXTRAICON_REGISTER);
g_bCList_Extra_Set_Icon_ServiceExist = ServiceExists(MS_CLIST_EXTRA_SET_ICON);
//Hook necessary events
- hIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, OnIconsChanged);
- hContactSettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged);
- hOptInitialise = HookEvent(ME_OPT_INITIALISE, OnOptInitialise);
+ HookEvent(ME_SKIN2_ICONSCHANGED, OnIconsChanged);
+ HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged);
+ HookEvent(ME_OPT_INITIALISE, OnOptInitialise);
if(g_bExtraIcon_Register_ServiceExist)
{
@@ -332,13 +321,6 @@ int OnExtraIconClicked(WPARAM wParam, LPARAM lParam)
*/
int OnPreShutdown(WPARAM wParam, LPARAM lParam)
{
- //Unhook events
- UnhookEvent(hContactSettingChanged);
- UnhookEvent(hPreShutdown);
- UnhookEvent(hIconsChanged);
- UnhookEvent(hOptInitialise);
- if (!g_bExtraIcon_Register_ServiceExist) UninitFingerEvents();
- UnhookEvent(hFolderChanged);
DestroyServiceFunction(compClientServA);
DestroyServiceFunction(getClientIconA);
DestroyServiceFunction(compClientServW);
@@ -393,16 +375,9 @@ int FASTCALL ApplyFingerprintImage(HANDLE hContact, LPTSTR szMirVer)
void InitFingerEvents()
{
- hExtraIconClick = HookEvent(ME_CLIST_EXTRA_CLICK, OnExtraIconClicked);
- hExtraImageListRebuild = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, OnExtraIconListRebuild);
- hExtraImageApply = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnExtraImageApply);
-}
-
-void UninitFingerEvents()
-{
- UnhookEvent(hExtraImageListRebuild);
- UnhookEvent(hExtraImageApply);
- UnhookEvent(hExtraIconClick);
+ HookEvent(ME_CLIST_EXTRA_CLICK, OnExtraIconClicked);
+ HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, OnExtraIconListRebuild);
+ HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnExtraImageApply);
}
int OnExtraIconClick(WPARAM wParam, LPARAM lParam)
diff --git a/plugins/FlashAvatars/cflash.cpp b/plugins/FlashAvatars/cflash.cpp
index a645972e08..2d101cbbe6 100644
--- a/plugins/FlashAvatars/cflash.cpp
+++ b/plugins/FlashAvatars/cflash.cpp
@@ -646,21 +646,13 @@ extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD mirand
return &pluginInfo;
}
-static const MUUID interfaces[] = { { 0xc6fbb128, 0x81b4, 0x4221, { 0xa4, 0xb9, 0xe6, 0x34, 0x7c, 0x26, 0x4a, 0x49 } }, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
-
-
extern "C" int __declspec(dllexport) Load(void)
{
-
mir_getLP(&pluginInfo);
hHooks[0] = HookEvent(ME_SYSTEM_MODULESLOADED, systemModulesLoaded);
- return 0;
+ return 0;
}
extern "C" int __declspec(dllexport) Unload(void)
diff --git a/plugins/Folders/folders.cpp b/plugins/Folders/folders.cpp
index 867f3e8713..721c43ee5f 100644
--- a/plugins/Folders/folders.cpp
+++ b/plugins/Folders/folders.cpp
@@ -162,12 +162,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_FOLDERS, MIID_LAST};
-
-extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces()
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_FOLDERS, MIID_LAST};
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/plugins/FreeImage/Miranda/main.cpp b/plugins/FreeImage/Miranda/main.cpp
index 70f60c02cc..370e743f94 100644
--- a/plugins/FreeImage/Miranda/main.cpp
+++ b/plugins/FreeImage/Miranda/main.cpp
@@ -172,7 +172,7 @@ static HBITMAP FreeImage_CreateHBITMAPFromDIB(FIBITMAP *in)
if (bpp == 48)
dib = FreeImage_ConvertTo24Bits(in);
- else if (FreeImage_GetBPP(in) > 32)
+ else if (FreeImage_GetBPP(in) > 32)
dib = FreeImage_ConvertTo32Bits(in);
else
dib = in;
@@ -305,7 +305,7 @@ static INT_PTR serviceBmpFilterResizeBitmap(WPARAM wParam,LPARAM lParam)
if ((width == bminfo.bmWidth && height == bminfo.bmHeight)
|| ((info->fit & RESIZEBITMAP_FLAG_DONT_GROW)
- && !(info->fit & RESIZEBITMAP_MAKE_SQUARE)
+ && !(info->fit & RESIZEBITMAP_MAKE_SQUARE)
&& width > bminfo.bmWidth && height > bminfo.bmHeight))
{
// Do nothing
@@ -320,7 +320,7 @@ static INT_PTR serviceBmpFilterResizeBitmap(WPARAM wParam,LPARAM lParam)
FIBITMAP *dib_tmp;
if (xOrig > 0 || yOrig > 0)
dib_tmp = FreeImage_Copy(dib, xOrig, yOrig, xOrig + widthOrig, yOrig + heightOrig);
- else
+ else
dib_tmp = dib;
if (dib_tmp == NULL)
@@ -361,7 +361,7 @@ FreeImage_LoadFromMem(FREE_IMAGE_FORMAT fif, fiio_mem_handle *handle, int flags)
return NULL;
}
-FIMEMORY
+FIMEMORY
*FreeImage_SaveToMem(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, fiio_mem_handle *handle, int flags) {
//FreeImageIO io;
//SetMemIO(&io);
@@ -1252,11 +1252,7 @@ extern "C" int __declspec(dllexport) Unload(void)
return IMGSERVICE_Unload();
}
-static const MUUID interfaces[] = { { 0xece29554, 0x1cf0, 0x41da, { 0x85, 0x82, 0xfb, 0xe8, 0x45, 0x5c, 0x6b, 0xec } }, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { { 0xece29554, 0x1cf0, 0x41da, { 0x85, 0x82, 0xfb, 0xe8, 0x45, 0x5c, 0x6b, 0xec } }, MIID_LAST};
extern "C" __declspec(dllexport) const PLUGININFOEX * MirandaPluginInfoEx(DWORD mirandaVersion)
{
diff --git a/plugins/Gender/main.cpp b/plugins/Gender/main.cpp
index 538ee9b9fe..62825459f6 100644
--- a/plugins/Gender/main.cpp
+++ b/plugins/Gender/main.cpp
@@ -70,11 +70,7 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvRese
/* 0FF3991A-5505-479D-A2E0-53DD31C6DFA7 */
#define MIID_GENDER {0x0ff3991a, 0x5505, 0x479d, {0xa2, 0xe0, 0x53, 0xdd, 0x31, 0xc6, 0xdf, 0xa7}}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- static const MUUID interfaces[] = {MIID_GENDER, MIID_LAST};
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_GENDER, MIID_LAST};
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
diff --git a/plugins/IEView/ieview_main.cpp b/plugins/IEView/ieview_main.cpp
index 1325e269b5..84277c6750 100644
--- a/plugins/IEView/ieview_main.cpp
+++ b/plugins/IEView/ieview_main.cpp
@@ -57,12 +57,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD miranda
return &pluginInfoEx;
}
-static const MUUID interfaces[] = {MIID_LOGWINDOW, MIID_LAST};
-
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_LOGWINDOW, MIID_LAST};
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/plugins/IgnoreState/main.cpp b/plugins/IgnoreState/main.cpp
index 75253d256b..abc95bda11 100644
--- a/plugins/IgnoreState/main.cpp
+++ b/plugins/IgnoreState/main.cpp
@@ -70,11 +70,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- static const MUUID interfaces[] = {MIID_IGNORESRATE, MIID_LAST};
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_IGNORESRATE, MIID_LAST};
int onSystemOKToExit(WPARAM wParam,LPARAM lParam)
{
diff --git a/plugins/Import/main.cpp b/plugins/Import/main.cpp
index 08403562ee..8b7524c040 100644
--- a/plugins/Import/main.cpp
+++ b/plugins/Import/main.cpp
@@ -89,14 +89,9 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
}
/////////////////////////////////////////////////////////////////////////////////////////
-// MirandaPluginInterfaces - returns the protocol interface to the core
+// MirandaInterfaces - returns the protocol interface to the core
-static const MUUID interfaces[] = {MIID_IMPORT, MIID_LAST};
-
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_IMPORT, MIID_LAST};
/////////////////////////////////////////////////////////////////////////////////////////
// Performs a primary set of actions upon plugin loading
diff --git a/plugins/LangMan/main.cpp b/plugins/LangMan/main.cpp
index ea7f4f7354..2309bf1ec8 100644
--- a/plugins/LangMan/main.cpp
+++ b/plugins/LangMan/main.cpp
@@ -95,11 +95,7 @@ __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD)
///////////////////////////////////////////////////////////////////////////////
-static const MUUID interfaces[] = {MIID_LANGMAN, MIID_LAST};
-
-__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{ return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_LANGMAN, MIID_LAST};
///////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/ListeningTo/listeningto.cpp b/plugins/ListeningTo/listeningto.cpp
index feb3640008..0a6fecb66c 100644
--- a/plugins/ListeningTo/listeningto.cpp
+++ b/plugins/ListeningTo/listeningto.cpp
@@ -120,11 +120,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = { MIID_LISTENINGTO, MIID_LAST };
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_LISTENINGTO, MIID_LAST };
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/plugins/MenuItemEx/main.cpp b/plugins/MenuItemEx/main.cpp
index 9061c0feb0..3b24d1e0f9 100644
--- a/plugins/MenuItemEx/main.cpp
+++ b/plugins/MenuItemEx/main.cpp
@@ -18,8 +18,6 @@
const int vf_default = VF_VS|VF_HFL|VF_IGN|VF_CID|VF_SHOWID|VF_RECV|VF_STAT|VF_SMNAME|VF_CIDN|VF_CIP;
-
-MUUID interfaces[] = {MIID_MENUEX, MIID_LAST};
HINSTANCE hinstance;
HANDLE hmenuVis,hmenuOff,hmenuHide,hmenuIgnore,hmenuProto,hmenuAdded,hmenuAuthReq;
HANDLE hmenuCopyID,hmenuRecvFiles,hmenuStatusMsg,hmenuCopyIP,hmenuCopyMirVer;
@@ -1348,6 +1346,8 @@ static int PluginInit(WPARAM wparam,LPARAM lparam)
return 0;
}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_MENUEX, MIID_LAST};
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
return &pluginInfoEx;
diff --git a/plugins/MenuItemEx/menuex.h b/plugins/MenuItemEx/menuex.h
index 3ad6f25686..5f6540827a 100644
--- a/plugins/MenuItemEx/menuex.h
+++ b/plugins/MenuItemEx/menuex.h
@@ -39,7 +39,6 @@
#define MIIM_STRING 0x00000040
extern PLUGININFOEX pluginInfoEx;
-extern MUUID interfaces[];
int OptionsInit(WPARAM,LPARAM);
diff --git a/plugins/MetaContacts/meta_main.cpp b/plugins/MetaContacts/meta_main.cpp
index 1605ec6129..5aae726ace 100644
--- a/plugins/MetaContacts/meta_main.cpp
+++ b/plugins/MetaContacts/meta_main.cpp
@@ -115,11 +115,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_PROTOCOL, MIID_METACONTACTS, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_METACONTACTS, MIID_LAST};
/** DLL entry point
* Required to store the instance handle
diff --git a/plugins/MyDetails/mydetails.cpp b/plugins/MyDetails/mydetails.cpp
index 5790fa6d48..4eb11c4119 100644
--- a/plugins/MyDetails/mydetails.cpp
+++ b/plugins/MyDetails/mydetails.cpp
@@ -98,7 +98,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
}
-static const MUUID interfaces[] = { MIID_MDETAILS, MIID_LAST };
+extern "C" __declspec(dllexport) const MUUID interfaces[] = { MIID_MDETAILS, MIID_LAST };
extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
{
return interfaces;
diff --git a/plugins/NewAwaySysMod/AwaySys.cpp b/plugins/NewAwaySysMod/AwaySys.cpp
index 2c087a3d9f..d573009ede 100644
--- a/plugins/NewAwaySysMod/AwaySys.cpp
+++ b/plugins/NewAwaySysMod/AwaySys.cpp
@@ -99,11 +99,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
return TRUE;
}
-static const MUUID interfaces[] = {MIID_SRAWAY, MIID_LAST}; // TODO: add MIID_WHOISREADING here if there'll be any some time in future..
-extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_SRAWAY, MIID_LAST}; // TODO: add MIID_WHOISREADING here if there'll be any some time in future..
extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
{
diff --git a/plugins/NewEventNotify/main.cpp b/plugins/NewEventNotify/main.cpp
index 3cf67e39b6..2ff9fa9324 100644
--- a/plugins/NewEventNotify/main.cpp
+++ b/plugins/NewEventNotify/main.cpp
@@ -172,11 +172,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_EVENTNOTIFY, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_EVENTNOTIFY, MIID_LAST};
extern "C" __declspec(dllexport) int Load(void)
{
diff --git a/plugins/NewXstatusNotify/main.cpp b/plugins/NewXstatusNotify/main.cpp
index 3a926259dc..2e9974cc8d 100644
--- a/plugins/NewXstatusNotify/main.cpp
+++ b/plugins/NewXstatusNotify/main.cpp
@@ -68,11 +68,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfoEx;
}
-static const MUUID interfaces[] = {MIID_USERONLINE, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_USERONLINE, MIID_LAST};
BYTE GetGender(HANDLE hContact)
{
diff --git a/plugins/PasteIt/PasteIt.cpp b/plugins/PasteIt/PasteIt.cpp
index 204b58ced5..c05037c623 100644
--- a/plugins/PasteIt/PasteIt.cpp
+++ b/plugins/PasteIt/PasteIt.cpp
@@ -80,11 +80,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_PASTEIT, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PASTEIT, MIID_LAST};
std::wstring GetFile()
{
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp
index e23b3077d5..c276dc6364 100644
--- a/plugins/Popup/src/main.cpp
+++ b/plugins/Popup/src/main.cpp
@@ -409,11 +409,7 @@ MIRAPI PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
}
//Miranda PluginInterfaces
-MIRAPI const MUUID *MirandaPluginInterfaces(void)
-{
- static const MUUID interfaces[] = { MIID_POPUPS, MIID_LAST };
- return interfaces;
-}
+MIRAPI const MUUID MirandaInterfaces[] = { MIID_POPUPS, MIID_LAST };
//ME_SYSTEM_OKTOEXIT event
//called before the app goes into shutdown routine to make sure everyone is happy to exit
diff --git a/plugins/Rate/main.cpp b/plugins/Rate/main.cpp
index 92412a6622..772d23f790 100644
--- a/plugins/Rate/main.cpp
+++ b/plugins/Rate/main.cpp
@@ -85,11 +85,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- static const MUUID interfaces[] = {MIID_CONTACTSRATE, MIID_LAST};
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_CONTACTSRATE, MIID_LAST};
int onSystemOKToExit(WPARAM wParam,LPARAM lParam)
{
diff --git a/plugins/RecentContacts/RecentContacts.cpp b/plugins/RecentContacts/RecentContacts.cpp
index e77cc5a8a9..fcc3dda6ac 100644
--- a/plugins/RecentContacts/RecentContacts.cpp
+++ b/plugins/RecentContacts/RecentContacts.cpp
@@ -57,12 +57,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
/////////////////////////////////////////////////////////////////////////////////////////
-static const MUUID interfaces[] = {MIID_RECENTCONTACTS, MIID_LAST};
-
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_RECENTCONTACTS, MIID_LAST};
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/SMS/main.cpp b/plugins/SMS/main.cpp
index ac230164eb..64ff1a92f1 100644
--- a/plugins/SMS/main.cpp
+++ b/plugins/SMS/main.cpp
@@ -163,7 +163,7 @@ PLUGININFOEX pluginInfoEx={
};
-static const MUUID interfaces[]={SMS_GUID,MIID_LAST};
+extern "C" __declspec(dllexport) const MUUID interfaces[]={SMS_GUID,MIID_LAST};
diff --git a/plugins/SRMM/srmm.cpp b/plugins/SRMM/srmm.cpp
index 124798e1b9..06e87a2f10 100644
--- a/plugins/SRMM/srmm.cpp
+++ b/plugins/SRMM/srmm.cpp
@@ -52,11 +52,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_SRMM, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_SRMM, MIID_LAST};
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/plugins/Scriver/srmm.cpp b/plugins/Scriver/srmm.cpp
index bc645704d1..4a4108ed84 100644
--- a/plugins/Scriver/srmm.cpp
+++ b/plugins/Scriver/srmm.cpp
@@ -57,11 +57,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_SRMM, MIID_CHAT, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_SRMM, MIID_CHAT, MIID_LAST};
extern "C" __declspec(dllexport) int Load(void)
{
diff --git a/plugins/SecureIM/commonheaders.cpp b/plugins/SecureIM/commonheaders.cpp
index d9d681dc10..3f51f10ab7 100644
--- a/plugins/SecureIM/commonheaders.cpp
+++ b/plugins/SecureIM/commonheaders.cpp
@@ -1,7 +1,6 @@
#include "commonheaders.h"
HINSTANCE g_hInst, g_hIconInst;
-MUUID interfaces[] = {MIID_SECUREIM, MIID_LAST};
LPCSTR szModuleName = MODULENAME;
LPCSTR szVersionStr = MODULENAME" DLL ("__VERSION_STRING")";
@@ -39,7 +38,6 @@ PLUGININFOEX pluginInfoEx = {
MIID_SECUREIM
};
-
LPSTR myDBGetString(HANDLE hContact,const char *szModule,const char *szSetting) {
char *val=NULL;
DBVARIANT dbv;
@@ -72,32 +70,6 @@ int myDBWriteStringEncode(HANDLE hContact,const char *szModule,const char *szSet
return ret;
}
-/*
-int DBWriteString(HANDLE hContact,const char *szModule,const char *szSetting,const char *val) {
- return DBWriteContactSettingString(hContact,szModule,szSetting,val);
-}
-
-
-int DBGetByte(HANDLE hContact,const char *szModule,const char *szSetting,int errorValue) {
- return DBGetContactSettingByte(hContact,szModule,szSetting,errorValue);
-}
-
-
-int DBWriteByte(HANDLE hContact,const char *szModule,const char *szSetting,BYTE val) {
- return DBWriteContactSettingByte(hContact,szModule,szSetting,val);
-}
-
-
-int DBGetWord(HANDLE hContact,const char *szModule,const char *szSetting,int errorValue) {
- return DBGetContactSettingWord(hContact,szModule,szSetting,errorValue);
-}
-
-
-int DBWriteWord(HANDLE hContact,const char *szModule,const char *szSetting,WORD val) {
- return DBWriteContactSettingWord(hContact,szModule,szSetting,val);
-}
-*/
-
void GetFlags() {
bSFT = DBGetContactSettingByte(0,szModuleName,"sft",0);
bSOM = DBGetContactSettingByte(0,szModuleName,"som",0);
@@ -127,39 +99,6 @@ void SetFlags() {
DBWriteContactSettingByte(0,szModuleName,"mcm",bMCM);
}
-
-/*-----------------------------------------------------*/
-/*
-LPSTR u2a( LPCWSTR src )
-{
- int codepage = ServiceExists(MS_LANGPACK_GETCODEPAGE)?CallService( MS_LANGPACK_GETCODEPAGE, 0, 0 ):CP_ACP;
-
- int cbLen = WideCharToMultiByte( codepage, 0, src, -1, NULL, 0, NULL, NULL );
- LPSTR result = (LPSTR) mir_alloc( cbLen+1 );
- if ( result == NULL )
- return NULL;
-
- WideCharToMultiByte( codepage, 0, src, -1, result, cbLen, NULL, NULL );
- result[ cbLen ] = 0;
- return result;
-}
-
-LPWSTR a2u( LPCSTR src )
-{
- int codepage = ServiceExists(MS_LANGPACK_GETCODEPAGE)?CallService( MS_LANGPACK_GETCODEPAGE, 0, 0 ):CP_ACP;
-
- int cbLen = MultiByteToWideChar( codepage, 0, src, -1, NULL, 0 );
-
- LPWSTR result = (LPWSTR) mir_alloc( sizeof(WCHAR)*(cbLen+1));
- if ( result == NULL )
- return NULL;
-
- MultiByteToWideChar( codepage, 0, src, -1, result, cbLen );
- result[ cbLen ] = 0;
-
- return result;
-}
-*/
struct A2U {
LPSTR a;
LPSTR u;
diff --git a/plugins/SecureIM/commonheaders.h b/plugins/SecureIM/commonheaders.h
index a9f3e62508..cc12efdaa0 100644
--- a/plugins/SecureIM/commonheaders.h
+++ b/plugins/SecureIM/commonheaders.h
@@ -131,24 +131,12 @@ extern int TEMP_SIZE;
// shared vars
extern HINSTANCE g_hInst, g_hIconInst;
extern PLUGININFOEX pluginInfoEx;
-extern MUUID interfaces[];
#define MIID_SECUREIM {0x1B2A39E5, 0xE2F6, 0x494D, { 0x95, 0x8D, 0x18, 0x08, 0xFD, 0x11, 0x0D, 0xD5 }} //1B2A39E5-E2F6-494D-958D-1808FD110DD5
#define PREF_METANODB 0x2000 //!< Flag to indicate message should not be added to db by filter when sending
#define PREF_SIMNOMETA 0x4000 //!< Flag to indicate message should not be inspected by filter on metacontact
-#define DLLEXPORT __declspec(dllexport)
-
-extern "C" {
-
- DLLEXPORT int Load(void);
- DLLEXPORT PLUGININFOEX *MirandaPluginInfoEx(DWORD);
- DLLEXPORT MUUID* MirandaPluginInterfaces(void);
- DLLEXPORT int Unload();
-
-}
-
extern HANDLE g_hEvent[2], g_hMenu[15], g_hCLIcon, g_hFolders;
extern HANDLE *g_hService;
extern HANDLE *g_hHook;
diff --git a/plugins/SecureIM/main.cpp b/plugins/SecureIM/main.cpp
index 425a2ec08a..205a025ffe 100644
--- a/plugins/SecureIM/main.cpp
+++ b/plugins/SecureIM/main.cpp
@@ -1,9 +1,8 @@
#include "commonheaders.h"
-
int hLangpack = 0;
-extern "C" BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD dwReason, LPVOID) {
+BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD dwReason, LPVOID) {
g_hInst = hInst;
if (dwReason == DLL_PROCESS_ATTACH) {
INITCOMMONCONTROLSEX icce = {
@@ -14,17 +13,13 @@ extern "C" BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD dwReason, LPVOID) {
return TRUE;
}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_SECUREIM, MIID_LAST};
-PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) {
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+{
return &pluginInfoEx;
}
-
-MUUID* MirandaPluginInterfaces(void) {
- return interfaces;
-}
-
-
void AddServiceFunction(LPCSTR serviceName, MIRANDASERVICE serviceFunction) {
g_hService = (HANDLE*) mir_realloc(g_hService,sizeof(HANDLE)*(iService+1));
@@ -79,9 +74,8 @@ HANDLE AddSubItem(HANDLE rootid,LPCSTR name,int pos,int poppos,LPCSTR service,WP
}
-int __cdecl Load(void) {
-
-
+extern "C" __declspec(dllexport) int __cdecl Load(void)
+{
DisableThreadLibraryCalls(g_hInst);
InitializeCriticalSection(&localQueueMutex);
@@ -168,8 +162,7 @@ int __cdecl Load(void) {
return 0;
}
-
-int __cdecl Unload() {
+extern "C" __declspec(dllexport) int __cdecl Unload() {
DeleteCriticalSection(&localQueueMutex);
return 0;
}
diff --git a/plugins/SendScreenshotPlus/Main.cpp b/plugins/SendScreenshotPlus/Main.cpp
index e1c87a0239..75e5655ac5 100644
--- a/plugins/SendScreenshotPlus/Main.cpp
+++ b/plugins/SendScreenshotPlus/Main.cpp
@@ -93,10 +93,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = { MIID_PLUGIN, MIID_LAST };
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) {
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PLUGIN, MIID_LAST };
/*---------------------------------------------------------------------------
* Initializes the services provided and the link to those needed
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp
index d80f3c228f..9e3f84c8d3 100644
--- a/plugins/Sessions/Src/Main.cpp
+++ b/plugins/Sessions/Src/Main.cpp
@@ -1014,11 +1014,7 @@ static int PluginInit(WPARAM wparam,LPARAM lparam)
}
// {28EE6FE2-B005-4073-BA90-148203C807D0}
-static const MUUID interfaces[] = {{ 0x28ee6fe2, 0xb005, 0x4073, { 0xba, 0x90, 0x14, 0x82, 0x3, 0xc8, 0x7, 0xd0 } }, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {{ 0x28ee6fe2, 0xb005, 0x4073, { 0xba, 0x90, 0x14, 0x82, 0x3, 0xc8, 0x7, 0xd0 } }, MIID_LAST};
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
diff --git a/plugins/SimpleStatusMsg/main.cpp b/plugins/SimpleStatusMsg/main.cpp
index 572645f48f..7eb32be2aa 100644
--- a/plugins/SimpleStatusMsg/main.cpp
+++ b/plugins/SimpleStatusMsg/main.cpp
@@ -47,8 +47,6 @@ PLUGININFOEX pluginInfo = {
{ 0x768ce156, 0x34ac, 0x45a3, { 0xb5, 0x3b, 0x0, 0x83, 0xc4, 0x76, 0x15, 0xc4 } }
};
-static const MUUID interfaces[] = {MIID_SRAWAY, MIID_LAST};
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
g_hInst = hinstDLL;
@@ -60,10 +58,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_SRAWAY, MIID_LAST};
#ifdef _DEBUG
void log2file(const char *fmt, ...)
diff --git a/plugins/SmartAutoAway/saa.cpp b/plugins/SmartAutoAway/saa.cpp
index b48b474faa..a36e5b5981 100644
--- a/plugins/SmartAutoAway/saa.cpp
+++ b/plugins/SmartAutoAway/saa.cpp
@@ -93,7 +93,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD mirand
return MirandaPluginInfo(mirandaVersion);
}
-static const MUUID interfaces[] = {MIID_AUTOAWAY, MIID_IDLE, MIID_LAST};
+extern "C" __declspec(dllexport) const MUUID interfaces[] = {MIID_AUTOAWAY, MIID_IDLE, MIID_LAST};
extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
{
return interfaces;
diff --git a/plugins/SmartAutoAway/saani.c b/plugins/SmartAutoAway/saani.c
index 3241786c35..088a60e22e 100644
--- a/plugins/SmartAutoAway/saani.c
+++ b/plugins/SmartAutoAway/saani.c
@@ -66,7 +66,7 @@ __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD mirandaVersion)
return MirandaPluginInfo(mirandaVersion);
}
-static const MUUID interfaces[] = {MIID_IDLE, MIID_LAST};
+extern "C" __declspec(dllexport) const MUUID interfaces[] = {MIID_IDLE, MIID_LAST};
__declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
{
return interfaces;
diff --git a/plugins/SmartAutoReplier/SAR.cpp b/plugins/SmartAutoReplier/SAR.cpp
index 901ef60b69..a2617b496b 100644
--- a/plugins/SmartAutoReplier/SAR.cpp
+++ b/plugins/SmartAutoReplier/SAR.cpp
@@ -102,7 +102,7 @@ __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_CHAT, MIID_SRMM, MIID_LAST};
+extern "C" __declspec(dllexport) const MUUID interfaces[] = {MIID_CHAT, MIID_SRMM, MIID_LAST};
__declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
{
diff --git a/plugins/SmileyAdd/main.cpp b/plugins/SmileyAdd/main.cpp
index 510bdaba3c..3762b53b3d 100644
--- a/plugins/SmileyAdd/main.cpp
+++ b/plugins/SmileyAdd/main.cpp
@@ -69,12 +69,8 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD /* mira
return (PLUGININFOEX*)&pluginInfoEx;
}
-// MirandaPluginInterfaces - returns the protocol interface to the core
-static const MUUID interfaces[] = {MIID_SMILEY, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+// MirandaInterfaces - returns the protocol interface to the core
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_SMILEY, MIID_LAST};
static int ModulesLoaded(WPARAM, LPARAM)
{
diff --git a/plugins/SpellChecker/spellchecker.cpp b/plugins/SpellChecker/spellchecker.cpp
index f00d4d2d51..f11ad5b2fb 100644
--- a/plugins/SpellChecker/spellchecker.cpp
+++ b/plugins/SpellChecker/spellchecker.cpp
@@ -144,13 +144,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-
-static const MUUID interfaces[] = { MIID_SPELLCHECKER, MIID_LAST };
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
-
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SPELLCHECKER, MIID_LAST };
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/plugins/Svc_crshdmp/crshdmp.cpp b/plugins/Svc_crshdmp/crshdmp.cpp
index 067cb2f10e..72ffac7f44 100644
--- a/plugins/Svc_crshdmp/crshdmp.cpp
+++ b/plugins/Svc_crshdmp/crshdmp.cpp
@@ -67,14 +67,8 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirVers
#define MIID_CRASHDUMP { 0x36a31a50, 0xcb55, 0x46d0, { 0xab, 0x9c, 0x1e, 0xac, 0xfb, 0x24, 0x0, 0x2a } }
-// MirandaPluginInterfaces - returns the protocol interface to the core
-static const MUUID interfaces[] = { MIID_SERVICEMODE, MIID_CRASHDUMP, MIID_LAST };
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
-
-
+// MirandaInterfaces - returns the protocol interface to the core
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SERVICEMODE, MIID_CRASHDUMP, MIID_LAST };
HANDLE hHooks[5];
HANDLE hServices[6];
diff --git a/plugins/Svc_dbepp/main.cpp b/plugins/Svc_dbepp/main.cpp
index 317bba4b92..51c64d0ae7 100644
--- a/plugins/Svc_dbepp/main.cpp
+++ b/plugins/Svc_dbepp/main.cpp
@@ -41,11 +41,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
}
// we implement service mode interface
-static const MUUID interfaces[] = {MIID_SERVICEMODE, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_SERVICEMODE, MIID_LAST};
//========================
// WINAPI DllMain
diff --git a/plugins/Svc_vi/main.cpp b/plugins/Svc_vi/main.cpp
index e875f55750..c244ba2db6 100644
--- a/plugins/Svc_vi/main.cpp
+++ b/plugins/Svc_vi/main.cpp
@@ -64,12 +64,7 @@ PLUGININFOEX pluginInfo={
{0x2f174488, 0x489c, 0x4fe1, {0x94, 0x0d, 0x59, 0x6c, 0xf0, 0xf3, 0x5e, 0x65}}
};
-static const MUUID interfaces[] = {MIID_VERSIONINFO, MIID_SERVICEMODE, MIID_LAST};
-
-extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces()
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_VERSIONINFO, MIID_SERVICEMODE, MIID_LAST};
bool WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
{
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp
index b8cfaefdd9..e8a32e4d0e 100644
--- a/plugins/TabSRMM/src/srmm.cpp
+++ b/plugins/TabSRMM/src/srmm.cpp
@@ -79,12 +79,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_SRMM, MIID_CHAT, MIID_LAST};
-
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_SRMM, MIID_CHAT, MIID_LAST};
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/plugins/TipperYM/tipper.cpp b/plugins/TipperYM/tipper.cpp
index 6f59232a92..8c0f5575de 100644
--- a/plugins/TipperYM/tipper.cpp
+++ b/plugins/TipperYM/tipper.cpp
@@ -73,11 +73,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfoEx;
}
-static const MUUID interfaces[] = {MIID_TOOLTIPS, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_TOOLTIPS, MIID_LAST};
int ReloadFont(WPARAM wParam, LPARAM lParam)
{
diff --git a/plugins/TooltipNotify/src/main.cpp b/plugins/TooltipNotify/src/main.cpp
index ccb3fb128c..e14f302892 100644
--- a/plugins/TooltipNotify/src/main.cpp
+++ b/plugins/TooltipNotify/src/main.cpp
@@ -64,11 +64,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
return TRUE;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- static const MUUID interfaces[] = {MIID_TOOLTIPNOTIFY, MIID_LAST};
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_TOOLTIPNOTIFY, MIID_LAST};
static PLUGININFOEX sPluginInfo =
{
diff --git a/plugins/UserInfoEx/init.cpp b/plugins/UserInfoEx/init.cpp
index 0705c153fd..3f1553855f 100644
--- a/plugins/UserInfoEx/init.cpp
+++ b/plugins/UserInfoEx/init.cpp
@@ -206,18 +206,15 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD miranda
*
* @return array of interfaces
**/
-extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces()
-{
- static const MUUID interfaces[] = {
- MIID_UIUSERINFOEX, // this is just me
- MIID_UIUSERINFO, // replace the default userinfo module
- MIID_CONTACTINFO, // indicate, that MS_CONTACT_GETCONTACTINFO service is provided
- MIID_REMINDER, // indicate an Reminder of being provided
- MIID_SREMAIL, // Send/Receive E-Mail service is provided
- MIID_LAST
- };
- return interfaces;
-}
+
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {
+ MIID_UIUSERINFOEX, // this is just me
+ MIID_UIUSERINFO, // replace the default userinfo module
+ MIID_CONTACTINFO, // indicate, that MS_CONTACT_GETCONTACTINFO service is provided
+ MIID_REMINDER, // indicate an Reminder of being provided
+ MIID_SREMAIL, // Send/Receive E-Mail service is provided
+ MIID_LAST
+};
/**
* This function is called by Miranda just to make it possible to unload some memory, ...
diff --git a/plugins/W7UI/main.cpp b/plugins/W7UI/main.cpp
index ef95d4238e..d9c6898338 100644
--- a/plugins/W7UI/main.cpp
+++ b/plugins/W7UI/main.cpp
@@ -58,11 +58,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces(void)
-{
- static const MUUID interfaces[] = { MIID_W7UI, MIID_LAST };
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_W7UI, MIID_LAST };
extern "C" __declspec(dllexport) int Load(void)
{
diff --git a/plugins/WhenWasIt/WhenWasIt.cpp b/plugins/WhenWasIt/WhenWasIt.cpp
index c2eb1b3fb8..de77127c7e 100644
--- a/plugins/WhenWasIt/WhenWasIt.cpp
+++ b/plugins/WhenWasIt/WhenWasIt.cpp
@@ -51,12 +51,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_BIRTHDAYNOTIFY, MIID_LAST};
-
-extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces()
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_BIRTHDAYNOTIFY, MIID_LAST};
#include <commctrl.h>
diff --git a/plugins/XSoundNotify/xsn_main.cpp b/plugins/XSoundNotify/xsn_main.cpp
index 49d45e3a57..ebcf029143 100644
--- a/plugins/XSoundNotify/xsn_main.cpp
+++ b/plugins/XSoundNotify/xsn_main.cpp
@@ -66,7 +66,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_TESTPLUGIN, MIID_LAST};
+extern "C" __declspec(dllexport) const MUUID interfaces[] = {MIID_TESTPLUGIN, MIID_LAST};
extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
{
return interfaces;
diff --git a/plugins/YAPP/popups2.cpp b/plugins/YAPP/popups2.cpp
index eeef68e9b7..5c6fd9261f 100644
--- a/plugins/YAPP/popups2.cpp
+++ b/plugins/YAPP/popups2.cpp
@@ -57,12 +57,7 @@ extern "C" POPUPS2_API PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_POPUPS, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
-
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_POPUPS, MIID_LAST};
int ReloadFont(WPARAM wParam, LPARAM lParam)
{
diff --git a/plugins/testplugin/testplug.c b/plugins/testplugin/testplug.c
index 23308382bc..219f10f81e 100644
--- a/plugins/testplugin/testplug.c
+++ b/plugins/testplugin/testplug.c
@@ -47,7 +47,7 @@ __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_TESTPLUGIN, MIID_LAST};
+extern "C" __declspec(dllexport) const MUUID interfaces[] = {MIID_TESTPLUGIN, MIID_LAST};
__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
{
return interfaces;
diff --git a/protocols/AimOscar/aim.cpp b/protocols/AimOscar/aim.cpp
index 66605e2796..d69995a92c 100644
--- a/protocols/AimOscar/aim.cpp
+++ b/protocols/AimOscar/aim.cpp
@@ -74,11 +74,7 @@ extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD m
/////////////////////////////////////////////////////////////////////////////////////////
// Interface information
-static const MUUID interfaces[] = {MIID_PROTOCOL, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST};
////////////////////////////////////////////////////////////////////////////////////////
// OnModulesLoaded - finalizes plugin's configuration on load
diff --git a/protocols/FacebookRM/main.cpp b/protocols/FacebookRM/main.cpp
index ecdab519bc..beb301527e 100644
--- a/protocols/FacebookRM/main.cpp
+++ b/protocols/FacebookRM/main.cpp
@@ -69,11 +69,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
/////////////////////////////////////////////////////////////////////////////////////////
// Interface information
-static const MUUID interfaces[] = {MIID_PROTOCOL, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST};
/////////////////////////////////////////////////////////////////////////////////////////
// Load
diff --git a/protocols/Gadu-Gadu/gg.cpp b/protocols/Gadu-Gadu/gg.cpp
index 1ec516f8da..6208619fe9 100644
--- a/protocols/Gadu-Gadu/gg.cpp
+++ b/protocols/Gadu-Gadu/gg.cpp
@@ -37,7 +37,7 @@ PLUGININFOEX pluginInfo = {
// {F3FF65F3-250E-416A-BEE9-58C93F85AB33}
{ 0xf3ff65f3, 0x250e, 0x416a, { 0xbe, 0xe9, 0x58, 0xc9, 0x3f, 0x85, 0xab, 0x33 } }
};
-static const MUUID interfaces[] = {MIID_PROTOCOL, MIID_LAST};
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST};
// Other variables
HINSTANCE hInstance;
@@ -141,10 +141,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST};
//////////////////////////////////////////////////////////
// Cleanups from last plugin
diff --git a/protocols/IRCG/main.cpp b/protocols/IRCG/main.cpp
index eb79398471..ea802d43cd 100644
--- a/protocols/IRCG/main.cpp
+++ b/protocols/IRCG/main.cpp
@@ -69,12 +69,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_PROTOCOL, MIID_LAST};
-
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST};
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/IcqOscarJ/init.cpp b/protocols/IcqOscarJ/init.cpp
index 41554cd665..338c53a9a9 100644
--- a/protocols/IcqOscarJ/init.cpp
+++ b/protocols/IcqOscarJ/init.cpp
@@ -58,11 +58,7 @@ extern "C" PLUGININFOEX __declspec(dllexport) *MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-static const MUUID interfaces[] = {MIID_PROTOCOL, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST};
extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
{
diff --git a/protocols/JabberG/docs/changelog_jabber.txt b/protocols/JabberG/docs/changelog_jabber.txt
index 51b177858f..fcde5a6c8e 100644
--- a/protocols/JabberG/docs/changelog_jabber.txt
+++ b/protocols/JabberG/docs/changelog_jabber.txt
@@ -32,7 +32,7 @@ Version 0.7.0.4
Version 0.7.0.3
===============
[+] XEP-0048 support (Bookmark Storage)
-[+] Added MirandaPluginInterfaces
+[+] Added MirandaInterfaces
[+] Implement UUID plugin info
[+] added Windows Vista OS version detection
[+] added ability of sending messages to the specific resource
diff --git a/protocols/JabberG/jabber.cpp b/protocols/JabberG/jabber.cpp
index 99b3ce796b..479afdaa59 100644
--- a/protocols/JabberG/jabber.cpp
+++ b/protocols/JabberG/jabber.cpp
@@ -96,16 +96,7 @@ extern "C" BOOL WINAPI DllMain( HINSTANCE hModule, DWORD, LPVOID )
return TRUE;
}
-extern "C" __declspec( dllexport ) PLUGININFOEX *MirandaPluginInfoEx( DWORD mirandaVersion )
-{
- return &pluginInfo;
-}
-
-static const MUUID interfaces[] = {MIID_PROTOCOL, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST};
///////////////////////////////////////////////////////////////////////////////
// OnPreShutdown - prepares Miranda to be shut down
diff --git a/protocols/MRA/Mra.cpp b/protocols/MRA/Mra.cpp
index 99458125f5..e57e40d587 100644
--- a/protocols/MRA/Mra.cpp
+++ b/protocols/MRA/Mra.cpp
@@ -18,8 +18,6 @@ PLUGININFOEX pluginInfoEx={
{ 0xe7c48bab, 0x8ace, 0x4cb3, { 0x84, 0x46, 0xd4, 0xb7, 0x34, 0x81, 0xf4, 0x97 } }
};
-static const MUUID interfaces[]={MIID_PROTOCOL,MIID_LAST};
-
int OnModulesLoaded (WPARAM wParam,LPARAM lParam);
int OnPreShutdown (WPARAM wParam,LPARAM lParam);
@@ -49,18 +47,13 @@ BOOL WINAPI DllMain(HINSTANCE hInstance,DWORD dwReason,LPVOID Reserved)
return(TRUE);
}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL,MIID_LAST};
extern "C" MRA_API PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
return(&pluginInfoEx);
}
-extern "C" MRA_API const MUUID* MirandaPluginInterfaces()
-{
- return(interfaces);
-}
-
-
extern "C" MRA_API int Load(void)
{
SIZE_T dwBuffLen;
diff --git a/protocols/MSN/msn.cpp b/protocols/MSN/msn.cpp
index 9eefa6aac7..598466ba23 100644
--- a/protocols/MSN/msn.cpp
+++ b/protocols/MSN/msn.cpp
@@ -153,9 +153,6 @@ extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD m
}
/////////////////////////////////////////////////////////////////////////////////////////
-// MirandaPluginInterfaces - returns the protocol interface to the core
-static const MUUID interfaces[] = { MIID_PROTOCOL, MIID_LAST };
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+// MirandaInterfaces - returns the protocol interface to the core
+
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST };
diff --git a/protocols/NewsAggregator/Src/NewsAggregator.cpp b/protocols/NewsAggregator/Src/NewsAggregator.cpp
index 00c9fb61a4..c6d1cb735e 100644
--- a/protocols/NewsAggregator/Src/NewsAggregator.cpp
+++ b/protocols/NewsAggregator/Src/NewsAggregator.cpp
@@ -57,12 +57,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfoEx;
}
-static const MUUID interfaces[] = {{0x29517be5, 0x779a, 0x48e5, {0x89, 0x50, 0xcb, 0x4d, 0xe1, 0xd4, 0x31, 0x72}}, MIID_LAST};
-
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {{0x29517be5, 0x779a, 0x48e5, {0x89, 0x50, 0xcb, 0x4d, 0xe1, 0xd4, 0x31, 0x72}}, MIID_LAST};
extern "C" __declspec(dllexport) int Load(void)
{
diff --git a/protocols/Omegle/main.cpp b/protocols/Omegle/main.cpp
index 1e5686a316..65de0e8a90 100644
--- a/protocols/Omegle/main.cpp
+++ b/protocols/Omegle/main.cpp
@@ -69,11 +69,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
/////////////////////////////////////////////////////////////////////////////////////////
// Interface information
-static const MUUID interfaces[] = {MIID_PROTOCOL, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST};
/////////////////////////////////////////////////////////////////////////////////////////
// Load
diff --git a/protocols/Quotes/Forex.cpp b/protocols/Quotes/Forex.cpp
index 4c5b1f1ca2..05d1ecaabb 100644
--- a/protocols/Quotes/Forex.cpp
+++ b/protocols/Quotes/Forex.cpp
@@ -400,13 +400,9 @@ extern "C"
}
-#define MIID_QUOTES {0x723243c2, 0x8d4b, 0x4c29, { 0x8a, 0x37, 0xc0, 0x11, 0x48, 0x65, 0xb0, 0x80}}
+ #define MIID_QUOTES {0x723243c2, 0x8d4b, 0x4c29, { 0x8a, 0x37, 0xc0, 0x11, 0x48, 0x65, 0xb0, 0x80}}
- __declspec(dllexport) const MUUID* MirandaPluginInterfaces()
- {
- static const MUUID interfaces[] = {MIID_PROTOCOL,MIID_QUOTES,MIID_LAST};
- return interfaces;
- }
+ __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL,MIID_QUOTES,MIID_LAST};
int __declspec(dllexport) Load(void)
{
diff --git a/protocols/Tlen/tlen.c b/protocols/Tlen/tlen.c
index 027e7add2e..2f8d860a64 100644
--- a/protocols/Tlen/tlen.c
+++ b/protocols/Tlen/tlen.c
@@ -106,7 +106,7 @@ __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx( DWORD mirandaVersion )
return &pluginInfoEx;
}
-static const MUUID interfaces[] = {MIID_PROTOCOL, MIID_LAST};
+extern "C" __declspec(dllexport) const MUUID interfaces[] = {MIID_PROTOCOL, MIID_LAST};
__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
{
return interfaces;
diff --git a/protocols/Tlen/tlen_czaty/mucc.cpp b/protocols/Tlen/tlen_czaty/mucc.cpp
index 46b0155d70..e5c35c070a 100644
--- a/protocols/Tlen/tlen_czaty/mucc.cpp
+++ b/protocols/Tlen/tlen_czaty/mucc.cpp
@@ -84,7 +84,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD miranda
#define MIID_TLEN_MUCC { 0xba658997, 0x0bce, 0x4f96, { 0xba, 0x48, 0x54, 0x55, 0x34, 0x16, 0x73, 0xea } }
#endif
-static const MUUID interfaces[] = {
+extern "C" __declspec(dllexport) const MUUID interfaces[] = {
MIID_TLEN_MUCC,
MIID_LAST
};
diff --git a/protocols/Twitter/main.cpp b/protocols/Twitter/main.cpp
index 9972de9236..0987de5963 100644
--- a/protocols/Twitter/main.cpp
+++ b/protocols/Twitter/main.cpp
@@ -65,11 +65,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
/////////////////////////////////////////////////////////////////////////////////////////
// Interface information
-static const MUUID interfaces[] = {MIID_PROTOCOL, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST};
/////////////////////////////////////////////////////////////////////////////////////////
// Load
diff --git a/protocols/Weather/weather.cpp b/protocols/Weather/weather.cpp
index d0527b794e..9c6f762683 100644
--- a/protocols/Weather/weather.cpp
+++ b/protocols/Weather/weather.cpp
@@ -81,12 +81,8 @@ extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD m
return &pluginInfoEx;
}
-// MirandaPluginInterfaces - returns the protocol interface to the core
-static const MUUID interfaces[] = {MIID_PROTOCOL, MIID_LAST};
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+// MirandaInterfaces - returns the protocol interface to the core
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST};
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
diff --git a/protocols/YAMN/main.cpp b/protocols/YAMN/main.cpp
index 2dd7f050b6..7e55eb236a 100644
--- a/protocols/YAMN/main.cpp
+++ b/protocols/YAMN/main.cpp
@@ -157,12 +157,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
/////////////////////////////////////////////////////////////////////////////////////////
-static const MUUID interfaces[] = {MUUID_YAMN_FORCECHECK, MIID_LAST};
-
-extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MUUID_YAMN_FORCECHECK, MIID_LAST};
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/Yahoo/main.cpp b/protocols/Yahoo/main.cpp
index 74f5285461..bb66cf0206 100644
--- a/protocols/Yahoo/main.cpp
+++ b/protocols/Yahoo/main.cpp
@@ -146,12 +146,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
}
/*
- * MirandaPluginInterfaces - Notifies the core of interfaces implemented
+ * MirandaInterfaces - Notifies the core of interfaces implemented
* Parameters: none
*/
-static const MUUID interfaces[] = {MIID_PROTOCOL, MIID_LAST};
-
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST};
diff --git a/src/core/stdauth/main.cpp b/src/core/stdauth/main.cpp
index ae1c5de1d0..a0d800ccae 100644
--- a/src/core/stdauth/main.cpp
+++ b/src/core/stdauth/main.cpp
@@ -40,8 +40,6 @@ PLUGININFOEX pluginInfo = {
{ 0x8d0a046d, 0x8ea9, 0x4c55, {0xb5, 0x68, 0x38, 0xda, 0x52, 0x05, 0x64, 0xfd}}
};
-static const MUUID interfaces[] = { MIID_SRAUTH, MIID_LAST };
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInst = hinstDLL;
@@ -53,10 +51,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SRAUTH, MIID_LAST };
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/src/core/stdautoaway/main.cpp b/src/core/stdautoaway/main.cpp
index ed5cea618c..b4bf3a5fd6 100644
--- a/src/core/stdautoaway/main.cpp
+++ b/src/core/stdautoaway/main.cpp
@@ -40,8 +40,6 @@ PLUGININFOEX pluginInfo = {
{ 0x9f5ca736, 0x1108, 0x4872, {0xbe, 0xc3, 0x19, 0xc8, 0x4b, 0xc2, 0x14, 0x3b}}
};
-static const MUUID interfaces[] = { MIID_AUTOAWAY, MIID_LAST };
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInst = hinstDLL;
@@ -53,10 +51,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_AUTOAWAY, MIID_LAST };
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/src/core/stdaway/main.cpp b/src/core/stdaway/main.cpp
index 7b9b12772d..ec8ed4b101 100644
--- a/src/core/stdaway/main.cpp
+++ b/src/core/stdaway/main.cpp
@@ -41,8 +41,6 @@ PLUGININFOEX pluginInfo = {
{ 0xe58558e3, 0x83e7, 0x44ef, {0x8e, 0x39, 0xd9, 0xe0, 0x54, 0x19, 0x56, 0xdf}}
};
-static const MUUID interfaces[] = { MIID_SRAWAY, MIID_LAST };
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInst = hinstDLL;
@@ -54,10 +52,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SRAWAY, MIID_LAST };
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/src/core/stdemail/main.cpp b/src/core/stdemail/main.cpp
index 62deebb5b7..211bf4f4f5 100644
--- a/src/core/stdemail/main.cpp
+++ b/src/core/stdemail/main.cpp
@@ -40,8 +40,6 @@ PLUGININFOEX pluginInfo = {
{0xb774d10a, 0xc761, 0x11e1, {0x84, 0x05, 0x27, 0xe7, 0x61, 0x88, 0x70, 0x9b }}
};
-static const MUUID interfaces[] = { MIID_SREMAIL, MIID_LAST };
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInst = hinstDLL;
@@ -53,10 +51,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SREMAIL, MIID_LAST };
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/src/core/stdfile/main.cpp b/src/core/stdfile/main.cpp
index 9a7330b7db..84d93121c1 100644
--- a/src/core/stdfile/main.cpp
+++ b/src/core/stdfile/main.cpp
@@ -45,8 +45,6 @@ PLUGININFOEX pluginInfo = {
{ 0x39698dce, 0x7ed4, 0x4334, {0xac, 0x4c, 0xba, 0x8b, 0x37, 0xa8, 0x6f, 0x13}}
};
-static const MUUID interfaces[] = { MIID_SRFILE, MIID_LAST };
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInst = hinstDLL;
@@ -58,10 +56,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SRFILE, MIID_LAST };
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/src/core/stdhelp/main.cpp b/src/core/stdhelp/main.cpp
index 9760bac441..d3c4c96ab6 100644
--- a/src/core/stdhelp/main.cpp
+++ b/src/core/stdhelp/main.cpp
@@ -42,8 +42,6 @@ PLUGININFOEX pluginInfo = {
{ 0x1e64fd80, 0x299e, 0x48a0, {0x94, 0x41, 0xde, 0x28, 0x68, 0x56, 0x3b, 0x6f}}
};
-static const MUUID interfaces[] = { MIID_UIHELP, MIID_LAST };
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInst = hinstDLL;
@@ -55,10 +53,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_UIHELP, MIID_LAST };
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/src/core/stdidle/main.cpp b/src/core/stdidle/main.cpp
index 6845f61813..2db8f102d1 100644
--- a/src/core/stdidle/main.cpp
+++ b/src/core/stdidle/main.cpp
@@ -48,8 +48,6 @@ PLUGININFOEX pluginInfo = {
{ 0x53ac190b, 0xe223, 0x4341, {0x82, 0x5f, 0x70, 0x9d, 0x85, 0x20, 0x21, 0x5b}}
};
-static const MUUID interfaces[] = { MIID_IDLE, MIID_LAST };
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInst = hinstDLL;
@@ -61,10 +59,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_IDLE, MIID_LAST };
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/src/core/stduihist/main.cpp b/src/core/stduihist/main.cpp
index 1bb467ada7..8c68f49529 100644
--- a/src/core/stduihist/main.cpp
+++ b/src/core/stduihist/main.cpp
@@ -42,8 +42,6 @@ PLUGININFOEX pluginInfo = {
{ 0x5eedf3c5, 0x3071, 0x4234, {0xa6, 0x27, 0xef, 0xd0, 0x62, 0xa4, 0xd6, 0x94}}
};
-static const MUUID interfaces[] = { MIID_UIHISTORY, MIID_LAST };
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInst = hinstDLL;
@@ -55,10 +53,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_UIHISTORY, MIID_LAST };
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/src/core/stdurl/main.cpp b/src/core/stdurl/main.cpp
index 183ba8f3ff..fa2cbb0474 100644
--- a/src/core/stdurl/main.cpp
+++ b/src/core/stdurl/main.cpp
@@ -42,8 +42,6 @@ PLUGININFOEX pluginInfo = {
{ 0x0ca63eee, 0xeb2c, 0x4aed, {0xb3, 0xd0, 0xbc, 0x8e, 0x6e, 0xb3, 0xbf, 0xb8}}
};
-static const MUUID interfaces[] = { MIID_SRURL, MIID_LAST };
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInst = hinstDLL;
@@ -55,10 +53,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SRURL, MIID_LAST };
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/src/core/stduserinfo/main.cpp b/src/core/stduserinfo/main.cpp
index 0dc541834a..0d24ab924d 100644
--- a/src/core/stduserinfo/main.cpp
+++ b/src/core/stduserinfo/main.cpp
@@ -45,8 +45,6 @@ PLUGININFOEX pluginInfo = {
{0x8198dc94, 0xbc4, 0x448a, {0x84, 0x95, 0x8f, 0xe8, 0x32, 0xc1, 0xd3, 0x33 }}
};
-static const MUUID interfaces[] = {MIID_UIUSERINFO, MIID_LAST};
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInst = hinstDLL;
@@ -58,10 +56,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_UIUSERINFO, MIID_LAST};
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/src/core/stduseronline/main.cpp b/src/core/stduseronline/main.cpp
index a69942c6c0..783a0c7d65 100644
--- a/src/core/stduseronline/main.cpp
+++ b/src/core/stduseronline/main.cpp
@@ -41,8 +41,6 @@ PLUGININFOEX pluginInfo = {
{ 0x251c78d7, 0xf6e0, 0x4083, {0x92, 0xdc, 0x25, 0x2d, 0xcb, 0x3b, 0xe7, 0x24}}
};
-static const MUUID interfaces[] = { MIID_USERONLINE, MIID_LAST };
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInst = hinstDLL;
@@ -54,10 +52,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_USERONLINE, MIID_LAST };
extern "C" int __declspec(dllexport) Load(void)
{
diff --git a/src/miranda32_10.vcxproj b/src/miranda32_10.vcxproj
index 12ee6ef476..5b817e1d8e 100644
--- a/src/miranda32_10.vcxproj
+++ b/src/miranda32_10.vcxproj
@@ -407,6 +407,9 @@
<ClCompile Include="modules\options\options.cpp">
<PrecompiledHeaderFile>..\..\core\commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
+ <ClCompile Include="modules\plugins\dll_sniffer.cpp">
+ <PrecompiledHeaderFile>..\..\core\commonheaders.h</PrecompiledHeaderFile>
+ </ClCompile>
<ClCompile Include="modules\plugins\newplugins.cpp">
<PrecompiledHeaderFile>..\..\core\commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
diff --git a/src/miranda32_10.vcxproj.filters b/src/miranda32_10.vcxproj.filters
index a8de3311a0..90c60ffac7 100644
--- a/src/miranda32_10.vcxproj.filters
+++ b/src/miranda32_10.vcxproj.filters
@@ -560,6 +560,9 @@
<ClCompile Include="modules\utils\utils.cpp">
<Filter>Modules\utils</Filter>
</ClCompile>
+ <ClCompile Include="modules\plugins\dll_sniffer.cpp">
+ <Filter>Modules\plugins</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="res\_blank.ico">
diff --git a/src/modules/plugins/dll_sniffer.cpp b/src/modules/plugins/dll_sniffer.cpp
new file mode 100644
index 0000000000..469cebf931
--- /dev/null
+++ b/src/modules/plugins/dll_sniffer.cpp
@@ -0,0 +1,150 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2010 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+#include "..\..\core\commonheaders.h"
+#include "plugins.h"
+
+static IMAGE_SECTION_HEADER *getSectionByRVA(IMAGE_SECTION_HEADER *pISH, int nSections, IMAGE_DATA_DIRECTORY *pIDD)
+{
+ for (int i=0; i < nSections; i++, pISH++)
+ if (pIDD->VirtualAddress >= pISH->VirtualAddress && pIDD->VirtualAddress + pIDD->Size <= pISH->VirtualAddress + pISH->SizeOfRawData )
+ return pISH;
+
+ return NULL;
+}
+
+MUUID* GetPluginInterfaces(const TCHAR* ptszFileName, bool& bIsPlugin)
+{
+ bIsPlugin = false;
+
+ HANDLE hFile = CreateFile( ptszFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL );
+ if (hFile == INVALID_HANDLE_VALUE)
+ return NULL;
+
+ MUUID* pResult = NULL;
+ BYTE* ptr = NULL;
+ HANDLE hMap = CreateFileMapping( hFile, NULL, PAGE_WRITECOPY, 0, 0, NULL );
+
+ __try
+ {
+ if ( !hMap )
+ __leave;
+
+ DWORD dwHSize = 0, filesize = GetFileSize( hFile, &dwHSize );
+ if ( !filesize || filesize == INVALID_FILE_SIZE || dwHSize)
+ __leave;
+
+ if ( filesize < sizeof(IMAGE_DOS_HEADER) + sizeof(IMAGE_NT_HEADERS) )
+ __leave;
+
+ ptr = (BYTE*)MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0);
+ if (ptr == NULL)
+ __leave;
+
+ PIMAGE_NT_HEADERS pINTH;
+ PIMAGE_DOS_HEADER pIDH = (PIMAGE_DOS_HEADER)ptr;
+ if ( pIDH->e_magic == IMAGE_DOS_SIGNATURE )
+ pINTH = (PIMAGE_NT_HEADERS)(ptr + pIDH->e_lfanew);
+ else
+ __leave;
+
+ if ((PBYTE)pINTH + sizeof(IMAGE_NT_HEADERS) >= ptr + filesize )
+ __leave;
+ if ( pINTH->Signature != IMAGE_NT_SIGNATURE )
+ __leave;
+
+ int nSections = pINTH->FileHeader.NumberOfSections;
+ if ( !nSections )
+ __leave;
+
+ INT_PTR base;
+ PIMAGE_DATA_DIRECTORY pIDD;
+ if ( pINTH->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 &&
+ pINTH->FileHeader.SizeOfOptionalHeader >= sizeof(IMAGE_OPTIONAL_HEADER32) &&
+ pINTH->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC)
+ {
+ pIDD = (PIMAGE_DATA_DIRECTORY)( (PBYTE)pINTH + offsetof( IMAGE_NT_HEADERS32, OptionalHeader.DataDirectory ));
+ base = *(DWORD*)((PBYTE)pINTH + offsetof(IMAGE_NT_HEADERS32, OptionalHeader.ImageBase));
+ }
+ else if ( pINTH->FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64 &&
+ pINTH->FileHeader.SizeOfOptionalHeader >= sizeof(IMAGE_OPTIONAL_HEADER64) &&
+ pINTH->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC)
+ {
+ pIDD = (PIMAGE_DATA_DIRECTORY)( (PBYTE)pINTH + offsetof( IMAGE_NT_HEADERS64, OptionalHeader.DataDirectory ));
+ base = *(ULONGLONG*)((PBYTE)pINTH + offsetof(IMAGE_NT_HEADERS64, OptionalHeader.ImageBase ));
+ }
+ else __leave;
+
+ // Export information entry
+ DWORD expvaddr = pIDD[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
+ DWORD expsize = pIDD[IMAGE_DIRECTORY_ENTRY_EXPORT].Size;
+ if (expsize < sizeof(IMAGE_EXPORT_DIRECTORY)) __leave;
+
+ BYTE* pImage = ptr + pIDH->e_lfanew + pINTH->FileHeader.SizeOfOptionalHeader + sizeof(IMAGE_NT_HEADERS) - sizeof(IMAGE_OPTIONAL_HEADER);
+ IMAGE_SECTION_HEADER *pExp = getSectionByRVA((IMAGE_SECTION_HEADER *)pImage, nSections, pIDD);
+ if ( !pExp) __leave;
+
+ BYTE *pSecStart = ptr + pExp->PointerToRawData - pExp->VirtualAddress;
+ IMAGE_EXPORT_DIRECTORY *pED = (PIMAGE_EXPORT_DIRECTORY)&pSecStart[expvaddr];
+ DWORD *ptrRVA = (DWORD*)&pSecStart[pED->AddressOfNames];
+ WORD *ptrOrdRVA = (WORD*)&pSecStart[pED->AddressOfNameOrdinals];
+ DWORD *ptrFuncList = (DWORD*)&pSecStart[pED->AddressOfFunctions];
+
+ MUUID* pIds;
+ bool bHasLoad = false, bHasUnload = false, bHasInfo = false, bHasMuuids = false;
+ for (size_t i=0; i < pED->NumberOfNames; i++, ptrRVA++, ptrOrdRVA++) {
+ char *szName = (char*)&pSecStart[*ptrRVA];
+ if ( !lstrcmpA(szName, "Load"))
+ bHasLoad = true;
+ if ( !lstrcmpA(szName, "MirandaPluginInfoEx"))
+ bHasInfo = true;
+ else if ( !lstrcmpA(szName, "Unload"))
+ bHasUnload = true;
+ else if ( !lstrcmpA(szName, "MirandaInterfaces")) {
+ bHasMuuids = true;
+ pIds = (MUUID*)&pSecStart[ ptrFuncList[*ptrOrdRVA]];
+ }
+ }
+
+ // a plugin might have no interfaces
+ if (bHasLoad && bHasUnload && bHasInfo)
+ bIsPlugin = true;
+
+ if (!bHasLoad || !bHasMuuids || !bHasUnload)
+ __leave;
+
+ int nLength = 1; // one for MIID_LAST
+ for (MUUID* p = pIds; !equalUUID(*p, miid_last); p++)
+ nLength++;
+
+ pResult = (MUUID*)mir_alloc( sizeof(MUUID)*nLength);
+ if (pResult)
+ memcpy(pResult, pIds, sizeof(MUUID)*nLength);
+ }
+ __finally
+ {
+ UnmapViewOfFile(ptr);
+ CloseHandle(hFile);
+ };
+
+ return pResult;
+}
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp
index 9712f01d07..3c27b63f22 100644
--- a/src/modules/plugins/newplugins.cpp
+++ b/src/modules/plugins/newplugins.cpp
@@ -91,14 +91,24 @@ int equalUUID(const MUUID& u1, const MUUID& u2)
return memcmp(&u1, &u2, sizeof(MUUID))?0:1;
}
+bool hasMuuid(const MUUID* p, const MUUID& uuid)
+{
+ if (p == NULL)
+ return false;
+
+ for (int i=0; !equalUUID(miid_last, p[i]); i++)
+ if ( equalUUID(uuid, p[i]))
+ return true;
+
+ return false;
+}
+
+
bool hasMuuid(const BASIC_PLUGIN_INFO& bpi, const MUUID& uuid)
{
- if (bpi.Interfaces) {
- MUUID *piface = bpi.Interfaces();
- for (int i=0; !equalUUID(miid_last, piface[i]); i++)
- if ( equalUUID(uuid, piface[i]))
- return true;
- }
+ if (bpi.Interfaces)
+ return hasMuuid(bpi.Interfaces, uuid);
+
return false;
}
@@ -162,13 +172,8 @@ MUUID miid_clist = MIID_CLIST;
MUUID miid_database = MIID_DATABASE;
MUUID miid_servicemode = MIID_SERVICEMODE;
-static bool validInterfaceList(Miranda_Plugin_Interfaces ifaceProc)
+static bool validInterfaceList(MUUID *piface)
{
- // we don't need'em anymore in the common case
- if (ifaceProc == NULL)
- return true;
-
- MUUID *piface = ifaceProc();
if (piface == NULL)
return false;
@@ -256,7 +261,7 @@ int checkAPI(TCHAR* plugin, BASIC_PLUGIN_INFO* bpi, DWORD mirandaVersion, int ch
bpi->Load = (Miranda_Plugin_Load) GetProcAddress(h, "Load");
bpi->Unload = (Miranda_Plugin_Unload) GetProcAddress(h, "Unload");
bpi->InfoEx = (Miranda_Plugin_InfoEx) GetProcAddress(h, "MirandaPluginInfoEx");
- bpi->Interfaces = (Miranda_Plugin_Interfaces) GetProcAddress(h, "MirandaPluginInterfaces");
+ bpi->Interfaces = (MUUID*) GetProcAddress(h, "MirandaInterfaces");
// if they were present
if ( !bpi->Load || !bpi->Unload || !bpi->InfoEx) {
@@ -367,42 +372,6 @@ static int valid_library_name(TCHAR *name)
return 0;
}
-// returns true if the given file matches dbx_*.dll, which is used to LoadLibrary()
-static int validguess_db_name(TCHAR *name)
-{
- int rc = 0;
- // this is ONLY SAFE because name -> ffd.cFileName == MAX_PATH
- TCHAR x = name[4];
- name[4] = 0;
- rc = lstrcmpi(name, _T("dbx_")) == 0 || lstrcmpi(name, _T("dbrw")) == 0;
- name[4] = x;
- return rc;
-}
-
-// returns true if the given file matches clist_*.dll
-static int validguess_clist_name(TCHAR *name)
-{
- int rc = 0;
- // argh evil
- TCHAR x = name[6];
- name[6] = 0;
- rc = lstrcmpi(name, _T("clist_")) == 0;
- name[6] = x;
- return rc;
-}
-
-// returns true if the given file matches svc_*.dll
-static int validguess_servicemode_name(TCHAR *name)
-{
- int rc = 0;
- // argh evil
- TCHAR x = name[4];
- name[4] = 0;
- rc = lstrcmpi(name, _T("svc_")) == 0;
- name[4] = x;
- return rc;
-}
-
void enumPlugins(SCAN_PLUGINS_CALLBACK cb, WPARAM wParam, LPARAM lParam)
{
// get miranda's exe path
@@ -456,16 +425,27 @@ static INT_PTR PluginsEnum(WPARAM, LPARAM lParam)
pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path)
{
- BASIC_PLUGIN_INFO bpi;
pluginEntry* p = (pluginEntry*)HeapAlloc(hPluginListHeap, HEAP_NO_SERIALIZE | HEAP_ZERO_MEMORY, sizeof(pluginEntry));
_tcsncpy(p->pluginname, tszFileName, SIZEOF(p->pluginname));
- TCHAR buf[MAX_PATH];
- mir_sntprintf(buf, SIZEOF(buf), _T("%s\\%s\\%s"), path, dir, tszFileName);
+ // add it to the list anyway
+ pluginList.insert(p);
+
+ TCHAR tszFullPath[MAX_PATH];
+ mir_sntprintf(tszFullPath, SIZEOF(tszFullPath), _T("%s\\%s\\%s"), path, dir, tszFileName);
+
+ // map dll into the memory and check its exports
+ bool bIsPlugin = false;
+ mir_ptr<MUUID> pIds( GetPluginInterfaces(tszFullPath, bIsPlugin));
+ if ( !bIsPlugin) {
+ p->pclass |= PCLASS_FAILED; // piece of shit
+ return p;
+ }
- // plugin name suggests its a db module, load it right now
- if ( validguess_db_name(tszFileName)) {
- if (checkAPI(buf, &bpi, mirandaVersion, CHECKAPI_DB)) {
+ // plugin declared that it's a database. load it asap!
+ if ( hasMuuid(pIds, miid_database)) {
+ BASIC_PLUGIN_INFO bpi;
+ if (checkAPI(tszFullPath, &bpi, mirandaVersion, CHECKAPI_DB)) {
// db plugin is valid
p->pclass |= (PCLASS_DB | PCLASS_BASICAPI);
// copy the dblink stuff
@@ -478,14 +458,18 @@ pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path)
// didn't have basic APIs or DB exports - failed.
p->pclass |= PCLASS_FAILED;
}
- else if ( validguess_clist_name(tszFileName)) {
+ // plugin declared that it's a contact list. mark it for the future load
+ else if ( hasMuuid(pIds, miid_clist)) {
// keep a note of this plugin for later
if (pluginListUI != NULL) p->nextclass = pluginListUI;
pluginListUI = p;
p->pclass |= PCLASS_CLIST;
}
- else if ( validguess_servicemode_name(tszFileName)) {
- if (checkAPI(buf, &bpi, mirandaVersion, CHECKAPI_NONE)) {
+ // plugin declared that it's a service mode plugin.
+ // load it for a profile manager's window
+ else if ( hasMuuid(pIds, miid_servicemode)) {
+ BASIC_PLUGIN_INFO bpi;
+ if (checkAPI(tszFullPath, &bpi, mirandaVersion, CHECKAPI_NONE)) {
p->pclass |= (PCLASS_OK | PCLASS_BASICAPI);
p->bpi = bpi;
if ( hasMuuid(bpi, miid_servicemode)) {
@@ -499,28 +483,9 @@ pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path)
// didn't have basic APIs or DB exports - failed.
p->pclass |= PCLASS_FAILED;
}
-
- // add it to the list
- pluginList.insert(p);
return p;
}
-// called in the first pass to create pluginEntry* structures and validate database plugins
-static BOOL scanPluginsDir(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM)
-{
- pluginEntry* p = OpenPlugin(fd->cFileName, _T("Plugins"), path);
- if ( !(p->pclass & PCLASS_FAILED)) {
- if (pluginList_freeimg == NULL && lstrcmpi(fd->cFileName, _T("advaimg.dll")) == 0)
- pluginList_freeimg = p;
-
- if (pluginList_crshdmp == NULL && lstrcmpi(fd->cFileName, _T("svc_crshdmp.dll")) == 0) {
- pluginList_crshdmp = p;
- p->pclass |= PCLASS_LAST;
- }
- }
-
- return TRUE;
-}
void SetPluginOnWhiteList(const TCHAR* pluginname, int allow)
{
@@ -572,7 +537,7 @@ bool TryLoadPlugin(pluginEntry *p, bool bDynamic)
p->pclass |= PCLASS_OK | PCLASS_BASICAPI;
if (p->bpi.Interfaces) {
- MUUID *piface = bpi.Interfaces();
+ MUUID *piface = bpi.Interfaces;
for (int i=0; !equalUUID(miid_last, piface[i]); i++) {
int idx = getDefaultPluginIdx( piface[i] );
if (idx != -1 && pluginDefault[idx].pImpl) {
@@ -591,7 +556,7 @@ bool TryLoadPlugin(pluginEntry *p, bool bDynamic)
p->pclass |= PCLASS_LOADED;
if (p->bpi.Interfaces) {
- MUUID *piface = bpi.Interfaces();
+ MUUID *piface = bpi.Interfaces;
for (int i=0; !equalUUID(miid_last, piface[i]); i++) {
int idx = getDefaultPluginIdx( piface[i] );
if (idx != -1)
@@ -744,7 +709,6 @@ void UnloadNewPlugins(void)
} }
/////////////////////////////////////////////////////////////////////////////////////////
-//
// Loads all plugins
int LoadNewPluginsModule(void)
@@ -827,6 +791,22 @@ int LoadNewPluginsModule(void)
// Plugins module initialization
// called before anything real is loaded, incl. database
+static BOOL scanPluginsDir(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM)
+{
+ pluginEntry* p = OpenPlugin(fd->cFileName, _T("Plugins"), path);
+ if ( !(p->pclass & PCLASS_FAILED)) {
+ if (pluginList_freeimg == NULL && lstrcmpi(fd->cFileName, _T("advaimg.dll")) == 0)
+ pluginList_freeimg = p;
+
+ if (pluginList_crshdmp == NULL && lstrcmpi(fd->cFileName, _T("svc_crshdmp.dll")) == 0) {
+ pluginList_crshdmp = p;
+ p->pclass |= PCLASS_LAST;
+ }
+ }
+
+ return TRUE;
+}
+
int LoadNewPluginsModuleInfos(void)
{
bModuleInitialized = TRUE;
@@ -855,14 +835,13 @@ int LoadNewPluginsModuleInfos(void)
void UnloadNewPluginsModule(void)
{
- int i;
-
- if ( !bModuleInitialized) return;
+ if ( !bModuleInitialized)
+ return;
UnloadPluginOptions();
// unload everything but the DB
- for (i = pluginList.getCount()-1; i >= 0; i--) {
+ for (int i = pluginList.getCount()-1; i >= 0; i--) {
pluginEntry* p = pluginList[i];
if ( !(p->pclass & PCLASS_DB) && p != pluginList_crshdmp)
Plugin_Uninit(p);
@@ -872,8 +851,8 @@ void UnloadNewPluginsModule(void)
Plugin_Uninit(pluginList_crshdmp);
// unload the DB
- for (i = pluginList.getCount()-1; i >= 0; i--) {
- pluginEntry* p = pluginList[i];
+ for (int k = pluginList.getCount()-1; k >= 0; k--) {
+ pluginEntry* p = pluginList[k];
Plugin_Uninit(p);
}
diff --git a/src/modules/plugins/pluginopts.cpp b/src/modules/plugins/pluginopts.cpp
index 45d8080d98..0b0f8ab821 100644
--- a/src/modules/plugins/pluginopts.cpp
+++ b/src/modules/plugins/pluginopts.cpp
@@ -89,7 +89,7 @@ static BOOL dialogListPlugins(WIN32_FIND_DATA* fd, TCHAR* path, WPARAM, LPARAM l
dat->flags = 0;
if (pi.Interfaces) {
- MUUID *piface = pi.Interfaces();
+ MUUID *piface = pi.Interfaces;
for (int i=0; !equalUUID(miid_last, piface[i]); i++) {
int idx = getDefaultPluginIdx( piface[i] );
if (idx != -1 ) {
diff --git a/src/modules/plugins/plugins.h b/src/modules/plugins/plugins.h
index 6cfa8595c7..64118a45ed 100644
--- a/src/modules/plugins/plugins.h
+++ b/src/modules/plugins/plugins.h
@@ -17,8 +17,6 @@ typedef PLUGININFOEX * (__cdecl * Miranda_Plugin_InfoEx) (DWORD mirandaVersion);
typedef DATABASELINK * (__cdecl * Database_Plugin_Info) (void * reserved);
// prototype for clists
typedef int (__cdecl * CList_Initialise) (void);
-// Interface support
-typedef MUUID * (__cdecl * Miranda_Plugin_Interfaces) (void);
// can all be NULL
struct BASIC_PLUGIN_INFO
@@ -27,10 +25,10 @@ struct BASIC_PLUGIN_INFO
Miranda_Plugin_Load Load;
Miranda_Plugin_Unload Unload;
Miranda_Plugin_InfoEx InfoEx;
- Miranda_Plugin_Interfaces Interfaces;
Database_Plugin_Info DbInfo;
CList_Initialise clistlink;
PLUGININFOEX * pluginInfo; // must be freed if hInst = = NULL then its a copy
+ MUUID *Interfaces; // array of supported interfaces
DATABASELINK * dblink; // only valid during module being in memory
};
@@ -66,6 +64,7 @@ void SetPluginOnWhiteList(const TCHAR* pluginname, int allow);
int getDefaultPluginIdx(const MUUID& muuid);
bool hasMuuid(const BASIC_PLUGIN_INFO&, const MUUID&);
+bool hasMuuid(const MUUID* pFirst, const MUUID&);
int equalUUID(const MUUID& u1, const MUUID& u2);
int checkAPI(TCHAR* plugin, BASIC_PLUGIN_INFO* bpi, DWORD mirandaVersion, int checkTypeAPI);
@@ -88,3 +87,5 @@ struct MuuidReplacement
extern MuuidReplacement pluginDefault[];
bool LoadCorePlugin( MuuidReplacement& );
+
+MUUID* GetPluginInterfaces(const TCHAR* ptszFileName, bool& bIsPlugin); \ No newline at end of file