From 44555cbf80933e0fad4686341676fe345b1faff3 Mon Sep 17 00:00:00 2001 From: mataes2007 Date: Sun, 24 Apr 2011 18:36:28 +0000 Subject: stopspam: added x64 configurations added destroing functions on exit git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@29 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb --- stopspam/headers.h | 26 +++---- stopspam/src/events.cpp | 6 +- stopspam/src/services.cpp | 2 +- stopspam/src/stopspam.cpp | 9 ++- stopspam/stopspam_10.sln | 16 +++- stopspam/stopspam_10.vcxproj | 170 ++++++++++++++++++++++++++++++++++++++++++- 6 files changed, 207 insertions(+), 22 deletions(-) diff --git a/stopspam/headers.h b/stopspam/headers.h index 981749c..99a7e16 100644 --- a/stopspam/headers.h +++ b/stopspam/headers.h @@ -15,42 +15,39 @@ #include #include #include -#include "vector" // stl vector header -//#include #include #include #include #include #include #include +#include +#include +#include + #include "src/eventhooker.h" #include "res/version.h" #include "res/resource.h" #include "m_stopspam.h" -#include -#include -#include "src/m_variables.h" -#include -using namespace std; +#include #define pluginName "StopSpam" + extern char * pluginDescription; -//extern char const * defProtoList; extern TCHAR const * infTalkProtPrefix; extern char const * answeredSetting; extern char const * questCountSetting; - extern HINSTANCE hInst; #ifdef _UNICODE -typedef std::wstring tstring; -#define PREF_TCHAR2 PREF_UTF + typedef std::wstring tstring; + #define PREF_TCHAR2 PREF_UTF #else -typedef std::string tstring; -#define PREF_TCHAR2 0 + typedef std::string tstring; + #define PREF_TCHAR2 0 #endif //_UNICODE #include "src/settings.h" @@ -67,7 +64,8 @@ tstring &GetDlgItemString(HWND hwnd, int id); bool IsExistMyMessage(HANDLE hContact); tstring variables_parse(tstring const &tstrFormat, HANDLE hContact); tstring trim(tstring const &tstr, tstring const &trimChars = _T(" \f\n\r\t\v")); + INT_PTR IsContactPassed(WPARAM wParam, LPARAM /*lParam*/); INT_PTR RemoveTempContacts(WPARAM wParam,LPARAM lParam); -INT_PTR OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam); +int OnSystemModulesLoaded(WPARAM wParam, LPARAM lParam); #endif diff --git a/stopspam/src/events.cpp b/stopspam/src/events.cpp index fa73a07..74d4195 100644 --- a/stopspam/src/events.cpp +++ b/stopspam/src/events.cpp @@ -46,13 +46,15 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) #ifdef _UNICODE AuthRepl=mir_u2a(variables_parse(plSets->AuthRepl.Get(), hcntct).c_str()); #else - AuthRepl=mir_strdup( variables_parse(plSets->AuthRepl.Get(), hcntct).c_str()); + AuthRepl=variables_parse(plSets->AuthRepl.Get(), hcntct).c_str(); #endif // ...send message std::string allowService = dbei.szModule; allowService += PS_AUTHDENY; CallService(allowService.c_str(), (WPARAM)hDbEvent, (LPARAM)AuthRepl); - mir_free(AuthRepl); + #ifdef _UNICODE + mir_free(AuthRepl); + #endif DBWriteContactSettingByte(hcntct, "CList", "NotOnList", 1); DBWriteContactSettingByte(hcntct, "CList", "Hidden", 1); if (!plSets->HistLog.Get()) diff --git a/stopspam/src/services.cpp b/stopspam/src/services.cpp index 12ff332..2ea6bc5 100644 --- a/stopspam/src/services.cpp +++ b/stopspam/src/services.cpp @@ -72,7 +72,7 @@ INT_PTR RemoveTempContacts(WPARAM wParam,LPARAM lParam) return 0; } -INT_PTR OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam) +int OnSystemModulesLoaded(WPARAM wParam, LPARAM lParam) { if (plSets->RemTmpAll.Get()) RemoveTempContacts(0,0); diff --git a/stopspam/src/stopspam.cpp b/stopspam/src/stopspam.cpp index 4b84d10..ed1f203 100644 --- a/stopspam/src/stopspam.cpp +++ b/stopspam/src/stopspam.cpp @@ -4,7 +4,7 @@ struct MM_INTERFACE mmi; UTF8_INTERFACE utfi; -HANDLE hFunc; +HANDLE hFunc, hTempRemove; ///////////////////////////////////////////////////////////////////////////////////////// @@ -74,7 +74,7 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) HookEvent(ME_SYSTEM_MODULESLOADED, OnSystemModulesLoaded); // Add deliting temporary contacts - CreateServiceFunction(pluginName"/RemoveTempContacts", RemoveTempContacts); + hTempRemove = CreateServiceFunction(pluginName"/RemoveTempContacts", RemoveTempContacts); ZeroMemory(&mi, sizeof(mi)); mi.cbSize = sizeof(mi); mi.position = -0x7FFFFFFF; @@ -97,6 +97,11 @@ extern "C" int __declspec(dllexport) Unload(void) DestroyServiceFunction(hFunc); hFunc = 0; } + if(hTempRemove) + { + DestroyServiceFunction(hTempRemove); + hFunc = 0; + } delete plSets; return 0; diff --git a/stopspam/stopspam_10.sln b/stopspam/stopspam_10.sln index 1d599c0..c9d430f 100644 --- a/stopspam/stopspam_10.sln +++ b/stopspam/stopspam_10.sln @@ -1,24 +1,36 @@  Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual C++ Express 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stopspam", "stopspam_10.vcxproj", "{3E6CEC79-5E93-4607-B10E-498586ECF6A6}" +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SstopSspam", "stopspam_10.vcxproj", "{3E6CEC79-5E93-4607-B10E-498586ECF6A6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug Unicode|Win32 = Debug Unicode|Win32 + Debug Unicode|x64 = Debug Unicode|x64 Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release Unicode|Win32 = Release Unicode|Win32 + Release Unicode|x64 = Release Unicode|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 + {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 + {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|Win32.ActiveCfg = Debug|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|Win32.Build.0 = Debug|Win32 + {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|x64.ActiveCfg = Debug|x64 + {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|x64.Build.0 = Debug|x64 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 + {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 + {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Release Unicode|x64.Build.0 = Release Unicode|x64 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Release|Win32.ActiveCfg = Release|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Release|Win32.Build.0 = Release|Win32 + {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Release|x64.ActiveCfg = Release|x64 + {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/stopspam/stopspam_10.vcxproj b/stopspam/stopspam_10.vcxproj index 1e1f333..0cee108 100644 --- a/stopspam/stopspam_10.vcxproj +++ b/stopspam/stopspam_10.vcxproj @@ -5,21 +5,37 @@ Debug Unicode Win32 + + Debug Unicode + x64 + Debug Win32 + + Debug + x64 + Release Unicode Win32 + + Release Unicode + x64 + Release Win32 + + Release + x64 + - stopspam + StopSpam {3E6CEC79-5E93-4607-B10E-498586ECF6A6} stopspam Win32Proj @@ -29,20 +45,38 @@ DynamicLibrary Unicode + + DynamicLibrary + Unicode + DynamicLibrary Unicode true + + DynamicLibrary + Unicode + true + DynamicLibrary MultiByte true + + DynamicLibrary + MultiByte + true + DynamicLibrary MultiByte + + DynamicLibrary + MultiByte + @@ -50,34 +84,63 @@ + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Configuration)\Plugins + $(SolutionDir)$(Configuration)\Plugins $(SolutionDir)$(Configuration)\Obj\$(ProjectName) + $(SolutionDir)$(Configuration)\Obj\$(ProjectName) false + false $(SolutionDir)$(Configuration)\Plugins + $(SolutionDir)$(Configuration)\Plugins $(SolutionDir)$(Configuration)\Obj\$(ProjectName) + $(SolutionDir)$(Configuration)\Obj\$(ProjectName) false + false $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Plugins\ $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)\Plugins + $(SolutionDir)$(Configuration)\Plugins $(SolutionDir)$(Configuration)\Obj\$(ProjectName) + $(SolutionDir)$(Configuration)\Obj\$(ProjectName) false + false true + true @@ -104,6 +167,29 @@ MachineX86 + + + Disabled + ../../include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;STOPSPAM_EXPORTS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + comctl32.lib;%(AdditionalDependencies) + true + $(OutDir)stopspam.pdb + Windows + false + + + $(OutDir)stopspam.lib + + MinSpace @@ -135,6 +221,36 @@ MachineX86 + + + MinSpace + OnlyExplicitInline + ../../include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;STOPSPAM_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + ProgramDatabase + Default + 4996;%(DisableSpecificWarnings) + + + comctl32.lib;%(AdditionalDependencies) + true + true + NotSet + true + true + false + + + + + + MinSpace @@ -163,6 +279,33 @@ MachineX86 + + + MinSpace + OnlyExplicitInline + ../../include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;STOPSPAM_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + NotSet + + + Level3 + ProgramDatabase + Default + + + comctl32.lib;%(AdditionalDependencies) + true + Windows + true + true + false + + + + Full @@ -190,6 +333,31 @@ MachineX86 + + + Full + Size + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;STOPSPAM_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDebugDLL + StreamingSIMDExtensions + + + Level3 + ProgramDatabase + + + comctl32.lib;%(AdditionalDependencies) + true + $(OutDir)stopspam.pdb + Windows + false + + + $(OutDir)stopspam.lib + + -- cgit v1.2.3