From 6571a527400a6b5efc787305f57f3052abd1e761 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 29 Apr 2015 21:37:57 +0000 Subject: unified project for MRA protocol git-svn-id: http://svn.miranda-ng.org/main/trunk@13260 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MRA/Mra.vcxproj | 38 +++++ protocols/MRA/Mra.vcxproj.filters | 4 + protocols/MRA/Mra_10.vcxproj | 258 ------------------------------ protocols/MRA/Mra_10.vcxproj.filters | 182 --------------------- protocols/MRA/Mra_12.vcxproj | 270 -------------------------------- protocols/MRA/Mra_12.vcxproj.filters | 182 --------------------- protocols/MRA/src/Mra.cpp | 2 +- protocols/MRA/src/Mra.h | 243 ---------------------------- protocols/MRA/src/MraAdvancedSearch.cpp | 2 +- protocols/MRA/src/MraAvatars.cpp | 2 +- protocols/MRA/src/MraChat.cpp | 2 +- protocols/MRA/src/MraFilesQueue.cpp | 2 +- protocols/MRA/src/MraIcons.cpp | 2 +- protocols/MRA/src/MraMPop.cpp | 2 +- protocols/MRA/src/MraMRIMProxy.cpp | 2 +- protocols/MRA/src/MraOfflineMsg.cpp | 2 +- protocols/MRA/src/MraPopUp.cpp | 2 +- protocols/MRA/src/MraProto.cpp | 2 +- protocols/MRA/src/MraProto.h | 3 +- protocols/MRA/src/MraRTFMsg.cpp | 2 +- protocols/MRA/src/MraSelectEMail.cpp | 2 +- protocols/MRA/src/MraSendCommand.cpp | 10 +- protocols/MRA/src/MraSendQueue.cpp | 2 +- protocols/MRA/src/Mra_functions.cpp | 22 +-- protocols/MRA/src/Mra_menus.cpp | 2 +- protocols/MRA/src/Mra_options.cpp | 2 +- protocols/MRA/src/Mra_proto.cpp | 14 +- protocols/MRA/src/Mra_svcs.cpp | 2 +- protocols/MRA/src/Sdk/SHA1.h | 2 +- protocols/MRA/src/stdafx.cpp | 18 --- protocols/MRA/src/stdafx.cxx | 18 +++ protocols/MRA/src/stdafx.h | 237 ++++++++++++++++++++++++++++ 32 files changed, 340 insertions(+), 1195 deletions(-) create mode 100644 protocols/MRA/Mra.vcxproj create mode 100644 protocols/MRA/Mra.vcxproj.filters delete mode 100644 protocols/MRA/Mra_10.vcxproj delete mode 100644 protocols/MRA/Mra_10.vcxproj.filters delete mode 100644 protocols/MRA/Mra_12.vcxproj delete mode 100644 protocols/MRA/Mra_12.vcxproj.filters delete mode 100644 protocols/MRA/src/Mra.h delete mode 100644 protocols/MRA/src/stdafx.cpp create mode 100644 protocols/MRA/src/stdafx.cxx create mode 100644 protocols/MRA/src/stdafx.h (limited to 'protocols') diff --git a/protocols/MRA/Mra.vcxproj b/protocols/MRA/Mra.vcxproj new file mode 100644 index 0000000000..f67828c014 --- /dev/null +++ b/protocols/MRA/Mra.vcxproj @@ -0,0 +1,38 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA} + MRA + + + + + + + {e2a369cd-eda3-414f-8ad0-e732cd7ee68c} + false + + + {e2a369cd-eda3-414f-8ad0-e732cd7ee68c} + false + + + \ No newline at end of file diff --git a/protocols/MRA/Mra.vcxproj.filters b/protocols/MRA/Mra.vcxproj.filters new file mode 100644 index 0000000000..de5ad9f66c --- /dev/null +++ b/protocols/MRA/Mra.vcxproj.filters @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/protocols/MRA/Mra_10.vcxproj b/protocols/MRA/Mra_10.vcxproj deleted file mode 100644 index ec7485b3d7..0000000000 --- a/protocols/MRA/Mra_10.vcxproj +++ /dev/null @@ -1,258 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA} - MRA - - - - DynamicLibrary - Unicode - true - - - DynamicLibrary - Unicode - - - DynamicLibrary - Unicode - true - - - DynamicLibrary - Unicode - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - Disabled - _DEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS;%(PreprocessorDefinitions) - true - true - EnableFastChecks - MultiThreadedDebugDLL - Use - Mra.h - Level4 - EditAndContinue - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - 4312;4267 - - - type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies) - true - Windows - false - $(IntDir)$(TargetName).lib - $(ProfileDir)..\..\bin10\lib - - - ..\..\include\msapi - _DEBUG;%(PreprocessorDefinitions) - - - - - Disabled - _DEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS;%(PreprocessorDefinitions) - true - true - EnableFastChecks - MultiThreadedDebugDLL - Use - Mra.h - Level4 - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - 4312;4267 - - - true - Windows - false - $(IntDir)$(TargetName).lib - $(ProfileDir)..\..\bin10\lib - - - ..\..\include\msapi - _DEBUG;%(PreprocessorDefinitions) - - - - - Full - OnlyExplicitInline - Size - NDEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS;%(PreprocessorDefinitions) - true - false - true - Use - Level4 - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - true - Mra.h - 4312;4267 - - - type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies) - Windows - true - true - $(IntDir)$(TargetName).lib - false - true - $(ProfileDir)..\..\bin10\lib - /PDBALTPATH:%_PDB% - - - ..\..\include\msapi - NDEBUG;%(PreprocessorDefinitions) - - - - - Full - OnlyExplicitInline - Size - NDEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS;%(PreprocessorDefinitions) - true - false - false - Use - Level4 - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - true - Mra.h - false - 4312;4267 - - - true - Windows - true - true - false - $(IntDir)$(TargetName).lib - $(ProfileDir)..\..\bin10\lib - /PDBALTPATH:%_PDB% - - - ..\..\include\msapi - NDEBUG;%(PreprocessorDefinitions) - - - - - - Create - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {e2a369cd-eda3-414f-8ad0-e732cd7ee68c} - - - - - - \ No newline at end of file diff --git a/protocols/MRA/Mra_10.vcxproj.filters b/protocols/MRA/Mra_10.vcxproj.filters deleted file mode 100644 index 78ea889321..0000000000 --- a/protocols/MRA/Mra_10.vcxproj.filters +++ /dev/null @@ -1,182 +0,0 @@ - - - - - {28f9c5b1-e22e-47c3-9588-4f293878aa27} - cpp;c;cxx;def;odl;idl;hpj;bat;asm - - - {fb50d277-d7b3-44a3-9330-fa8332ee1975} - h;hpp;hxx;hm;inl;inc - - - {482639cd-fb25-4cfb-9e55-4a299271787c} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - {09f251ef-6cd8-48b3-a275-f10b210f5459} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/protocols/MRA/Mra_12.vcxproj b/protocols/MRA/Mra_12.vcxproj deleted file mode 100644 index fc3a0d39ea..0000000000 --- a/protocols/MRA/Mra_12.vcxproj +++ /dev/null @@ -1,270 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA} - MRA - - - - DynamicLibrary - Unicode - true - v120_xp - - - DynamicLibrary - Unicode - v120_xp - - - DynamicLibrary - Unicode - true - v120_xp - - - DynamicLibrary - Unicode - v120_xp - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - Disabled - _DEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS;%(PreprocessorDefinitions) - true - true - EnableFastChecks - MultiThreadedDebugDLL - Use - Mra.h - Level4 - EditAndContinue - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - - - 4312;4267 - - - type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies) - true - Windows - false - $(IntDir)$(TargetName).lib - $(ProfileDir)..\..\bin12\lib - false - - - ..\..\include\msapi - _DEBUG;%(PreprocessorDefinitions) - - - - - Disabled - _DEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS;%(PreprocessorDefinitions) - true - true - EnableFastChecks - MultiThreadedDebugDLL - Use - Mra.h - Level4 - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - - - 4312;4267 - - - true - Windows - false - $(IntDir)$(TargetName).lib - $(ProfileDir)..\..\bin12\lib - - - ..\..\include\msapi - _DEBUG;%(PreprocessorDefinitions) - - - - - Full - OnlyExplicitInline - Size - NDEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS;%(PreprocessorDefinitions) - true - false - true - Use - Level4 - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - true - Mra.h - - - 4312;4267 - - - type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies) - Windows - true - true - $(IntDir)$(TargetName).lib - false - true - $(ProfileDir)..\..\bin12\lib - - - ..\..\include\msapi - NDEBUG;%(PreprocessorDefinitions) - - - - - Full - OnlyExplicitInline - Size - NDEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS;%(PreprocessorDefinitions) - true - false - false - Use - Level4 - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - true - Mra.h - false - AssemblyAndSourceCode - - - 4312;4267 - - - true - Windows - true - true - false - $(IntDir)$(TargetName).lib - $(ProfileDir)..\..\bin12\lib - - - ..\..\include\msapi - NDEBUG;%(PreprocessorDefinitions) - - - - - - Create - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {e2a369cd-eda3-414f-8ad0-e732cd7ee68c} - - - - - - \ No newline at end of file diff --git a/protocols/MRA/Mra_12.vcxproj.filters b/protocols/MRA/Mra_12.vcxproj.filters deleted file mode 100644 index 78ea889321..0000000000 --- a/protocols/MRA/Mra_12.vcxproj.filters +++ /dev/null @@ -1,182 +0,0 @@ - - - - - {28f9c5b1-e22e-47c3-9588-4f293878aa27} - cpp;c;cxx;def;odl;idl;hpj;bat;asm - - - {fb50d277-d7b3-44a3-9330-fa8332ee1975} - h;hpp;hxx;hm;inl;inc - - - {482639cd-fb25-4cfb-9e55-4a299271787c} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - {09f251ef-6cd8-48b3-a275-f10b210f5459} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - Header Files\SDK - - - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/protocols/MRA/src/Mra.cpp b/protocols/MRA/src/Mra.cpp index e6c6cd3843..b86de54e6f 100644 --- a/protocols/MRA/src/Mra.cpp +++ b/protocols/MRA/src/Mra.cpp @@ -1,4 +1,4 @@ -#include "Mra.h" +#include "stdafx.h" LIST g_Instances(1, PtrKeySortT); diff --git a/protocols/MRA/src/Mra.h b/protocols/MRA/src/Mra.h deleted file mode 100644 index 31ed1ac5f0..0000000000 --- a/protocols/MRA/src/Mra.h +++ /dev/null @@ -1,243 +0,0 @@ -#if !defined(AFX_MRA_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_) -#define AFX_MRA_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_ - - -#pragma once - -#define _CRT_SECURE_NO_WARNINGS - -//#define CRTDLL - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -#include -#include -#include -#include -#include -#include -#include - -#pragma comment(lib,"Crypt32.lib") -#pragma comment(lib,"shlwapi.lib") -#pragma comment(lib,"ws2_32.lib") -#pragma comment(lib,"mswsock.lib") - -#include -#include -#include -#include -#include - -#include "../../plugins/zlib/src/zlib.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define PROTO_VERSION_MAJOR 1 -#define PROTO_VERSION_MINOR 21 - -#include "resource.h" -#include "..\xstatus_MRA\src\resource.h" - -#include "Sdk/MemoryFind.h" -#include "Sdk/MemoryFindByte.h" -#include "Sdk/BuffToLowerCase.h" -#include "Sdk/StrHexToNum.h" -#include "Sdk/timefuncs.h" -#include "Sdk/InternetTime.h" -#include "Sdk/ListMT.h" -#include "Sdk/FIFOMT.h" -#include "Sdk/RC4.h" -#include "Sdk/SHA1.h" - -// LPS -struct MRA_LPS -{ - size_t dwSize; - - union { - LPSTR lpszData; - LPWSTR lpwszData; - }; -}; - - -// GUID -struct MRA_GUID -{ - DWORD id[4]; -}; - -struct MRA_ADDR_LIST_ITEM -{ - DWORD dwPort; - DWORD dwAddr; -}; - -struct MRA_ADDR_LIST -{ - DWORD dwAddrCount; - MRA_ADDR_LIST_ITEM *pMailAddress; -}; - -///////////////////////////////////////////////////////////////////////////// - -class BinBuffer -{ - LPBYTE m_data; - size_t m_len; - -public: - BinBuffer(LPBYTE data, size_t len) : m_data(data), m_len(len) {} - - DWORD getDword(); - DWORDLONG getInt64(); - MRA_GUID getGuid(); - void getStringA(CMStringA&); - void getStringW(CMStringW&); - - __forceinline bool eof() const { return m_len == 0; } -}; - -__forceinline BinBuffer& operator >>(BinBuffer& buf, DWORD &dwVar) { dwVar = buf.getDword(); return buf; } -__forceinline BinBuffer& operator >>(BinBuffer& buf, DWORDLONG &llVar) { llVar = buf.getInt64(); return buf; } -__forceinline BinBuffer& operator >>(BinBuffer& buf, MRA_GUID &guid) { guid = buf.getGuid(); return buf; } -__forceinline BinBuffer& operator >>(BinBuffer& buf, CMStringA &sVar) { buf.getStringA(sVar); return buf; } -__forceinline BinBuffer& operator >>(BinBuffer& buf, CMStringW &sVar) { buf.getStringW(sVar); return buf; } - -///////////////////////////////////////////////////////////////////////////// - -bool DB_GetStaticStringA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize); -bool DB_GetStaticStringW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPWSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize); - -bool DB_GetStringA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA &Ret); -bool DB_GetStringW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW &Ret); - -bool DB_SetStringExA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringA &value); -bool DB_SetStringExW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringW &value); - -bool DB_GetContactSettingBlob(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize); - -#include "MraConstans.h" -#include "MraProto.h" - -extern IconItem gdiMenuItems[]; -extern IconItem gdiContactMenuItems[]; -extern IconItem gdiExtraStatusIconsItems[]; - -#include "proto.h" -#include "MraMRIMProxy.h" -#include "MraSendQueue.h" -#include "MraFilesQueue.h" -#include "MraPopup.h" -#include "MraAvatars.h" -#include "MraIcons.h" -#include "MraSelectEMail.h" -#include "MraMPop.h" - -///////////////////////////////////////////////////////////////////////////////////////// -// plugin options - -extern HINSTANCE g_hInstance; -extern HMODULE g_hDLLXStatusIcons; -extern HICON g_hMainIcon; - -extern bool g_bChatExist, g_bShutdown; - -extern size_t g_dwMirWorkDirPathLen; -extern WCHAR g_szMirWorkDirPath[MAX_FILEPATH]; - -///////////////////////////////////////////////////////////////////////////////////////// -// External variables - -extern LIST g_Instances; - -extern HANDLE hXStatusAdvancedStatusIcons[]; - -void InitExtraIcons(); - -CMStringA MraGetSelfVersionString(); - -#define GetContactNameA(Contact) (LPSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)Contact, 0) -#define GetContactNameW(Contact) (LPWSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)Contact, GCDNF_UNICODE) - -#define SetBit(bytes, bitpos) bytes |= (1< return DB_SetStringExW(Contact, m_szModuleName, valueName, parValue); } __forceinline bool mraWriteContactSettingBlob(MCONTACT hContact, const char *lpszValueName, LPVOID lpbValue, size_t dwValueSize) { - return db_set_blob(hContact, m_szModuleName, lpszValueName, lpbValue, dwValueSize) != 0; } + return db_set_blob(hContact, m_szModuleName, lpszValueName, lpbValue, (unsigned int)dwValueSize) != 0; + } __forceinline bool mraGetContactSettingBlob(MCONTACT hContact, const char *lpszValueName, LPVOID lpbRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize) { return DB_GetContactSettingBlob(hContact, m_szModuleName, lpszValueName, lpbRet, dwRetBuffSize, pdwRetBuffSize); } diff --git a/protocols/MRA/src/MraRTFMsg.cpp b/protocols/MRA/src/MraRTFMsg.cpp index f77901a825..41473cfef3 100644 --- a/protocols/MRA/src/MraRTFMsg.cpp +++ b/protocols/MRA/src/MraRTFMsg.cpp @@ -1,4 +1,4 @@ -#include "Mra.h" +#include "stdafx.h" #include "MraRTFMsg.h" diff --git a/protocols/MRA/src/MraSelectEMail.cpp b/protocols/MRA/src/MraSelectEMail.cpp index 0696b6e619..ad8b4f11a8 100644 --- a/protocols/MRA/src/MraSelectEMail.cpp +++ b/protocols/MRA/src/MraSelectEMail.cpp @@ -1,4 +1,4 @@ -#include "Mra.h" +#include "stdafx.h" #include "MraSelectEMail.h" struct MraSelectEMailDlgData diff --git a/protocols/MRA/src/MraSendCommand.cpp b/protocols/MRA/src/MraSendCommand.cpp index 7dadd9cf3c..e3a5eae541 100644 --- a/protocols/MRA/src/MraSendCommand.cpp +++ b/protocols/MRA/src/MraSendCommand.cpp @@ -1,4 +1,4 @@ -#include "Mra.h" +#include "stdafx.h" #include "MraRTFMsg.h" #include "proto.h" @@ -89,7 +89,7 @@ DWORD CMraProto::MraMessage(BOOL bAddToQueue, MCONTACT hContact, DWORD dwAckType buf.SetUL(2); buf.SetLPSW(_T(""));//***deb possible nick here buf.SetLPSW(lpwszMessage); - lpszMessageConverted = mir_base64_encode(buf.Data(), buf.Len()); + lpszMessageConverted = mir_base64_encode(buf.Data(), (int)buf.Len()); dwMessageConvertedSize = strlen(lpszMessageConverted); } // messages with Flash @@ -107,8 +107,8 @@ DWORD CMraProto::MraMessage(BOOL bAddToQueue, MCONTACT hContact, DWORD dwAckType buf.SetLPS(lpbRTFData);// ñàì ìóëüò ANSI buf.SetLPSW(lpwszMessage);// ñàì ìóëüò UNICODE - DWORD dwRTFDataSize = buf.Len(); - if ( compress2((LPBYTE)lpbRTFData, &dwRTFDataSize, buf.Data(), buf.Len(), Z_BEST_COMPRESSION) == Z_OK) { + DWORD dwRTFDataSize = (DWORD)buf.Len(); + if (compress2((LPBYTE)lpbRTFData, &dwRTFDataSize, buf.Data(), (int)buf.Len(), Z_BEST_COMPRESSION) == Z_OK) { lpszMessageRTF = mir_base64_encode((LPBYTE)lpbRTFData, dwRTFDataSize); dwMessageRTFSize = mir_strlen(lpszMessageRTF); } @@ -128,7 +128,7 @@ DWORD CMraProto::MraMessage(BOOL bAddToQueue, MCONTACT hContact, DWORD dwAckType buf.SetUL(dwBackColour); DWORD dwRTFDataSize = lpbRTFData.GetLength(); - if ( compress2((LPBYTE)(LPCSTR)lpbRTFData, &dwRTFDataSize, buf.Data(), buf.Len(), Z_BEST_COMPRESSION) == Z_OK) { + if (compress2((LPBYTE)(LPCSTR)lpbRTFData, &dwRTFDataSize, buf.Data(), (int)buf.Len(), Z_BEST_COMPRESSION) == Z_OK) { lpszMessageRTF = mir_base64_encode((LPBYTE)(LPCSTR)lpbRTFData, dwRTFDataSize); dwMessageRTFSize = mir_strlen(lpszMessageRTF); } diff --git a/protocols/MRA/src/MraSendQueue.cpp b/protocols/MRA/src/MraSendQueue.cpp index bb6467dfaa..f35fea2fe6 100644 --- a/protocols/MRA/src/MraSendQueue.cpp +++ b/protocols/MRA/src/MraSendQueue.cpp @@ -1,4 +1,4 @@ -#include "Mra.h" +#include "stdafx.h" #include "MraSendQueue.h" struct MRA_SEND_QUEUE : public LIST_MT diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 6667a15608..26ccd72fe8 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -1,4 +1,4 @@ -#include "Mra.h" +#include "stdafx.h" #define MRA_PASS_CRYPT_VER 2 @@ -189,7 +189,7 @@ bool DB_GetStaticStringA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueN if (db_get_ws(hContact, lpszModule, lpszValueName, &dbv) == 0) { size_t dwRetBuffSizeLocal, dwReadedStringLen = mir_wstrlen(dbv.pwszVal); if (lpszRetBuff && (dwRetBuffSize > dwReadedStringLen)) { - dwRetBuffSizeLocal = WideCharToMultiByte(MRA_CODE_PAGE, 0, dbv.pwszVal, dwReadedStringLen, lpszRetBuff, dwRetBuffSize, NULL, NULL); + dwRetBuffSizeLocal = WideCharToMultiByte(MRA_CODE_PAGE, 0, dbv.pwszVal, (int)dwReadedStringLen, lpszRetBuff, (int)dwRetBuffSize, NULL, NULL); (*((CHAR*)(lpszRetBuff + dwRetBuffSizeLocal))) = 0; bRet = true; } @@ -764,10 +764,10 @@ bool IsEMailMR(const CMStringA &szEmail) { if (szEmail) { for (int i = 0; lpcszMailRuDomains[i]; i++) { - int dwDomainLen = mir_strlen(lpcszMailRuDomains[i]); + size_t dwDomainLen = mir_strlen(lpcszMailRuDomains[i]); if (dwDomainLen < szEmail.GetLength()) if (!_stricmp(lpcszMailRuDomains[i], szEmail.c_str() + szEmail.GetLength() - dwDomainLen)) - if (szEmail[szEmail.GetLength() - dwDomainLen - 1] == '@') + if (szEmail[szEmail.GetLength() - (int)dwDomainLen - 1] == '@') return true; } } @@ -1052,7 +1052,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP dwBuffSize = GetDlgItemText(hWndDlg, IDC_XTITLE, szBuff, (STATUS_TITLE_MAX + 1)); if (dwBuffSize == 0) { // user delete all text mir_tstrncpy(szBuff, TranslateTS(lpcszXStatusNameDef[dat->dwXStatus]), STATUS_TITLE_MAX + 1); - dwBuffSize = mir_wstrlen(szBuff); + dwBuffSize = (DWORD)mir_wstrlen(szBuff); } mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%dName", dat->dwXStatus); dat->ppro->mraSetStringExW(NULL, szValueName, szBuff); @@ -1173,7 +1173,7 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM w TCHAR tszBuff[MAX_PATH]; size_t dwMessageSize = GetWindowTextLength(GetDlgItem(hWndDlg, IDC_MSG_TO_SEND)); - EnableWindow(GetDlgItem(hWndDlg, IDOK), dwMessageSize); + EnableWindow(GetDlgItem(hWndDlg, IDOK), (int)dwMessageSize); mir_sntprintf(tszBuff, SIZEOF(tszBuff), _T("%d/%d"), dwMessageSize, MICBLOG_STATUS_MAX); SetDlgItemText(hWndDlg, IDC_STATIC_CHARS_COUNTER, tszBuff); } @@ -1234,8 +1234,8 @@ DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD DWORD dwPathLen, dwRecDeepAllocated, dwRecDeepCurPos, dwFilePathLen; RECURSION_DATA_STACK_ITEM *prdsiItems; - if (dwFolderLen == -1) dwFolderLen = mir_wstrlen(lpszFolder); - if (dwFileNameLen == -1) dwFileNameLen = mir_wstrlen(lpszFileName); + if (dwFolderLen == -1) dwFolderLen = (int)mir_wstrlen(lpszFolder); + if (dwFileNameLen == -1) dwFileNameLen = (int)mir_wstrlen(lpszFileName); dwRecDeepCurPos = 0; dwRecDeepAllocated = RECURSION_DATA_STACK_ITEMS_MIN; @@ -1261,7 +1261,7 @@ DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD if (prdsiItems[dwRecDeepCurPos].w32fdFindFileData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {// folder if (CompareString(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, -1, _T("."), 1) != CSTR_EQUAL) if (CompareString(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, -1, _T(".."), 2) != CSTR_EQUAL) { - prdsiItems[dwRecDeepCurPos].dwFileNameLen = (mir_wstrlen(prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName) + 1); + prdsiItems[dwRecDeepCurPos].dwFileNameLen = (int)mir_wstrlen(prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName) + 1; memcpy((szPath + dwPathLen), prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, (prdsiItems[dwRecDeepCurPos].dwFileNameLen*sizeof(WCHAR))); mir_tstrcat(szPath, _T("\\*.*")); dwPathLen += prdsiItems[dwRecDeepCurPos].dwFileNameLen; @@ -1281,7 +1281,7 @@ DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD } else {// file if (CompareString(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, -1, lpszFileName, dwFileNameLen) == CSTR_EQUAL) { - prdsiItems[dwRecDeepCurPos].dwFileNameLen = mir_wstrlen(prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName); + prdsiItems[dwRecDeepCurPos].dwFileNameLen = (int)mir_wstrlen(prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName); memcpy((szPath + dwPathLen), prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, ((prdsiItems[dwRecDeepCurPos].dwFileNameLen + 1)*sizeof(WCHAR))); dwFilePathLen = (dwPathLen + prdsiItems[dwRecDeepCurPos].dwFileNameLen); @@ -1340,7 +1340,7 @@ bool CMraProto::GetPassDB(CMStringA &res) if (0 != memcmp(&btCryptedPass[1], btRandomData, MIR_SHA1_HASH_SIZE)) return false; - res = CMStringA((char*)&btCryptedPass[(1 + MIR_SHA1_HASH_SIZE)], dwPassSize); + res = CMStringA((char*)&btCryptedPass[(1 + MIR_SHA1_HASH_SIZE)], (int)dwPassSize); } else if (storageType == 1) { RC4(btCryptedPass, sizeof(btCryptedPass), bthmacSHA1, MIR_SHA1_HASH_SIZE); diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp index 30c114b49b..4fcf9cbdd0 100644 --- a/protocols/MRA/src/Mra_menus.cpp +++ b/protocols/MRA/src/Mra_menus.cpp @@ -1,4 +1,4 @@ -#include "Mra.h" +#include "stdafx.h" #include "proto.h" INT_PTR CMraProto::MraGotoInbox(WPARAM, LPARAM) diff --git a/protocols/MRA/src/Mra_options.cpp b/protocols/MRA/src/Mra_options.cpp index caba58dd7a..4bf263fb2c 100644 --- a/protocols/MRA/src/Mra_options.cpp +++ b/protocols/MRA/src/Mra_options.cpp @@ -1,4 +1,4 @@ -#include "Mra.h" +#include "stdafx.h" INT_PTR CALLBACK DlgProcOptsAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index 7951ea777c..53fa0e572b 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -1,4 +1,4 @@ -#include "Mra.h" +#include "stdafx.h" #include "MraOfflineMsg.h" #include "MraRTFMsg.h" #include "MraPlaces.h" @@ -156,7 +156,7 @@ DWORD CMraProto::MraGetNLBData(CMStringA &szHost, WORD *pwPort) bContinue = FALSE; break; case 1: - dwBytesReceived = Netlib_Recv(nls.hReadConns[0], (LPSTR)(btBuff + dwRcvBuffSizeUsed), (SIZEOF(btBuff) - dwRcvBuffSizeUsed), 0); + dwBytesReceived = Netlib_Recv(nls.hReadConns[0], (LPSTR)(btBuff + dwRcvBuffSizeUsed), (int)(SIZEOF(btBuff) - dwRcvBuffSizeUsed), 0); if (dwBytesReceived && dwBytesReceived != SOCKET_ERROR) dwRcvBuffSizeUsed += dwBytesReceived; else @@ -270,7 +270,7 @@ DWORD CMraProto::MraNetworkDispatcher() lpbBufferRcv = (LPBYTE)mir_realloc(lpbBufferRcv, dwRcvBuffSize); } - DWORD dwBytesReceived = Netlib_Recv(nls.hReadConns[0], (LPSTR)(lpbBufferRcv + dwRcvBuffSizeUsed), (dwRcvBuffSize - dwRcvBuffSizeUsed), 0); + DWORD dwBytesReceived = Netlib_Recv(nls.hReadConns[0], (LPSTR)(lpbBufferRcv + dwRcvBuffSizeUsed), (int)(dwRcvBuffSize - dwRcvBuffSizeUsed), 0); if ( !dwBytesReceived || dwBytesReceived == SOCKET_ERROR) { // disconnected if (m_iStatus != ID_STATUS_OFFLINE) { dwRetErrorCode = GetLastError(); @@ -281,8 +281,8 @@ DWORD CMraProto::MraNetworkDispatcher() dwRcvBuffSizeUsed += dwBytesReceived; while (TRUE) { - dwDataCurrentBuffSize = (dwRcvBuffSize - dwDataCurrentBuffOffset); - dwDataCurrentBuffSizeUsed = (dwRcvBuffSizeUsed - dwDataCurrentBuffOffset); + dwDataCurrentBuffSize = (int)(dwRcvBuffSize - dwDataCurrentBuffOffset); + dwDataCurrentBuffSizeUsed = (int)(dwRcvBuffSizeUsed - dwDataCurrentBuffOffset); pmaHeader = (mrim_packet_header_t*)(lpbBufferRcv + dwDataCurrentBuffOffset); // packet header received @@ -1604,7 +1604,7 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, CMStringA & if (lpbRTFData) { unsigned dwCompressedSize; mir_ptr lpbCompressed((LPBYTE)mir_base64_decode(plpsRFTText, &dwCompressedSize)); - DWORD dwRTFDataSize = dwRFTBuffSize; + DWORD dwRTFDataSize = (DWORD)dwRFTBuffSize; if (uncompress(lpbRTFData, &dwRTFDataSize, lpbCompressed, dwCompressedSize) == Z_OK) { BinBuffer buf(lpbRTFData, dwRTFDataSize); @@ -1814,7 +1814,7 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, CMStringA & DWORD GetMraXStatusIDFromMraUriStatus(const char *szStatusUri) { if (szStatusUri) - for (size_t i = 0; lpcszStatusUri[i]; i++) + for (DWORD i = 0; lpcszStatusUri[i]; i++) if (!_stricmp(lpcszStatusUri[i], szStatusUri)) return i; diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp index e27035996f..efeb16445a 100644 --- a/protocols/MRA/src/Mra_svcs.cpp +++ b/protocols/MRA/src/Mra_svcs.cpp @@ -1,4 +1,4 @@ -#include "Mra.h" +#include "stdafx.h" #include "proto.h" LPCSTR lpcszStatusUri[] = diff --git a/protocols/MRA/src/Sdk/SHA1.h b/protocols/MRA/src/Sdk/SHA1.h index 96449340bd..74e83edd8b 100644 --- a/protocols/MRA/src/Sdk/SHA1.h +++ b/protocols/MRA/src/Sdk/SHA1.h @@ -80,7 +80,7 @@ __inline void SHA1GetDigest(LPVOID lpBuff,size_t dwBuffSize,BYTE *digest) mir_sha1_ctx sha; mir_sha1_init(&sha); - mir_sha1_append(&sha,(BYTE*)lpBuff,dwBuffSize); + mir_sha1_append(&sha,(BYTE*)lpBuff,(int)dwBuffSize); mir_sha1_finish(&sha,digest); } diff --git a/protocols/MRA/src/stdafx.cpp b/protocols/MRA/src/stdafx.cpp deleted file mode 100644 index 2d97a6a925..0000000000 --- a/protocols/MRA/src/stdafx.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright (C) 2012-15 Miranda NG project (http://miranda-ng.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation version 2 -of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "Mra.h" \ No newline at end of file diff --git a/protocols/MRA/src/stdafx.cxx b/protocols/MRA/src/stdafx.cxx new file mode 100644 index 0000000000..6fb37564b7 --- /dev/null +++ b/protocols/MRA/src/stdafx.cxx @@ -0,0 +1,18 @@ +/* +Copyright (C) 2012-15 Miranda NG project (http://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "stdafx.h" \ No newline at end of file diff --git a/protocols/MRA/src/stdafx.h b/protocols/MRA/src/stdafx.h new file mode 100644 index 0000000000..7b93e1b833 --- /dev/null +++ b/protocols/MRA/src/stdafx.h @@ -0,0 +1,237 @@ +#if !defined(AFX_MRA_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_) +#define AFX_MRA_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_ + +#pragma once + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers + +#include +#include +#include +#include +#include +#include +#include + +#pragma comment(lib,"shlwapi.lib") +#pragma comment(lib,"ws2_32.lib") +#pragma comment(lib,"mswsock.lib") + +#include +#include +#include +#include +#include + +#include "../../plugins/zlib/src/zlib.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PROTO_VERSION_MAJOR 1 +#define PROTO_VERSION_MINOR 21 + +#include "resource.h" +#include "..\xstatus_MRA\src\resource.h" + +#include "Sdk/MemoryFind.h" +#include "Sdk/MemoryFindByte.h" +#include "Sdk/BuffToLowerCase.h" +#include "Sdk/StrHexToNum.h" +#include "Sdk/timefuncs.h" +#include "Sdk/InternetTime.h" +#include "Sdk/ListMT.h" +#include "Sdk/FIFOMT.h" +#include "Sdk/RC4.h" +#include "Sdk/SHA1.h" + +// LPS +struct MRA_LPS +{ + size_t dwSize; + + union { + LPSTR lpszData; + LPWSTR lpwszData; + }; +}; + + +// GUID +struct MRA_GUID +{ + DWORD id[4]; +}; + +struct MRA_ADDR_LIST_ITEM +{ + DWORD dwPort; + DWORD dwAddr; +}; + +struct MRA_ADDR_LIST +{ + DWORD dwAddrCount; + MRA_ADDR_LIST_ITEM *pMailAddress; +}; + +///////////////////////////////////////////////////////////////////////////// + +class BinBuffer +{ + LPBYTE m_data; + size_t m_len; + +public: + BinBuffer(LPBYTE data, size_t len) : m_data(data), m_len(len) {} + + DWORD getDword(); + DWORDLONG getInt64(); + MRA_GUID getGuid(); + void getStringA(CMStringA&); + void getStringW(CMStringW&); + + __forceinline bool eof() const { return m_len == 0; } +}; + +__forceinline BinBuffer& operator >>(BinBuffer& buf, DWORD &dwVar) { dwVar = buf.getDword(); return buf; } +__forceinline BinBuffer& operator >>(BinBuffer& buf, DWORDLONG &llVar) { llVar = buf.getInt64(); return buf; } +__forceinline BinBuffer& operator >>(BinBuffer& buf, MRA_GUID &guid) { guid = buf.getGuid(); return buf; } +__forceinline BinBuffer& operator >>(BinBuffer& buf, CMStringA &sVar) { buf.getStringA(sVar); return buf; } +__forceinline BinBuffer& operator >>(BinBuffer& buf, CMStringW &sVar) { buf.getStringW(sVar); return buf; } + +///////////////////////////////////////////////////////////////////////////// + +bool DB_GetStaticStringA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize); +bool DB_GetStaticStringW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPWSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize); + +bool DB_GetStringA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA &Ret); +bool DB_GetStringW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW &Ret); + +bool DB_SetStringExA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringA &value); +bool DB_SetStringExW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringW &value); + +bool DB_GetContactSettingBlob(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize); + +#include "MraConstans.h" +#include "MraProto.h" + +extern IconItem gdiMenuItems[]; +extern IconItem gdiContactMenuItems[]; +extern IconItem gdiExtraStatusIconsItems[]; + +#include "proto.h" +#include "MraMRIMProxy.h" +#include "MraSendQueue.h" +#include "MraFilesQueue.h" +#include "MraPopup.h" +#include "MraAvatars.h" +#include "MraIcons.h" +#include "MraSelectEMail.h" +#include "MraMPop.h" + +///////////////////////////////////////////////////////////////////////////////////////// +// plugin options + +extern HINSTANCE g_hInstance; +extern HMODULE g_hDLLXStatusIcons; +extern HICON g_hMainIcon; + +extern bool g_bChatExist, g_bShutdown; + +extern size_t g_dwMirWorkDirPathLen; +extern WCHAR g_szMirWorkDirPath[MAX_FILEPATH]; + +///////////////////////////////////////////////////////////////////////////////////////// +// External variables + +extern LIST g_Instances; + +extern HANDLE hXStatusAdvancedStatusIcons[]; + +void InitExtraIcons(); + +CMStringA MraGetSelfVersionString(); + +#define GetContactNameA(Contact) (LPSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)Contact, 0) +#define GetContactNameW(Contact) (LPWSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)Contact, GCDNF_UNICODE) + +#define SetBit(bytes, bitpos) bytes |= (1<