#include "Mra.h" MRA_SETTINGS masMraSettings; int hLangpack; PLUGININFOEX pluginInfoEx={ sizeof(PLUGININFOEX), PROTOCOL_DISPLAY_NAME_ORIGA, PLUGIN_VERSION_DWORD, "Provides support for Mail.ru agent Instant Messenger protocol ("__DATE__" "__TIME__")", "Rozhuk Ivan", "Rozhuk_I@mail.ru", "© 2006-2011 Rozhuk Ivan", "http://addons.miranda-im.org/details.php?action=viewfile&id=2544", UNICODE_AWARE, //not transient 0, //doesn't replace anything built-in // {E7C48BAB-8ACE-4CB3-8446-D4B73481F497} { 0xe7c48bab, 0x8ace, 0x4cb3, { 0x84, 0x46, 0xd4, 0xb7, 0x34, 0x81, 0xf4, 0x97 } } }; static const MUUID interfaces[]={MIID_PROTOCOL,MIID_LAST}; int OnModulesLoaded (WPARAM wParam,LPARAM lParam); int OnPreShutdown (WPARAM wParam,LPARAM lParam); void VersionConversions (); BOOL WINAPI DllMain(HINSTANCE hInstance,DWORD dwReason,LPVOID Reserved) { switch(dwReason){ case DLL_PROCESS_ATTACH: bzero(&masMraSettings,sizeof(masMraSettings)); masMraSettings.hInstance=hInstance; masMraSettings.hHeap=HeapCreate(0,0,0);//GetProcessHeap(); masMraSettings.bLoggedIn=FALSE; masMraSettings.dwStatusMode=ID_STATUS_OFFLINE; masMraSettings.dwDesiredStatusMode=ID_STATUS_OFFLINE; DisableThreadLibraryCalls((HMODULE)hInstance); break; case DLL_PROCESS_DETACH: HeapDestroy(masMraSettings.hHeap); masMraSettings.hHeap=NULL; case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: break; } return(TRUE); } extern "C" MRA_API PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) { return(&pluginInfoEx); } extern "C" MRA_API const MUUID* MirandaPluginInterfaces() { return(interfaces); } extern "C" MRA_API int Load(void) { SIZE_T dwBuffLen; WCHAR szBuff[MAX_FILEPATH]; LPSTR lpszFullFileName=(LPSTR)szBuff; LPWSTR lpwszFileName; PROTOCOLDESCRIPTOR pd={0}; mir_getLP(&pluginInfoEx); // Get module name from DLL file name if (GetModuleFileName(masMraSettings.hInstance,szBuff,MAX_FILEPATH)) { WCHAR sztmBuff[MAX_FILEPATH]; if ((dwBuffLen=GetFullPathName(szBuff,MAX_FILEPATH,sztmBuff,&lpwszFileName))) { dwBuffLen=(lstrlenW(lpwszFileName)-4); //lpwszFileName=L"MRA.dll"; //dwBuffLen=3; masMraSettings.dwModuleNameLen=(dwBuffLen