summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-06-06 20:43:53 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-06-06 20:43:53 +0000
commit74aabf4bccef1ebe3eace60a9694f44e9a0499ec (patch)
tree2bdb722b706c0a688fb5141ef4197827e61f747c /plugins
parent83246d23d9e1c1feeaee267b9a1b68c4766e7114 (diff)
that's all changes
git-svn-id: http://svn.miranda-ng.org/main/trunk@341 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/AssocMgr/assoclist.cpp2
-rw-r--r--plugins/AssocMgr/assocmgr.vcxproj.filters4
-rw-r--r--plugins/AssocMgr/common.h1
-rw-r--r--plugins/AssocMgr/dde.cpp8
-rw-r--r--plugins/AssocMgr/main.cpp53
-rw-r--r--plugins/AssocMgr/reg.cpp6
-rw-r--r--plugins/AssocMgr/utils.cpp7
-rw-r--r--plugins/AssocMgr/version.h39
-rw-r--r--plugins/AssocMgr/version.rc35
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 @@
<UniqueIdentifier>{6f8e30e0-bc03-46e7-b039-e0fbd019afb2}</UniqueIdentifier>
<Extensions>txt</Extensions>
</Filter>
- <Filter Include="SDK">
- <UniqueIdentifier>{cc674aae-3e65-4f1c-959f-c95acfe7111a}</UniqueIdentifier>
- <Extensions>*.h</Extensions>
- </Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="assoclist.cpp">
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 <stdio.h> /* for mir_snprintf() */
#include <Vsstyle.h>
#include <Vssym32.h>
+#include <malloc.h>
#define MIRANDA_VER 0x0A00
#include <newpluginapi.h>
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)<NEEDED_MIRANDA_VERSION) {
- char szText[256];
- mir_snprintf(szText,sizeof(szText),Translate("The File Association Manager Plugin can not be loaded. It requires Miranda IM %hs or later."),NEEDED_MIRANDA_VERSION_STR);
- MessageBoxA(NULL,szText,Translate("File Association Manager Plugin"),MB_OK|MB_ICONINFORMATION|MB_SETFOREGROUND|MB_TOPMOST|MB_TASKMODAL);
- return 1;
- }
-
if (!ServiceExists(MS_DB_CONTACT_GETSETTING_STR)) return 1; /* dbx3x v0.5.1.0 */
if(mir_getMMI(&mmi)) return 1;
if(mir_getUTFI(&utfi)) return 1;
@@ -140,15 +119,11 @@ __declspec(dllexport) int Load(PLUGINLINK *link)
return 0;
}
-__declspec(dllexport) int Unload(void)
+extern "C" __declspec(dllexport) int Unload(void)
{
UninitTest();
UninitDde();
UninitAssocList();
UnhookEvent(hHookModulesLoaded);
return 0;
-}
-
-#ifdef __cplusplus
-}
-#endif
+} \ No newline at end of file
diff --git a/plugins/AssocMgr/reg.cpp b/plugins/AssocMgr/reg.cpp
index 09b58a1462..53cee0a90a 100644
--- a/plugins/AssocMgr/reg.cpp
+++ b/plugins/AssocMgr/reg.cpp
@@ -115,9 +115,9 @@ char *MakeUrlClassName(const char *pszUrl)
return pszClass;
}
-static BOOL IsFileClassName(const char *pszClassName,const char **ppszFileExt)
+static BOOL IsFileClassName(char *pszClassName, char **ppszFileExt)
{
- *ppszFileExt=strchr(pszClassName,'.');
+ *ppszFileExt = strchr(pszClassName,'.');
return *ppszFileExt!=NULL;
}
@@ -165,7 +165,7 @@ static BOOL IsValidRunCommand(const TCHAR *pszRunCmd)
{
TCHAR *buf,*pexe,*pargs;
TCHAR szFullExe[MAX_PATH],*pszFilePart;
- buf=lstrcpy(_alloca((lstrlen(pszRunCmd)+1)*sizeof(TCHAR)),pszRunCmd);
+ buf=lstrcpy((TCHAR*)_alloca((lstrlen(pszRunCmd)+1)*sizeof(TCHAR)),pszRunCmd);
/* split into executable path and arguments */
if(buf[0]==_T('\"')) {
pargs=_tcschr(&buf[1],_T('\"'));
diff --git a/plugins/AssocMgr/utils.cpp b/plugins/AssocMgr/utils.cpp
index 89e0867a59..663484142a 100644
--- a/plugins/AssocMgr/utils.cpp
+++ b/plugins/AssocMgr/utils.cpp
@@ -112,7 +112,7 @@ static int EnumPrefixSettingsProc(const char *pszSetting,LPARAM lParam)
if (!strncmp(pszSetting,param->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
-
-
-
-