77 lines
2.1 KiB
C#
77 lines
2.1 KiB
C#
|
using System;
|
|||
|
using System.Runtime.CompilerServices;
|
|||
|
using Virtuoso.Hyphen.Mini;
|
|||
|
|
|||
|
namespace Virtuoso.Hyphen.Mini
|
|||
|
{
|
|||
|
public class dll
|
|||
|
{
|
|||
|
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.Synchronized)]
|
|||
|
private static void Connect(bool ex)
|
|||
|
{
|
|||
|
if (Connection == null)
|
|||
|
{
|
|||
|
Connection = new Module(ex);
|
|||
|
}
|
|||
|
}
|
|||
|
public static IntPtr DatabasePluginInfo(IntPtr pReserved)
|
|||
|
{
|
|||
|
return Connection.ExecuteCustomApiExport<IntPtr>("DatabasePluginInfo", NewVector(pReserved));
|
|||
|
}
|
|||
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|||
|
private static IntPtr MirandaPluginInfo(uint version)
|
|||
|
{
|
|||
|
return Connection.MirandaPluginInfo(version);
|
|||
|
}
|
|||
|
public static IntPtr MirandaPluginInfoExThunk(uint version)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
Connect(true);
|
|||
|
}
|
|||
|
catch (Exception)
|
|||
|
{
|
|||
|
return IntPtr.Zero;
|
|||
|
}
|
|||
|
return MirandaPluginInfo(version);
|
|||
|
}
|
|||
|
public static IntPtr MirandaPluginInfoThunk(uint version)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
Connect(false);
|
|||
|
}
|
|||
|
catch (Exception)
|
|||
|
{
|
|||
|
return IntPtr.Zero;
|
|||
|
}
|
|||
|
return MirandaPluginInfo(version);
|
|||
|
}
|
|||
|
public static IntPtr MirandaPluginInterfaces()
|
|||
|
{
|
|||
|
return Connection.MirandaPluginInterfaces();
|
|||
|
}
|
|||
|
public static int Unload()
|
|||
|
{
|
|||
|
return Connection.Unload();
|
|||
|
}
|
|||
|
public static int CListInitialise(IntPtr pPluginLink)
|
|||
|
{
|
|||
|
return Load(pPluginLink);
|
|||
|
}
|
|||
|
public static int Load(IntPtr pPluginLink)
|
|||
|
{
|
|||
|
return Connection.Load(pPluginLink);
|
|||
|
}
|
|||
|
private static Module Connection;
|
|||
|
internal static object[] NewVector(object A_0)
|
|||
|
{
|
|||
|
return new object[] { A_0 };
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|