From cb4a46e7fbe62d788e66ed6121c717a2d22a4d7c Mon Sep 17 00:00:00 2001 From: watcherhd Date: Thu, 21 Apr 2011 14:14:52 +0000 Subject: svn.miranda.im is moving to a new home! git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@7 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb --- cryptopp/main.cpp | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 cryptopp/main.cpp (limited to 'cryptopp/main.cpp') diff --git a/cryptopp/main.cpp b/cryptopp/main.cpp new file mode 100644 index 0000000..99fc56f --- /dev/null +++ b/cryptopp/main.cpp @@ -0,0 +1,87 @@ +#include "commonheaders.h" + + +// dllmain +BOOL WINAPI DllMain(HINSTANCE hInst, DWORD dwReason, LPVOID) { + g_hInst = hInst; + if( dwReason == DLL_PROCESS_ATTACH ) { + { + char temp[MAX_PATH]; + GetTempPath(sizeof(temp),temp); + GetLongPathName(temp,TEMP,sizeof(TEMP)); + TEMP_SIZE = strlen(TEMP); + if(TEMP[TEMP_SIZE-1]=='\\') { + TEMP_SIZE--; + TEMP[TEMP_SIZE]='\0'; + } + } + InitializeCriticalSection(&localQueueMutex); + InitializeCriticalSection(&localContextMutex); +#ifdef _DEBUG + isVista = 1; +#else + isVista = ( (DWORD)(LOBYTE(LOWORD(GetVersion()))) == 6 ); +#endif + } + //DLL_THREAD_ATTACH + return TRUE; +} + + +PLUGININFO *MirandaPluginInfo(DWORD mirandaVersion) { + return &pluginInfo; +} + + +PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +{ + return &pluginInfoEx; +} + + +MUUID* MirandaPluginInterfaces(void) +{ + return interfaces; +} + + +int onModulesLoaded(WPARAM wParam,LPARAM lParam) { + // updater plugin support +#if defined(_DEBUG) || defined(NETLIB_LOG) + InitNetlib(); +#endif + if(ServiceExists(MS_UPDATE_REGISTERFL)) { + CallService(MS_UPDATE_REGISTERFL, (WPARAM)2669, (LPARAM)&pluginInfo); + } + return 0; +} + + +int Load(PLUGINLINK *link) { + + pluginLink = link; + DisableThreadLibraryCalls(g_hInst); + + // get memoryManagerInterface address + mir_getMMI( &mmi ); + + // register plugin module + PROTOCOLDESCRIPTOR pd; + memset(&pd,0,sizeof(pd)); + pd.cbSize = sizeof(pd); + pd.szName = (char*)szModuleName; + pd.type = PROTOTYPE_ENCRYPTION; + CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); + + // hook events + HookEvent(ME_SYSTEM_MODULESLOADED,onModulesLoaded); + return 0; +} + + +int Unload() { + return 0; +} + + +// EOF -- cgit v1.2.3