summaryrefslogtreecommitdiff
path: root/plugins/CryptoPP/main.cpp
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-05-15 10:38:20 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-05-15 10:38:20 +0000
commit48540940b6c28bb4378abfeb500ec45a625b37b6 (patch)
tree2ef294c0763e802f91d868bdef4229b6868527de /plugins/CryptoPP/main.cpp
parent5c350913f011e119127baeb32a6aedeb4f0d33bc (diff)
initial commit
git-svn-id: http://svn.miranda-ng.org/main/trunk@2 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CryptoPP/main.cpp')
-rw-r--r--plugins/CryptoPP/main.cpp87
1 files changed, 87 insertions, 0 deletions
diff --git a/plugins/CryptoPP/main.cpp b/plugins/CryptoPP/main.cpp
new file mode 100644
index 0000000000..99fc56f467
--- /dev/null
+++ b/plugins/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