summaryrefslogtreecommitdiff
path: root/plugins/Updater
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-18 20:53:59 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-18 20:53:59 +0000
commit3f23417a1099f73dc28ec1b7d6ec2a1a7fc2b7a2 (patch)
tree3e0bcd88c55dad310da0dc980e252bf9fbfa6dc5 /plugins/Updater
parent537b94169bf2483798a651ee3b96f7904eebe7b4 (diff)
- PLUGININFO structure removed at all;
- Options_AddPage & UserInfo_AddPage replaced MS_OPT_ADDPAGE & MS_USERINFO_ADDPAGE services respectively - total internal redesign of options' translation - code reformatting git-svn-id: http://svn.miranda-ng.org/main/trunk@477 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Updater')
-rw-r--r--plugins/Updater/options.cpp2
-rw-r--r--plugins/Updater/scan.cpp13
-rw-r--r--plugins/Updater/services.cpp4
-rw-r--r--plugins/Updater/services.h2
4 files changed, 8 insertions, 13 deletions
diff --git a/plugins/Updater/options.cpp b/plugins/Updater/options.cpp
index 1c4545d76e..03acb47c00 100644
--- a/plugins/Updater/options.cpp
+++ b/plugins/Updater/options.cpp
@@ -384,7 +384,7 @@ int OptInit(WPARAM wParam,LPARAM lParam)
odp.ptszGroup = LPGENT("Services");
odp.nIDBottomSimpleControl = 0;
odp.pfnDlgProc = DlgProcOpts1;
- CallService( MS_OPT_ADDPAGE, wParam,( LPARAM )&odp );
+ Options_AddPage(wParam, &odp);
return 0;
}
diff --git a/plugins/Updater/scan.cpp b/plugins/Updater/scan.cpp
index ddae89dc43..2144f80fbc 100644
--- a/plugins/Updater/scan.cpp
+++ b/plugins/Updater/scan.cpp
@@ -1,7 +1,6 @@
#include "common.h"
#include "scan.h"
-typedef PLUGININFO * (__cdecl * Miranda_Plugin_Info) ( DWORD mirandaVersion );
typedef PLUGININFOEX * (__cdecl * Miranda_Plugin_Info_Ex) ( DWORD mirandaVersion );
struct AlternateShortName
@@ -56,10 +55,9 @@ void ScanPlugins(FilenameMap *fn_map, UpdateList *update_list)
TCHAR plugins_folder[MAX_PATH], dll_path[MAX_PATH];
TCHAR *dll_name;
- Miranda_Plugin_Info dll_info_func;
Miranda_Plugin_Info_Ex dll_info_func_ex;
DWORD mirandaVersion = (DWORD)CallService(MS_SYSTEM_GETVERSION, 0, 0);
- PLUGININFO *pluginInfo;
+ PLUGININFOEX *pluginInfo;
GetRootDir(plugins_folder);
_tcscat(plugins_folder, _T("\\Plugins"));
@@ -92,9 +90,8 @@ void ScanPlugins(FilenameMap *fn_map, UpdateList *update_list)
}
if (hModule)
{
- dll_info_func = (Miranda_Plugin_Info)GetProcAddress(hModule, "MirandaPluginInfo");
dll_info_func_ex = (Miranda_Plugin_Info_Ex)GetProcAddress(hModule, "MirandaPluginInfoEx");
- if ((dll_info_func_ex && (pluginInfo = (PLUGININFO *)dll_info_func_ex(mirandaVersion))) || (dll_info_func && (pluginInfo = dll_info_func(mirandaVersion))))
+ if (dll_info_func_ex && (pluginInfo = (PLUGININFOEX*)dll_info_func_ex(mirandaVersion)) != NULL)
{
// *** This is a dodgy and unfair hack...
// In order to disable new plugins that may be unintentionally installed with an update,
@@ -254,10 +251,9 @@ bool RearrangeDllsWorker(char *shortName, StrList &filenames, TCHAR *basedir)
TCHAR file_path[MAX_PATH];
- Miranda_Plugin_Info dll_info_func;
Miranda_Plugin_Info_Ex dll_info_func_ex;
DWORD mirandaVersion = (DWORD)CallService(MS_SYSTEM_GETVERSION, 0, 0);
- PLUGININFO *pluginInfo;
+ PLUGININFOEX *pluginInfo;
HMODULE hModule;
// add filemask
@@ -272,9 +268,8 @@ bool RearrangeDllsWorker(char *shortName, StrList &filenames, TCHAR *basedir)
mir_sntprintf(file_path, SIZEOF(file_path), _T("%s\\%s"), basedir, findData.cFileName);
if (valDllName(findData.cFileName) && (hModule = LoadLibrary(file_path)))
{
- dll_info_func = (Miranda_Plugin_Info)GetProcAddress(hModule, "MirandaPluginInfo");
dll_info_func_ex = (Miranda_Plugin_Info_Ex)GetProcAddress(hModule, "MirandaPluginInfoEx");
- if ((dll_info_func_ex && (pluginInfo = (PLUGININFO *)dll_info_func_ex(mirandaVersion))) || (dll_info_func && (pluginInfo = dll_info_func(mirandaVersion))))
+ if (dll_info_func_ex && (pluginInfo = (PLUGININFOEX *)dll_info_func_ex(mirandaVersion)) != NULL)
{
bool found = !_stricmp(pluginInfo->shortName, shortName);
if (!found)
diff --git a/plugins/Updater/services.cpp b/plugins/Updater/services.cpp
index 3b11ddf850..21aaa4552e 100644
--- a/plugins/Updater/services.cpp
+++ b/plugins/Updater/services.cpp
@@ -514,7 +514,7 @@ INT_PTR GetUpdateOptions(WPARAM wParam, LPARAM lParam) {
return found ? 0 : 1;
}
-bool RegisterForFileListing(int file_id, PLUGININFO *pluginInfo, bool auto_register)
+bool RegisterForFileListing(int file_id, PLUGININFOEX *pluginInfo, bool auto_register)
{
return RegisterForFileListing(file_id, pluginInfo->shortName, pluginInfo->version, auto_register, MC_PLUGINS);
}
@@ -739,7 +739,7 @@ INT_PTR Register(WPARAM wParam, LPARAM lParam) {
INT_PTR RegisterFL(WPARAM wParam, LPARAM lParam) {
int file_id = (INT_PTR)wParam;
- PLUGININFO *pluginInfo = (PLUGININFO *)lParam;
+ PLUGININFOEX *pluginInfo = (PLUGININFOEX *)lParam;
// remove registered plugin if already there
EnterCriticalSection(&list_cs);
diff --git a/plugins/Updater/services.h b/plugins/Updater/services.h
index 0bbac4d94a..ce4a2dc574 100644
--- a/plugins/Updater/services.h
+++ b/plugins/Updater/services.h
@@ -68,7 +68,7 @@ INT_PTR EnumerateUpdates(WPARAM wParam, LPARAM lParam);
////////////////////////////
bool IsRegistered(int file_id);
-bool RegisterForFileListing(int file_id, PLUGININFO *pluginInfo, bool auto_register);
+bool RegisterForFileListing(int file_id, PLUGININFOEX *pluginInfo, bool auto_register);
bool RegisterForFileListing(int file_id, const char *fl_name, DWORD version, bool auto_register, const Category cat);
void InitServices();