From 74aabf4bccef1ebe3eace60a9694f44e9a0499ec Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Wed, 6 Jun 2012 20:43:53 +0000 Subject: that's all changes git-svn-id: http://svn.miranda-ng.org/main/trunk@341 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AssocMgr/assoclist.cpp | 2 +- plugins/AssocMgr/assocmgr.vcxproj.filters | 4 --- plugins/AssocMgr/common.h | 1 + plugins/AssocMgr/dde.cpp | 8 +++-- plugins/AssocMgr/main.cpp | 53 ++++++++----------------------- plugins/AssocMgr/reg.cpp | 6 ++-- plugins/AssocMgr/utils.cpp | 7 ++-- plugins/AssocMgr/version.h | 39 ++++++++++++----------- plugins/AssocMgr/version.rc | 35 ++++++-------------- 9 files changed, 58 insertions(+), 97 deletions(-) diff --git a/plugins/AssocMgr/assoclist.cpp b/plugins/AssocMgr/assoclist.cpp index 26a72a43da..03c016ce54 100644 --- a/plugins/AssocMgr/assoclist.cpp +++ b/plugins/AssocMgr/assoclist.cpp @@ -614,7 +614,7 @@ INT_PTR InvokeFileHandler(const TCHAR *pszFileName) INT_PTR res = CALLSERVICE_NOTFOUND; /* find extension */ - p = _tcsrchr(pszFileName, _T('.')); + p = (TCHAR*)_tcsrchr(pszFileName, _T('.')); if(p!= NULL) { pszFileExt = t2a(p); if(pszFileExt!= NULL) { diff --git a/plugins/AssocMgr/assocmgr.vcxproj.filters b/plugins/AssocMgr/assocmgr.vcxproj.filters index 4a7380ccf4..295050b0e0 100644 --- a/plugins/AssocMgr/assocmgr.vcxproj.filters +++ b/plugins/AssocMgr/assocmgr.vcxproj.filters @@ -17,10 +17,6 @@ {6f8e30e0-bc03-46e7-b039-e0fbd019afb2} txt - - {cc674aae-3e65-4f1c-959f-c95acfe7111a} - *.h - diff --git a/plugins/AssocMgr/common.h b/plugins/AssocMgr/common.h index 6f5592f524..9f6c0b7505 100644 --- a/plugins/AssocMgr/common.h +++ b/plugins/AssocMgr/common.h @@ -33,6 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include /* for mir_snprintf() */ #include #include +#include #define MIRANDA_VER 0x0A00 #include diff --git a/plugins/AssocMgr/dde.cpp b/plugins/AssocMgr/dde.cpp index 0804be855c..5b95499c5d 100644 --- a/plugins/AssocMgr/dde.cpp +++ b/plugins/AssocMgr/dde.cpp @@ -30,8 +30,9 @@ static HANDLE hHookModulesLoaded,hHookPreShutdown; /************************* Open Handler ***************************/ // pszFilePath needs to be allocated using mir_alloc() -static void __stdcall FileActionAsync(TCHAR *pszFilePath) +static void __stdcall FileActionAsync(void *param) { + TCHAR *pszFilePath = (TCHAR*)param; /* invoke main handler */ switch(InvokeFileHandler(pszFilePath)) { /* pszFilePath is always a long path name */ case 0: /* success */ break; @@ -45,8 +46,9 @@ static void __stdcall FileActionAsync(TCHAR *pszFilePath) } // pszUrl needs to be allocated using mir_alloc() -static void __stdcall UrlActionAsync(TCHAR *pszUrl) +static void __stdcall UrlActionAsync(void *param) { + TCHAR *pszUrl = (TCHAR*)param; /* invoke main handler */ switch(InvokeUrlHandler(pszUrl)) { case 0: /* success */ break; @@ -111,7 +113,7 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd,UINT msg,WPARAM wParam,LPARAM /* ANSI execute command can't happen for shell */ if(IsWindowUnicode((HWND)wParam)) { #endif - pszCommand=GlobalLock(hCommand); + pszCommand = (TCHAR*)GlobalLock(hCommand); if(pszCommand!=NULL) { TCHAR *pszAction,*pszArg; pszAction=GetExecuteParam(&pszCommand); diff --git a/plugins/AssocMgr/main.cpp b/plugins/AssocMgr/main.cpp index a689ad654d..2a1ad430a2 100644 --- a/plugins/AssocMgr/main.cpp +++ b/plugins/AssocMgr/main.cpp @@ -31,13 +31,13 @@ int hLangpack; PLUGININFOEX pluginInfo={ sizeof(PLUGININFOEX), - "File Association Manager", - PLUGIN_VERSION, - "Handles file type associations and URLs like aim, ymsgr, xmpp, wpmsg, gg, tlen.", /* autotranslated */ - "H. Herkenrath", - "hrathh@users.sourceforge.net", - "© 2005-2007 H. Herkenrath", - PLUGIN_WEBSITE, + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESCRIPTION, + __AUTHOR, + __AUTHOREMAIL, + __COPYRIGHT, + __AUTHORWEB, UNICODE_AWARE, 0, // {52685CD7-0EC7-44c1-A1A6-381612418202} @@ -45,15 +45,9 @@ PLUGININFOEX pluginInfo={ }; static const MUUID interfaces[]={MIID_ASSOCMGR,MIID_AUTORUN,MIID_LAST}; -BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,void *pReserved) +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { - UNREFERENCED_PARAMETER(pReserved); - if(fdwReason==DLL_PROCESS_ATTACH) { - /* Do not call this from a DLL that is linked to the static C run-time library (CRT). - * The static CRT requires DLL_THREAD_ATTACH and DLL_THREAD_DETATCH notifications - * to function properly. */ - DisableThreadLibraryCalls(hInst=hinstDLL); - } + hInst = hinstDLL; return TRUE; } @@ -96,36 +90,21 @@ static int AssocMgrModulesLoaded(WPARAM wParam,LPARAM lParam) return 0; } -#ifdef __cplusplus -extern "C" { -#endif - -__declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) { return &pluginInfo; } -__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) +extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) { return interfaces; } -__declspec(dllexport) int Load(PLUGINLINK *link) +extern "C" __declspec(dllexport) int Load(PLUGINLINK *link) { pluginLink=link; mir_getLP(&pluginInfo); - /* existance of MS_SYSTEM_GETVERSION and MS_LANGPACK_TRANSLATESTRING - * is checked in MirandaPluginInfo(). - * Not placed in MirandaPluginInfo() to avoid MessageBoxes on plugin options. - * Using ANSI as LANG_UNICODE might not be supported. */ - if(CallService(MS_SYSTEM_GETVERSION,0,0)pszPrefix,param->nPrefixLen)) { char **buf; /* resize storage array */ - buf=mir_realloc(param->settings,(param->nSettingsCount+1)*sizeof(char*)); + buf = (char**)mir_realloc(param->settings,(param->nSettingsCount+1)*sizeof(char*)); if(buf!=NULL) { param->settings=buf; buf[param->nSettingsCount]=mir_strdup(pszSetting); @@ -142,8 +142,9 @@ BOOL EnumDbPrefixSettings(const char *pszModule,const char *pszSettingPrefix,cha /************************* Error Output ***************************/ -static void MessageBoxIndirectFree(MSGBOXPARAMSA *mbp) +static void MessageBoxIndirectFree(void *param) { + MSGBOXPARAMSA *mbp = (MSGBOXPARAMSA*)param; MessageBoxIndirectA(mbp); mir_free((char*)mbp->lpszCaption); /* does NULL check */ mir_free((char*)mbp->lpszText); /* does NULL check */ @@ -184,7 +185,7 @@ void ShowInfoMessage(BYTE flags,const char *pszTitle,const char *pszTextFmt,...) case NIIF_WARNING: mbp->dwStyle|=MB_ICONWARNING; break; case NIIF_ERROR: mbp->dwStyle|=MB_ICONERROR; } - mir_forkthread(MessageBoxIndirectFree,mbp); + mir_forkthread(MessageBoxIndirectFree, mbp); } // LocalFree() the return value diff --git a/plugins/AssocMgr/version.h b/plugins/AssocMgr/version.h index ce9485a55f..9d68defbef 100644 --- a/plugins/AssocMgr/version.h +++ b/plugins/AssocMgr/version.h @@ -19,22 +19,23 @@ along with this program (AssocMgr-License.txt); if not, write to the Free Softwa Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define NEEDED_MIRANDA_VERSION PLUGIN_MAKE_VERSION(0,6,0,0) -#define NEEDED_MIRANDA_VERSION_STR "0.6" -#define PLUGIN_VERSION PLUGIN_MAKE_VERSION(0,1,1,0) -#define FILE_VERSION 0,1,1,0 - -#if defined(_DEBUG) - #define FILE_VERSION_STR "0.1.1.1 alpha" -#else - #define FILE_VERSION_STR "0.1.1.0" -#endif - -#define PLUGIN_EMAIL "hrathh users.sourceforge.net" -#define PLUGIN_EMAIL_ATT_POS 7 /* position of the @-sign in the email adress above */ - -#if defined(_UNICODE) - #define PLUGIN_WEBSITE "http://addons.miranda-im.org/details.php?action=viewfile&id=3458" -#else - #define PLUGIN_WEBSITE "http://addons.miranda-im.org/details.php?action=viewfile&id=3457" -#endif +#define __MAJOR_VERSION 0 +#define __MINOR_VERSION 1 +#define __RELEASE_NUM 1 +#define __BUILD_NUM 0 + +#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM +#define __FILEVERSION_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM + +#define __STRINGIFY_IMPL(x) #x +#define __STRINGIFY(x) __STRINGIFY_IMPL(x) +#define __VERSION_STRING __STRINGIFY(__FILEVERSION_DOTS) + +#define __PLUGIN_NAME "File Association Manager" +#define __INTERNAL_NAME "AssocMgr" +#define __FILENAME "AssocMgr.dll" +#define __DESCRIPTION "Handles file type associations and URLs like aim, ymsgr, xmpp, wpmsg, gg, tlen." +#define __AUTHOR "H. Herkenrath" +#define __AUTHOREMAIL "hrathh@users.sourceforge.net" +#define __AUTHORWEB "http://addons.miranda-im.org/details.php?action=viewfile&id=3457" +#define __COPYRIGHT "© 2005-2007 H. Herkenrath" diff --git a/plugins/AssocMgr/version.rc b/plugins/AssocMgr/version.rc index 4234d8d7ec..b052561f31 100644 --- a/plugins/AssocMgr/version.rc +++ b/plugins/AssocMgr/version.rc @@ -1,5 +1,3 @@ -#ifndef _MAC - #include "version.h" ///////////////////////////////////////////////////////////////////////////// @@ -8,34 +6,27 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION FILE_VERSION - PRODUCTVERSION FILE_VERSION - FILEFLAGSMASK 0x0L + FILEVERSION __FILEVERSION_STRING + PRODUCTVERSION __FILEVERSION_STRING + FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif - FILEOS 0x40004L - FILETYPE 0x2L + FILEOS 0x4L + FILETYPE 0x0L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "000004b0" BEGIN - VALUE "Comments", "Licensed under the terms of the GNU General Public License" - VALUE "FileDescription", "File Association Manager Plugin for Miranda IM" - VALUE "FileVersion", FILE_VERSION_STR -#ifdef _UNICODE - VALUE "InternalName", "AssocMgr (Unicode)" -#else - VALUE "InternalName", "AssocMgr" -#endif - VALUE "LegalCopyright", "Copyright © 2005-2007 H. Herkenrath" - VALUE "OriginalFilename", "assocmgr.dll" - VALUE "ProductName", "File Association Manager" - VALUE "ProductVersion", FILE_VERSION_STR + VALUE "FileDescription", __DESCRIPTION + VALUE "InternalName", __PLUGIN_NAME + VALUE "LegalCopyright", __COPYRIGHT + VALUE "OriginalFilename", __FILENAME + VALUE "ProductName", __PLUGIN_NAME END END BLOCK "VarFileInfo" @@ -43,9 +34,3 @@ BEGIN VALUE "Translation", 0x0, 1200 END END - -#endif // !_MAC - - - - -- cgit v1.2.3