diff options
Diffstat (limited to 'updater/scan.cpp')
-rw-r--r-- | updater/scan.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/updater/scan.cpp b/updater/scan.cpp index cab6cbc..5dda22a 100644 --- a/updater/scan.cpp +++ b/updater/scan.cpp @@ -2,6 +2,7 @@ #include "scan.h"
typedef PLUGININFO * (__cdecl * Miranda_Plugin_Info) ( DWORD mirandaVersion );
+typedef PLUGININFOEX * (__cdecl * Miranda_Plugin_Info_Ex) ( DWORD mirandaVersion );
typedef std::map<std::string, std::string> AlternateShortNameMap;
@@ -24,6 +25,7 @@ void ScanPlugins(FilenameMap *fn_map, UpdateList *update_list) { 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;
HMODULE hModule;
@@ -53,7 +55,8 @@ void ScanPlugins(FilenameMap *fn_map, UpdateList *update_list) { _tcscpy(dll_name, findData.cFileName);
if(hModule = LoadLibrary(dll_path)) {
dll_info_func = (Miranda_Plugin_Info)GetProcAddress(hModule, "MirandaPluginInfo");
- if(dll_info_func && (pluginInfo = dll_info_func(mirandaVersion))) {
+ 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)))) {
// *** This is a dodgy and unfair hack...
// In order to disable new plugins that may be unintentionally installed whith an update,
@@ -188,6 +191,7 @@ bool RearrangeDlls(char *shortName, STDStringList &filenames) { BYTE disabled_val;
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;
HMODULE hModule;
@@ -211,7 +215,8 @@ bool RearrangeDlls(char *shortName, STDStringList &filenames) { if(hModule = LoadLibrary(file_path)) {
dll_info_func = (Miranda_Plugin_Info)GetProcAddress(hModule, "MirandaPluginInfo");
- if(dll_info_func && (pluginInfo = dll_info_func(mirandaVersion))) {
+ 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)))) {
std::string strShortName(pluginInfo->shortName);
AlternateShortNameMap::iterator i = alternate_shortname_map.find(strShortName);
if(i != alternate_shortname_map.end())
@@ -283,7 +288,8 @@ bool RearrangeDlls(char *shortName, STDStringList &filenames) { if(hModule = LoadLibrary(file_path)) {
dll_info_func = (Miranda_Plugin_Info)GetProcAddress(hModule, "MirandaPluginInfo");
- if(dll_info_func && (pluginInfo = dll_info_func(mirandaVersion))) {
+ 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)))) {
std::string strShortName(pluginInfo->shortName);
AlternateShortNameMap::iterator i = alternate_shortname_map.find(strShortName);
if(i != alternate_shortname_map.end())
|