summaryrefslogtreecommitdiff
path: root/meta2/miranda-svn.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta2/miranda-svn.patch')
-rw-r--r--meta2/miranda-svn.patch78
1 files changed, 78 insertions, 0 deletions
diff --git a/meta2/miranda-svn.patch b/meta2/miranda-svn.patch
new file mode 100644
index 0000000..f5e4a6b
--- /dev/null
+++ b/meta2/miranda-svn.patch
@@ -0,0 +1,78 @@
+Index: include/m_plugins.h
+===================================================================
+--- include/m_plugins.h (revision 8019)
++++ include/m_plugins.h (working copy)
+@@ -79,6 +79,12 @@
+ //feature-dependent
+ #define MS_PLUGINS_GETDISABLEDEFAULTARRAY "Plugins/GetDisableDefaultArray"
+
++// plugins/hookservice
++// replaces a service function pointer and returns the old value
++// wPararm = (char *)service name
++// lParam = MIRANDASERVICE
++#define MS_PLUGINS_HOOKSERVICE "Plugins/HookService"
++
+ #endif // M_PLUGINS_H__
+
+
+Index: src/core/modules.c
+===================================================================
+--- src/core/modules.c (revision 8019)
++++ src/core/modules.c (working copy)
+@@ -722,6 +722,23 @@
+ return ret;
+ }
+
++MIRANDASERVICE ModulesReplaceService(char *name, MIRANDASERVICE pfnNewService) {
++ TService *pService;
++ MIRANDASERVICE pfnService;
++ if (pfnNewService==NULL || name==NULL) return 0;
++
++ EnterCriticalSection(&csServices);
++ pService=FindServiceByName(name);
++ if (pService==NULL) {
++ LeaveCriticalSection(&csServices);
++ return 0;
++ }
++ pfnService = pService->pfnService;
++ pService->pfnService = pfnNewService;
++ LeaveCriticalSection(&csServices);
++ return pfnService;
++}
++
+ int CallService(const char *name,WPARAM wParam,LPARAM lParam)
+ {
+ TService *pService;
+Index: src/modules/plugins/newplugins.c
+===================================================================
+--- src/modules/plugins/newplugins.c (revision 8019)
++++ src/modules/plugins/newplugins.c (working copy)
+@@ -100,6 +100,7 @@
+ #define PLUGINDISABLELIST "PluginDisable"
+
+ int CallHookSubscribers( HANDLE hEvent, WPARAM wParam, LPARAM lParam );
++MIRANDASERVICE ModulesReplaceService(char *name, MIRANDASERVICE pfnNewService);
+
+ int LoadDatabaseModule(void);
+ void ListView_SetItemTextA( HWND hwndLV, int i, int iSubItem, char* pszText );
+@@ -437,6 +438,11 @@
+ return (int) &pluginDefModList;
+ }
+
++static int PluginsHookService(WPARAM wParam, LPARAM lParam)
++{
++ return (int)ModulesReplaceService((char *)wParam, (MIRANDASERVICE)lParam);
++}
++
+ // called in the first pass to create pluginEntry* structures and validate database plugins
+ static BOOL scanPluginsDir (WIN32_FIND_DATAA * fd, char * path, WPARAM wParam, LPARAM lParam )
+ {
+@@ -1040,6 +1046,8 @@
+ //
+ CreateServiceFunction(MS_PLUGINS_ENUMDBPLUGINS, PluginsEnum);
+ CreateServiceFunction(MS_PLUGINS_GETDISABLEDEFAULTARRAY, PluginsGetDefaultArray);
++ CreateServiceFunction(MS_PLUGINS_HOOKSERVICE, PluginsHookService);
++
+ // make sure plugins can get internal core APIs
+ pluginCoreLink.CallService = CallService;
+ pluginCoreLink.ServiceExists = ServiceExists;