summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-06 08:31:38 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-06 08:31:38 +0000
commit1ce002432b3a5c0bb0a4c9f9eb8d399d649fe283 (patch)
tree77852d7852ceaf1f0029e91e94ae7580bb4cef5d
parent387a4b247a6c4363576b1f969e7ea19856f6eddd (diff)
- mir_core.dll moved to the core :)
- plugins now obtain the fake langpack id if langpack is absent git-svn-id: http://svn.miranda-ng.org/main/trunk@787 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--bin10/mir_full.sln20
-rw-r--r--bin10/mir_full_pro.sln22
-rw-r--r--bin10/miranda32.sln19
-rw-r--r--src/core/miranda.h6
-rw-r--r--src/mir_core/commonheaders.cpp (renamed from plugins/Mir_core/commonheaders.cpp)0
-rw-r--r--src/mir_core/commonheaders.h (renamed from plugins/Mir_core/commonheaders.h)0
-rw-r--r--src/mir_core/db.cpp (renamed from plugins/Mir_core/db.cpp)0
-rw-r--r--src/mir_core/langpack.cpp (renamed from plugins/Mir_core/langpack.cpp)9
-rw-r--r--src/mir_core/lists.cpp (renamed from plugins/Mir_core/lists.cpp)0
-rw-r--r--src/mir_core/md5.cpp (renamed from plugins/Mir_core/md5.cpp)0
-rw-r--r--src/mir_core/memory.cpp (renamed from plugins/Mir_core/memory.cpp)0
-rw-r--r--src/mir_core/mir_core.def (renamed from plugins/Mir_core/mir_core.def)1
-rw-r--r--src/mir_core/mir_core_10.vcxproj (renamed from plugins/Mir_core/mir_core_10.vcxproj)2
-rw-r--r--src/mir_core/mir_core_10.vcxproj.filters (renamed from plugins/Mir_core/mir_core_10.vcxproj.filters)0
-rw-r--r--src/mir_core/miranda.cpp (renamed from plugins/Mir_core/miranda.cpp)0
-rw-r--r--src/mir_core/miranda.h (renamed from plugins/Mir_core/miranda.h)1
-rw-r--r--src/mir_core/modules.cpp (renamed from plugins/Mir_core/modules.cpp)0
-rw-r--r--src/mir_core/path.cpp (renamed from plugins/Mir_core/path.cpp)0
-rw-r--r--src/mir_core/sha1.cpp (renamed from plugins/Mir_core/sha1.cpp)0
-rw-r--r--src/mir_core/threads.cpp (renamed from plugins/Mir_core/threads.cpp)0
-rw-r--r--src/mir_core/utf.cpp (renamed from plugins/Mir_core/utf.cpp)0
-rw-r--r--src/mir_core/utils.cpp (renamed from plugins/Mir_core/utils.cpp)0
-rw-r--r--src/modules/icolib/extracticon.cpp2
-rw-r--r--src/modules/langpack/lpservices.cpp4
-rw-r--r--src/modules/options/options.cpp2
-rw-r--r--src/modules/plugins/newplugins.cpp102
-rw-r--r--src/modules/plugins/pluginopts.cpp2
-rw-r--r--src/modules/plugins/plugins.h3
28 files changed, 104 insertions, 91 deletions
diff --git a/bin10/mir_full.sln b/bin10/mir_full.sln
index 30f45701c3..0a15d730fa 100644
--- a/bin10/mir_full.sln
+++ b/bin10/mir_full.sln
@@ -240,8 +240,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Clist_classic", "..\plugins
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NewEventNotify", "..\plugins\NewEventNotify\neweventnotify.vcxproj", "{2E0A2793-94C3-82E7-2AB0-FD421816CFBF}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mir_core", "..\plugins\Mir_core\mir_core_10.vcxproj", "{D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FileAsMessage", "..\plugins\FileAsMessage\fileecho.vcxproj", "{D7A3B8D0-425A-2286-8E2F-2C0BF1EE5C2E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WhoUsesMyFiles", "..\plugins\WhoUsesMyFiles\wumf.vcxproj", "{F29CCB9B-79CF-4341-AA05-3626A036D3E3}"
@@ -259,6 +257,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AvatarHistory", "..\plugins
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stduserinfo", "..\src\core\stduserinfo\stduserinfo_10.vcxproj", "{1C856B14-54CD-4D07-B18B-5F7DB073AB51}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mir_core", "..\src\mir_core\mir_core_10.vcxproj", "{D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -1222,14 +1222,6 @@ Global
{2E0A2793-94C3-82E7-2AB0-FD421816CFBF}.Release|Win32.Build.0 = Release|Win32
{2E0A2793-94C3-82E7-2AB0-FD421816CFBF}.Release|x64.ActiveCfg = Release|x64
{2E0A2793-94C3-82E7-2AB0-FD421816CFBF}.Release|x64.Build.0 = Release|x64
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|Win32.ActiveCfg = Debug|Win32
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|Win32.Build.0 = Debug|Win32
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|x64.ActiveCfg = Debug|x64
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|x64.Build.0 = Debug|x64
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|Win32.ActiveCfg = Release|Win32
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|Win32.Build.0 = Release|Win32
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|x64.ActiveCfg = Release|x64
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|x64.Build.0 = Release|x64
{D7A3B8D0-425A-2286-8E2F-2C0BF1EE5C2E}.Debug|Win32.ActiveCfg = Debug|Win32
{D7A3B8D0-425A-2286-8E2F-2C0BF1EE5C2E}.Debug|Win32.Build.0 = Debug|Win32
{D7A3B8D0-425A-2286-8E2F-2C0BF1EE5C2E}.Debug|x64.ActiveCfg = Debug|x64
@@ -1286,6 +1278,14 @@ Global
{1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Release|Win32.Build.0 = Release|Win32
{1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Release|x64.ActiveCfg = Release|x64
{1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Release|x64.Build.0 = Release|x64
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|Win32.ActiveCfg = Debug|Win32
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|Win32.Build.0 = Debug|Win32
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|x64.ActiveCfg = Debug|x64
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|x64.Build.0 = Debug|x64
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|Win32.ActiveCfg = Release|Win32
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|Win32.Build.0 = Release|Win32
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|x64.ActiveCfg = Release|x64
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/bin10/mir_full_pro.sln b/bin10/mir_full_pro.sln
index 1f3b737852..ae7e5f8348 100644
--- a/bin10/mir_full_pro.sln
+++ b/bin10/mir_full_pro.sln
@@ -240,8 +240,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Clist_classic", "..\plugins
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NewEventNotify", "..\plugins\NewEventNotify\neweventnotify.vcxproj", "{2E0A2793-94C3-82E7-2AB0-FD421816CFBF}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mir_core", "..\plugins\Mir_core\mir_core_10.vcxproj", "{D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FileAsMessage", "..\plugins\FileAsMessage\fileecho.vcxproj", "{D7A3B8D0-425A-2286-8E2F-2C0BF1EE5C2E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WhoUsesMyFiles", "..\plugins\WhoUsesMyFiles\wumf.vcxproj", "{F29CCB9B-79CF-4341-AA05-3626A036D3E3}"
@@ -293,6 +291,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{CBBD3DE7-9
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stduserinfo", "..\src\core\stduserinfo\stduserinfo_10.vcxproj", "{1C856B14-54CD-4D07-B18B-5F7DB073AB51}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mir_core", "..\src\mir_core\mir_core_10.vcxproj", "{D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -1256,14 +1256,6 @@ Global
{2E0A2793-94C3-82E7-2AB0-FD421816CFBF}.Release|Win32.Build.0 = Release|Win32
{2E0A2793-94C3-82E7-2AB0-FD421816CFBF}.Release|x64.ActiveCfg = Release|x64
{2E0A2793-94C3-82E7-2AB0-FD421816CFBF}.Release|x64.Build.0 = Release|x64
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|Win32.ActiveCfg = Debug|Win32
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|Win32.Build.0 = Debug|Win32
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|x64.ActiveCfg = Debug|x64
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|x64.Build.0 = Debug|x64
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|Win32.ActiveCfg = Release|Win32
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|Win32.Build.0 = Release|Win32
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|x64.ActiveCfg = Release|x64
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|x64.Build.0 = Release|x64
{D7A3B8D0-425A-2286-8E2F-2C0BF1EE5C2E}.Debug|Win32.ActiveCfg = Debug|Win32
{D7A3B8D0-425A-2286-8E2F-2C0BF1EE5C2E}.Debug|Win32.Build.0 = Debug|Win32
{D7A3B8D0-425A-2286-8E2F-2C0BF1EE5C2E}.Debug|x64.ActiveCfg = Debug|x64
@@ -1320,6 +1312,14 @@ Global
{1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Release|Win32.Build.0 = Release|Win32
{1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Release|x64.ActiveCfg = Release|x64
{1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Release|x64.Build.0 = Release|x64
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|Win32.ActiveCfg = Debug|Win32
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|Win32.Build.0 = Debug|Win32
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|x64.ActiveCfg = Debug|x64
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|x64.Build.0 = Debug|x64
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|Win32.ActiveCfg = Release|Win32
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|Win32.Build.0 = Release|Win32
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|x64.ActiveCfg = Release|x64
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1354,9 +1354,9 @@ Global
{B988F96C-F87A-484C-AB15-D0674B22F291} = {87D96006-542C-4396-87EF-68E3C3D2797F}
{268BD296-8DD3-4715-A386-CF120398EC98} = {87D96006-542C-4396-87EF-68E3C3D2797F}
{F9916510-9055-4C9F-997A-3755DEC1511B} = {CBBD3DE7-97CE-479D-87E3-8EACD035AF9B}
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60} = {CBBD3DE7-97CE-479D-87E3-8EACD035AF9B}
{E2A369CD-EDA3-414F-8AD0-E732CD7EE68C} = {CBBD3DE7-97CE-479D-87E3-8EACD035AF9B}
{1C856B14-54CD-4D07-B18B-5F7DB073AB51} = {CBBD3DE7-97CE-479D-87E3-8EACD035AF9B}
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60} = {CBBD3DE7-97CE-479D-87E3-8EACD035AF9B}
{20D781FB-4A20-4B75-B863-304A47182966} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
{A2E9DA24-95E4-4414-94AF-488A382E276A} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
{6D3DC604-9CA0-45A2-85D7-1EFE3309F23B} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
diff --git a/bin10/miranda32.sln b/bin10/miranda32.sln
index 01b359dbe4..89225e9983 100644
--- a/bin10/miranda32.sln
+++ b/bin10/miranda32.sln
@@ -74,10 +74,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Toolbar_icons", "..\plugins
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Clist_classic", "..\plugins\Clist_classic\clist_10.vcxproj", "{E71C1722-A41D-4475-87F4-29961A3654BB}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mir_core", "..\plugins\Mir_core\mir_core_10.vcxproj", "{D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stduserinfo", "..\src\core\stduserinfo\stduserinfo_10.vcxproj", "{1C856B14-54CD-4D07-B18B-5F7DB073AB51}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mir_core", "..\src\mir_core\mir_core_10.vcxproj", "{D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -382,13 +382,6 @@ Global
{E71C1722-A41D-4475-87F4-29961A3654BB}.Release|Win32.Build.0 = Release|Win32
{E71C1722-A41D-4475-87F4-29961A3654BB}.Release|x64.ActiveCfg = Release|x64
{E71C1722-A41D-4475-87F4-29961A3654BB}.Release|x64.Build.0 = Release|x64
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|Win32.ActiveCfg = Debug|Win32
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|Win32.Build.0 = Debug|Win32
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|x64.ActiveCfg = Debug|Win32
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|Win32.ActiveCfg = Release|Win32
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|Win32.Build.0 = Release|Win32
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|x64.ActiveCfg = Release|x64
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|x64.Build.0 = Release|x64
{1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Debug|Win32.ActiveCfg = Debug|Win32
{1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Debug|Win32.Build.0 = Debug|Win32
{1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Debug|x64.ActiveCfg = Debug|x64
@@ -397,6 +390,14 @@ Global
{1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Release|Win32.Build.0 = Release|Win32
{1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Release|x64.ActiveCfg = Release|x64
{1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Release|x64.Build.0 = Release|x64
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|Win32.ActiveCfg = Debug|Win32
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|Win32.Build.0 = Debug|Win32
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|x64.ActiveCfg = Debug|x64
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Debug|x64.Build.0 = Debug|x64
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|Win32.ActiveCfg = Release|Win32
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|Win32.Build.0 = Release|Win32
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|x64.ActiveCfg = Release|x64
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/src/core/miranda.h b/src/core/miranda.h
index 3b08c636ba..c1dcb75f95 100644
--- a/src/core/miranda.h
+++ b/src/core/miranda.h
@@ -128,6 +128,11 @@ void KillModuleSounds(int hLangpack);
extern HINSTANCE hInst;
extern HANDLE hOkToExitEvent, hModulesLoadedEvent, hevLoadModule, hevUnloadModule;
+/**** newplugins.cpp *******************************************************************/
+
+char* GetPluginNameByInstance(HINSTANCE hInstance);
+int GetPluginFakeId(const MUUID &uuid, int hLangpack);
+
/**** utf.cpp **************************************************************************/
__forceinline char* Utf8DecodeA(const char* src)
@@ -247,6 +252,5 @@ public:
extern "C"
{
- MIR_CORE_DLL(int) Langpack_GetPluginHandle(PLUGININFOEX* pInfo);
MIR_CORE_DLL(int) Langpack_MarkPluginLoaded(PLUGININFOEX* pInfo);
};
diff --git a/plugins/Mir_core/commonheaders.cpp b/src/mir_core/commonheaders.cpp
index 95b2201163..95b2201163 100644
--- a/plugins/Mir_core/commonheaders.cpp
+++ b/src/mir_core/commonheaders.cpp
diff --git a/plugins/Mir_core/commonheaders.h b/src/mir_core/commonheaders.h
index 2d04e12f4b..2d04e12f4b 100644
--- a/plugins/Mir_core/commonheaders.h
+++ b/src/mir_core/commonheaders.h
diff --git a/plugins/Mir_core/db.cpp b/src/mir_core/db.cpp
index 37b89d8399..37b89d8399 100644
--- a/plugins/Mir_core/db.cpp
+++ b/src/mir_core/db.cpp
diff --git a/plugins/Mir_core/langpack.cpp b/src/mir_core/langpack.cpp
index 90c11a4a65..015af8f469 100644
--- a/plugins/Mir_core/langpack.cpp
+++ b/src/mir_core/langpack.cpp
@@ -527,15 +527,6 @@ MIR_CORE_DLL(MUUID*) Langpack_LookupUuid(WPARAM wParam)
return (idx > 0 && idx <= lMuuids.getCount()) ? lMuuids[ idx-1 ] : NULL;
}
-MIR_CORE_DLL(int) Langpack_GetPluginHandle(PLUGININFOEX* pInfo)
-{
- int idx = lMuuids.getIndex(&pInfo->uuid);
- if (idx == -1)
- return 0;
-
- return (idx+1) << 16;
-}
-
MIR_CORE_DLL(int) Langpack_MarkPluginLoaded(PLUGININFOEX* pInfo)
{
int idx = lMuuids.getIndex(&pInfo->uuid);
diff --git a/plugins/Mir_core/lists.cpp b/src/mir_core/lists.cpp
index e4996fc156..e4996fc156 100644
--- a/plugins/Mir_core/lists.cpp
+++ b/src/mir_core/lists.cpp
diff --git a/plugins/Mir_core/md5.cpp b/src/mir_core/md5.cpp
index a7d7a641e3..a7d7a641e3 100644
--- a/plugins/Mir_core/md5.cpp
+++ b/src/mir_core/md5.cpp
diff --git a/plugins/Mir_core/memory.cpp b/src/mir_core/memory.cpp
index 0ecddc6717..0ecddc6717 100644
--- a/plugins/Mir_core/memory.cpp
+++ b/src/mir_core/memory.cpp
diff --git a/plugins/Mir_core/mir_core.def b/src/mir_core/mir_core.def
index b985fa7efb..43dd94d7ac 100644
--- a/plugins/Mir_core/mir_core.def
+++ b/src/mir_core/mir_core.def
@@ -124,4 +124,3 @@ db_set_w @121
db_set_ws @122
UnloadCoreModule @123
Thread_SetName @124
-Langpack_GetPluginHandle @125
diff --git a/plugins/Mir_core/mir_core_10.vcxproj b/src/mir_core/mir_core_10.vcxproj
index 03ea9c52e1..e5f452eb61 100644
--- a/plugins/Mir_core/mir_core_10.vcxproj
+++ b/src/mir_core/mir_core_10.vcxproj
@@ -48,7 +48,7 @@
<ClCompile Include="utils.cpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
- <ProjectName>Mir_core</ProjectName>
+ <ProjectName>mir_core</ProjectName>
<ProjectGuid>{D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
diff --git a/plugins/Mir_core/mir_core_10.vcxproj.filters b/src/mir_core/mir_core_10.vcxproj.filters
index 27b6a42604..27b6a42604 100644
--- a/plugins/Mir_core/mir_core_10.vcxproj.filters
+++ b/src/mir_core/mir_core_10.vcxproj.filters
diff --git a/plugins/Mir_core/miranda.cpp b/src/mir_core/miranda.cpp
index b059e11cb7..b059e11cb7 100644
--- a/plugins/Mir_core/miranda.cpp
+++ b/src/mir_core/miranda.cpp
diff --git a/plugins/Mir_core/miranda.h b/src/mir_core/miranda.h
index 06aae73420..af71276ac4 100644
--- a/plugins/Mir_core/miranda.h
+++ b/src/mir_core/miranda.h
@@ -26,7 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern "C"
{
- MIR_CORE_DLL(int) Langpack_GetPluginHandle(PLUGININFOEX* pInfo);
MIR_CORE_DLL(int) Langpack_MarkPluginLoaded(PLUGININFOEX* pInfo);
};
diff --git a/plugins/Mir_core/modules.cpp b/src/mir_core/modules.cpp
index f87c7bb192..f87c7bb192 100644
--- a/plugins/Mir_core/modules.cpp
+++ b/src/mir_core/modules.cpp
diff --git a/plugins/Mir_core/path.cpp b/src/mir_core/path.cpp
index fada3dcd18..fada3dcd18 100644
--- a/plugins/Mir_core/path.cpp
+++ b/src/mir_core/path.cpp
diff --git a/plugins/Mir_core/sha1.cpp b/src/mir_core/sha1.cpp
index 9e1b376d92..9e1b376d92 100644
--- a/plugins/Mir_core/sha1.cpp
+++ b/src/mir_core/sha1.cpp
diff --git a/plugins/Mir_core/threads.cpp b/src/mir_core/threads.cpp
index 90dcdaaf5d..90dcdaaf5d 100644
--- a/plugins/Mir_core/threads.cpp
+++ b/src/mir_core/threads.cpp
diff --git a/plugins/Mir_core/utf.cpp b/src/mir_core/utf.cpp
index ddf2d1ca9f..ddf2d1ca9f 100644
--- a/plugins/Mir_core/utf.cpp
+++ b/src/mir_core/utf.cpp
diff --git a/plugins/Mir_core/utils.cpp b/src/mir_core/utils.cpp
index 4ebba2f293..4ebba2f293 100644
--- a/plugins/Mir_core/utils.cpp
+++ b/src/mir_core/utils.cpp
diff --git a/src/modules/icolib/extracticon.cpp b/src/modules/icolib/extracticon.cpp
index 6a53f767cc..e5906045a1 100644
--- a/src/modules/icolib/extracticon.cpp
+++ b/src/modules/icolib/extracticon.cpp
@@ -57,7 +57,7 @@ void* _RelativeVirtualAddresstoPtr(IMAGE_DOS_HEADER* pDosHeader, DWORD rva)
IMAGE_SECTION_HEADER* cSection = &pSection[i];
DWORD size = cSection->Misc.VirtualSize ? cSection->Misc.VirtualSize : cSection->SizeOfRawData;
- if (rva >= cSection->VirtualAddress && rva < cSection->VirtualAddress + size)
+ if (rva >= cSection->VirtualAddress && rva < cSection->VirtualAddress + size)
return (LPBYTE)pDosHeader + cSection->PointerToRawData + (rva - cSection->VirtualAddress);
}
diff --git a/src/modules/langpack/lpservices.cpp b/src/modules/langpack/lpservices.cpp
index b7ae5ef563..36f9e3c40b 100644
--- a/src/modules/langpack/lpservices.cpp
+++ b/src/modules/langpack/lpservices.cpp
@@ -43,7 +43,9 @@ static INT_PTR srvTranslateMenu(WPARAM wParam, LPARAM lParam)
static INT_PTR srvRegisterLP(WPARAM wParam, LPARAM lParam)
{
- *(int*)wParam = Langpack_MarkPluginLoaded((PLUGININFOEX*)lParam);
+ PLUGININFOEX* ppi = (PLUGININFOEX*)lParam;
+ if (wParam && ppi)
+ *( int* )wParam = GetPluginFakeId(ppi->uuid, Langpack_MarkPluginLoaded(ppi));
return 0;
}
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp
index 4a4f79688b..1a9d855822 100644
--- a/src/modules/options/options.cpp
+++ b/src/modules/options/options.cpp
@@ -40,8 +40,6 @@ static int FilterPage = 0;
static int FilterLoadProgress = 100;
static int FilterTimerId = 0;
-char* GetPluginNameByInstance(HINSTANCE hInstance);
-
struct OptionsPageInit
{
int pageCount;
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp
index a07f371e42..7bbcc57411 100644
--- a/src/modules/plugins/newplugins.cpp
+++ b/src/modules/plugins/newplugins.cpp
@@ -68,7 +68,7 @@ static BOOL bModuleInitialized = FALSE;
TCHAR mirandabootini[MAX_PATH];
static DWORD mirandaVersion;
-static int serviceModeIdx = -1;
+static int serviceModeIdx = -1, sttFakeID = -100;
static HANDLE hPluginListHeap = NULL;
static int askAboutIgnoredPlugins;
@@ -81,18 +81,8 @@ void UninitIni(void);
int LoadDatabaseModule(void);
-char* GetPluginNameByInstance(HINSTANCE hInstance)
-{
- if (pluginList.getCount() == 0)
- return NULL;
-
- for (int i=0; i < pluginList.getCount(); i++) {
- pluginEntry* pe = pluginList[i];
- if (pe->bpi.pluginInfo && pe->bpi.hInst == hInstance)
- return pe->bpi.pluginInfo->shortName;
- }
- return NULL;
-}
+/////////////////////////////////////////////////////////////////////////////////////////
+// basic functions
int equalUUID(const MUUID& u1, const MUUID& u2)
{
@@ -119,6 +109,37 @@ int getDefaultPluginIdx(const MUUID& muuid)
return -1;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+// global functions
+
+char* GetPluginNameByInstance(HINSTANCE hInstance)
+{
+ if (pluginList.getCount() == 0)
+ return NULL;
+
+ for (int i=0; i < pluginList.getCount(); i++) {
+ pluginEntry* p = pluginList[i];
+ if (p->bpi.pluginInfo && p->bpi.hInst == hInstance)
+ return p->bpi.pluginInfo->shortName;
+ }
+ return NULL;
+}
+
+int GetPluginFakeId(const MUUID &uuid, int hLangpack)
+{
+ for (int i=0; i < pluginList.getCount(); i++) {
+ pluginEntry* p = pluginList[i];
+ if ( !p->bpi.hInst)
+ continue;
+
+ if ( equalUUID(p->bpi.pluginInfo->uuid, uuid))
+ return p->hLangpack = (hLangpack) ? hLangpack : --sttFakeID;
+ }
+
+ return 0;
+}
+
+
MUUID miid_last = MIID_LAST;
MUUID miid_chat = MIID_CHAT;
MUUID miid_srmm = MIID_SRMM;
@@ -264,11 +285,8 @@ LBL_Ok:
}
// perform any API related tasks to freeing
-void Plugin_Uninit(pluginEntry* p, bool bDynamic)
+void Plugin_Uninit(pluginEntry* p)
{
- if (bDynamic && p->bpi.hInst)
- CallPluginEventHook(p->bpi.hInst, hOkToExitEvent, 0, 0);
-
// if it was an installed database plugin, call its unload
if (p->pclass & PCLASS_DB)
p->bpi.dblink->Unload(p->pclass & PCLASS_OK);
@@ -283,24 +301,6 @@ void Plugin_Uninit(pluginEntry* p, bool bDynamic)
KillModuleEventHooks(p->bpi.hInst);
KillModuleServices(p->bpi.hInst);
- if (bDynamic) {
- int hLangpack = Langpack_GetPluginHandle(p->bpi.pluginInfo);
- if (hLangpack != 0) {
- KillModuleMenus(hLangpack);
- KillModuleFonts(hLangpack);
- KillModuleColours(hLangpack);
- KillModuleEffects(hLangpack);
- KillModuleIcons(hLangpack);
- KillModuleHotkeys(hLangpack);
- KillModuleSounds(hLangpack);
- }
-
- // release default plugin
- for (int i=0; i < SIZEOF(pluginDefault); i++)
- if (pluginDefault[i].pImpl == p)
- pluginDefault[i].pImpl = NULL;
- }
-
FreeLibrary(p->bpi.hInst);
ZeroMemory(&p->bpi, sizeof(p->bpi));
}
@@ -310,15 +310,33 @@ void Plugin_Uninit(pluginEntry* p, bool bDynamic)
int Plugin_UnloadDyn(pluginEntry* p)
{
- if (CallPluginEventHook(p->bpi.hInst, hOkToExitEvent, 0, 0) != 0)
- return FALSE;
+ if (p->bpi.hInst) {
+ if (CallPluginEventHook(p->bpi.hInst, hOkToExitEvent, 0, 0) != 0)
+ return FALSE;
- NotifyEventHooks(hevUnloadModule, (WPARAM)p->bpi.InfoEx, (LPARAM)p->bpi.hInst);
+ NotifyEventHooks(hevUnloadModule, (WPARAM)p->bpi.InfoEx, (LPARAM)p->bpi.hInst);
- CallPluginEventHook(p->bpi.hInst, hPreShutdownEvent, 0, 0);
- CallPluginEventHook(p->bpi.hInst, hShutdownEvent, 0, 0);
+ CallPluginEventHook(p->bpi.hInst, hPreShutdownEvent, 0, 0);
+ CallPluginEventHook(p->bpi.hInst, hShutdownEvent, 0, 0);
+ }
+
+ int hLangpack = p->hLangpack;
+ if (hLangpack != 0) {
+ KillModuleMenus(hLangpack);
+ KillModuleFonts(hLangpack);
+ KillModuleColours(hLangpack);
+ KillModuleEffects(hLangpack);
+ KillModuleIcons(hLangpack);
+ KillModuleHotkeys(hLangpack);
+ KillModuleSounds(hLangpack);
+ }
+
+ // release default plugin
+ for (int i=0; i < SIZEOF(pluginDefault); i++)
+ if (pluginDefault[i].pImpl == p)
+ pluginDefault[i].pImpl = NULL;
- Plugin_Uninit(p, true);
+ Plugin_Uninit(p);
return TRUE;
}
@@ -578,7 +596,7 @@ bool LoadCorePlugin(MuuidReplacement& mr)
pluginEntry* pPlug = OpenPlugin(tszPlugName, _T("Core"), exe);
if (pPlug->pclass & PCLASS_FAILED) {
LBL_Error:
- Plugin_Uninit(pPlug, true);
+ Plugin_UnloadDyn(pPlug);
return FALSE;
}
diff --git a/src/modules/plugins/pluginopts.cpp b/src/modules/plugins/pluginopts.cpp
index b8384ae593..15f9219192 100644
--- a/src/modules/plugins/pluginopts.cpp
+++ b/src/modules/plugins/pluginopts.cpp
@@ -167,7 +167,7 @@ static int LoadPluginDynamically(PluginListItemData* dat)
pluginEntry* pPlug = OpenPlugin(dat->fileName, _T("Plugins"), exe);
if (pPlug->pclass & PCLASS_FAILED) {
LBL_Error:
- Plugin_Uninit(pPlug, true);
+ Plugin_UnloadDyn(pPlug);
return FALSE;
}
diff --git a/src/modules/plugins/plugins.h b/src/modules/plugins/plugins.h
index 85922fcae8..4dcf76f439 100644
--- a/src/modules/plugins/plugins.h
+++ b/src/modules/plugins/plugins.h
@@ -48,6 +48,7 @@ struct pluginEntry
{
TCHAR pluginname[64];
unsigned int pclass; // PCLASS_*
+ int hLangpack;
BASIC_PLUGIN_INFO bpi;
pluginEntry* nextclass;
};
@@ -70,7 +71,7 @@ int checkAPI(TCHAR* plugin, BASIC_PLUGIN_INFO* bpi, DWORD mirandaVersion, int ch
pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path);
bool TryLoadPlugin(pluginEntry *p, TCHAR *dir, bool bDynamic);
-void Plugin_Uninit(pluginEntry* p, bool bDynamic = false);
+void Plugin_Uninit(pluginEntry* p);
int Plugin_UnloadDyn(pluginEntry* p);
typedef BOOL (*SCAN_PLUGINS_CALLBACK) (WIN32_FIND_DATA * fd, TCHAR *path, WPARAM wParam, LPARAM lParam);