summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-03-25 15:32:16 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-03-25 15:32:16 +0300
commitacdaebe9729b0d50168ff51657f1b8220302d82a (patch)
tree436c55d1add00175ed393dbaebad253da7ccc84c
parent5623e34833d5e973f2c9897cd022d5ca6270904c (diff)
ME_SYSTEM_MODULELOAD & ME_SYSTEM_MODULEUNLOAD: handier parameter passing
-rw-r--r--include/newpluginapi.h4
-rw-r--r--plugins/Clist_modern/src/modern_toolbar.cpp4
-rw-r--r--plugins/Clist_nicer/src/CLCButton.cpp4
-rw-r--r--plugins/TopToolBar/src/toolbar.cpp4
-rw-r--r--src/mir_app/src/newplugins.cpp4
-rw-r--r--src/mir_app/src/pluginopts.cpp2
6 files changed, 11 insertions, 11 deletions
diff --git a/include/newpluginapi.h b/include/newpluginapi.h
index b165a51cd8..97ef743701 100644
--- a/include/newpluginapi.h
+++ b/include/newpluginapi.h
@@ -129,7 +129,7 @@ struct PLUGININFOEX
/////////////////////////////////////////////////////////////////////////////////////////
// Miranda/System/LoadModule event
// called when a plugin is being loaded dynamically
-// wParam = PLUGININFOEX*
+// wParam = CMPluginBase*
// lParam = HINSTANCE of the loaded plugin
#define ME_SYSTEM_MODULELOAD "Miranda/System/LoadModule"
@@ -137,7 +137,7 @@ struct PLUGININFOEX
/////////////////////////////////////////////////////////////////////////////////////////
// Miranda/System/UnloadModule event
// called when a plugin is being unloaded dynamically
-// wParam = PLUGININFOEX*
+// wParam = CMPluginBase*
// lParam = HINSTANCE of the plugin to be unloaded
#define ME_SYSTEM_MODULEUNLOAD "Miranda/System/UnloadModule"
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp
index 763cfc91f6..62d18be1a6 100644
--- a/plugins/Clist_modern/src/modern_toolbar.cpp
+++ b/plugins/Clist_modern/src/modern_toolbar.cpp
@@ -312,8 +312,8 @@ void CustomizeButton(HANDLE ttbid, HWND hWnd, LPARAM lParam);
static int Toolbar_ModuleReloaded(WPARAM wParam, LPARAM)
{
- PLUGININFOEX *pInfo = (PLUGININFOEX*)wParam;
- if (!mir_strcmpi(pInfo->shortName, "TopToolBar"))
+ auto &pInfo = HPLUGIN(wParam)->getInfo();
+ if (!mir_strcmpi(pInfo.shortName, "TopToolBar"))
TopToolbar_SetCustomProc(CustomizeButton, 0);
return 0;
diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp
index aefe2bb6bf..b046a55ffc 100644
--- a/plugins/Clist_nicer/src/CLCButton.cpp
+++ b/plugins/Clist_nicer/src/CLCButton.cpp
@@ -604,8 +604,8 @@ static int Nicer_CustomizeToolbar(WPARAM, LPARAM)
static int Nicer_ReloadToolbar(WPARAM wParam, LPARAM)
{
- PLUGININFOEX *pInfo = (PLUGININFOEX*)wParam;
- if (!_stricmp(pInfo->shortName, "TopToolBar"))
+ auto &pInfo = HPLUGIN(wParam)->getInfo();
+ if (!_stricmp(pInfo.shortName, "TopToolBar"))
TopToolbar_SetCustomProc(CustomizeToolbar, 0);
return 0;
}
diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp
index 2b536faf2d..777c36c536 100644
--- a/plugins/TopToolBar/src/toolbar.cpp
+++ b/plugins/TopToolBar/src/toolbar.cpp
@@ -551,9 +551,9 @@ int OnPluginLoad(WPARAM, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
// Removes buttons of plugins being unloaded. lParam = HINSTANCE
-int OnPluginUnload(WPARAM, LPARAM lParam)
+int OnPluginUnload(WPARAM wParam, LPARAM)
{
- HPLUGIN pPlugin = &GetPluginByInstance((HINSTANCE)lParam);
+ HPLUGIN pPlugin = HPLUGIN(wParam);
if (pPlugin) {
bool bNeedUpdate = false;
mir_cslock lck(csButtonsHook);
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp
index 65bc621e7b..3af7efc073 100644
--- a/src/mir_app/src/newplugins.cpp
+++ b/src/mir_app/src/newplugins.cpp
@@ -289,7 +289,7 @@ bool Plugin_UnloadDyn(pluginEntry *p)
freePluginInstance(ppb->getInst());
- NotifyFastHook(hevUnloadModule, (WPARAM)&ppb->getInfo(), (LPARAM)ppb->getInst());
+ NotifyFastHook(hevUnloadModule, (WPARAM)&ppb, (LPARAM)ppb->getInst());
}
// mark default plugins to be loaded
@@ -517,7 +517,7 @@ LBL_Error:
if (CallPluginEventHook(ppb->getInst(), hModulesLoadedEvent, 0, 0) != 0)
goto LBL_Error;
- NotifyEventHooks(hevLoadModule, (WPARAM)&ppb->getInfo(), (LPARAM)ppb->getInst());
+ NotifyEventHooks(hevLoadModule, (WPARAM)ppb, (LPARAM)ppb->getInst());
}
mr.pImpl = ppe;
return true;
diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp
index edafbd5a28..3c75861424 100644
--- a/src/mir_app/src/pluginopts.cpp
+++ b/src/mir_app/src/pluginopts.cpp
@@ -239,7 +239,7 @@ static bool LoadPluginDynamically(PluginListItemData *dat)
dat->bWasLoaded = true;
dat->hInst = ppb->getInst();
- NotifyFastHook(hevLoadModule, (WPARAM)&ppb->getInfo(), (LPARAM)ppb->getInst());
+ NotifyFastHook(hevLoadModule, (WPARAM)ppb, (LPARAM)ppb->getInst());
return true;
}