summaryrefslogtreecommitdiff
path: root/include/delphi/m_api.pas
diff options
context:
space:
mode:
Diffstat (limited to 'include/delphi/m_api.pas')
-rw-r--r--include/delphi/m_api.pas19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/delphi/m_api.pas b/include/delphi/m_api.pas
index 70d52c39af..21b2a365ac 100644
--- a/include/delphi/m_api.pas
+++ b/include/delphi/m_api.pas
@@ -140,6 +140,16 @@ type
true : (uuid :MUUID); // plugin's unique identifier
end;
+type
+ PCMPlugin = ^CMPlugin;
+ CMPlugin = record
+ m_hInst : THANDLE;
+ m_szModule : PAnsiChar;
+ m_pInfo : PPLUGININFOEX;
+ m_hLogger : THANDLE;
+ m_hLang : int;
+ end;
+
//----- Fork enchancement -----
{
Miranda/System/LoadModule event
@@ -180,6 +190,7 @@ var
{ has to be returned via MirandaPluginInfo and has to be statically allocated,
this means only one module can return info, you shouldn't be merging them anyway! }
PluginInfo: TPLUGININFOEX;
+ g_plugin: CMPlugin;
{$include m_clist.inc}
{$include m_genmenu.inc}
@@ -243,4 +254,12 @@ implementation
{$undef M_API_UNIT}
{$include m_helpers.inc}
+initialization
+ g_plugin.m_hInst := hInstance;
+ RegisterPlugin(g_plugin);
+ hLangpack := g_plugin.m_hLang;
+
+finalization
+ UnregisterPlugin(g_plugin);
+
end.