summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-08-03 19:44:57 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-08-03 19:44:57 +0000
commit50eb80e6116dda8fb97da91146092328d0950622 (patch)
treee88d09c8a73fa12dc990bb6bb4fac89388cfa8b9
parent85b303dbbb3adf8bd060985ff3e0e5956e8a5cb9 (diff)
removed the Unicode core verification
git-svn-id: http://svn.miranda-ng.org/main/trunk@1342 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/CSList/src/cslist.cpp17
-rw-r--r--plugins/ContactsPlus/src/main.cpp29
-rw-r--r--plugins/Popup/src/main.cpp7
-rw-r--r--plugins/Scriver/src/utils.cpp39
-rw-r--r--plugins/SecureIM/src/main.cpp6
-rw-r--r--plugins/SendScreenshotPlus/src/Utils.cpp15
-rw-r--r--plugins/SmileyAdd/src/main.cpp33
-rw-r--r--plugins/UserInfoEx/src/init.cpp9
-rw-r--r--plugins/Utils/mir_memory.h11
-rw-r--r--plugins/VersionInfo/src/CVersionInfo.cpp109
-rw-r--r--plugins/helpers/gen_helpers.cpp39
-rw-r--r--protocols/IcqOscarJ/init.cpp5
-rw-r--r--protocols/JabberG/jabber_caps.cpp11
-rw-r--r--protocols/MRA/Mra_functions.cpp77
-rw-r--r--src/core/stdhelp/about.cpp37
15 files changed, 169 insertions, 275 deletions
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp
index b8078ae1be..f4ff862e9c 100644
--- a/plugins/CSList/src/cslist.cpp
+++ b/plugins/CSList/src/cslist.cpp
@@ -29,7 +29,7 @@
Last change on : $Date$
Last change by : $Author$
- ============================================================================
+ ============================================================================
DESCRIPTION:
@@ -98,14 +98,7 @@ extern "C" __declspec( dllexport ) int Load( )
CSList::bAccountsSupported = ( CSList::dwMirandaVersion >= PLUGIN_MAKE_VERSION( 0, 8, 0, 9 ));
// are we running under Unicode core?
- {
- char szVer[MAX_PATH];
-
- CallService( MS_SYSTEM_GETVERSIONTEXT, MAX_PATH, ( LPARAM )szVer );
- _strlwr( szVer ); // make sure it is lowercase
-
- CSList::bUnicodeCore = ( strstr( szVer, "unicode" ) != NULL );
- }
+ CSList::bUnicodeCore = true;
// TODO: Alerts with wrong combination of ANSI/Unicode Windows/core/plugin
@@ -682,7 +675,7 @@ CSAMWindow::CSAMWindow( WORD action, CSWindow* parent )
this->parent = parent;
this->bChanged = FALSE;
this->hCombo = this->hMessage = NULL;
-
+
if ( this->action == IDC_ADD )
this->item = new StatusItem( );
else
@@ -1185,8 +1178,8 @@ INT_PTR CALLBACK CSWindowProc( HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
csw->listview->reinitItems( csw->itemslist->list->getListHead( ));
break;
- case IDCLOSE: // close and save, no custom status
- case IDCANCEL: // close and save, no custom status
+ case IDCLOSE: // close and save, no custom status
+ case IDCANCEL: // close and save, no custom status
case IDC_CANCEL: // close and save, cancel custom status
case IDOK: // close and save, set selected custom status
if ( LOWORD( wparam ) == IDOK && csw->toggleButtons( ))
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp
index a053bb26cf..f115e79b2b 100644
--- a/plugins/ContactsPlus/src/main.cpp
+++ b/plugins/ContactsPlus/src/main.cpp
@@ -1,20 +1,20 @@
// --------------------------------------------------------------------------
// Contacts+ for Miranda Instant Messenger
// _______________________________________
-//
-// Copyright © 2002 Dominus Procellarum
+//
+// Copyright © 2002 Dominus Procellarum
// Copyright © 2004-2008 Joe Kucera
-//
+//
// 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; either version 2
// of the License, or (at your option) any later version.
-//
+//
// 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, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -113,15 +113,15 @@ static void ProcessUnreadEvents(void)
dbei.cbSize = sizeof(dbei);
hContact = SRCFindFirstContact();
- while (hContact)
+ while (hContact)
{
hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDFIRSTUNREAD,(WPARAM)hContact,0);
- while (hDbEvent)
+ while (hDbEvent)
{
dbei.cbBlob=0;
CallService(MS_DB_EVENT_GET,(WPARAM)hDbEvent,(LPARAM)&dbei);
- if (!(dbei.flags&(DBEF_SENT|DBEF_READ)) && dbei.eventType==EVENTTYPE_CONTACTS)
+ if (!(dbei.flags&(DBEF_SENT|DBEF_READ)) && dbei.eventType==EVENTTYPE_CONTACTS)
{ //process the event
HookDBEventAdded((WPARAM)hContact, (LPARAM)hDbEvent);
}
@@ -196,7 +196,7 @@ static int HookModulesLoaded(WPARAM wParam, LPARAM lParam)
mi.flags = CMIF_KEEPUNTRANSLATED;
if (g_UnicodeCore)
mi.flags |= CMIF_UNICODE;
- mi.pszService = MS_CONTACTS_SEND;
+ mi.pszService = MS_CONTACTS_SEND;
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_CONTACTS));
hContactMenuItem = Menu_AddContactMenuItem(&mi);
@@ -229,7 +229,7 @@ static int HookContactDeleted(WPARAM wParam, LPARAM lParam)
{ // if our contact gets deleted close his window
HWND h = WindowList_Find(ghSendWindowList,(HANDLE)wParam);
- if (h)
+ if (h)
{
SendMessageT(h,WM_CLOSE,0,0);
}
@@ -269,7 +269,7 @@ static INT_PTR ServiceReceiveCommand(WPARAM wParam, LPARAM lParam)
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
- return &pluginInfo;
+ return &pluginInfo;
}
extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_SRCONTACTS, MIID_LAST};
@@ -280,13 +280,8 @@ extern "C" __declspec(dllexport) int Load(void)
InitCommonControls();
InitI18N();
- { // Are we running under unicode Miranda core ?
- char szVer[MAX_PATH];
+ g_UnicodeCore = true;
- CallService(MS_SYSTEM_GETVERSIONTEXT, MAX_PATH, (LPARAM)szVer);
- _strlwr(szVer);
- g_UnicodeCore = (strstr(szVer, "unicode") != NULL);
- }
//init hooks
hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, HookModulesLoaded);
hHookDBEventAdded = HookEvent(ME_DB_EVENT_ADDED, HookDBEventAdded);
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp
index ea60c4dd7e..1c4e90b13c 100644
--- a/plugins/Popup/src/main.cpp
+++ b/plugins/Popup/src/main.cpp
@@ -425,13 +425,8 @@ static int OkToExit(WPARAM wParam, LPARAM lParam)
//Called when the plugin is loaded into Miranda
MIRAPI int Load(void)
{
- char ver[1024];
-
-
g_popup.isOsUnicode = (GetVersion() & 0x80000000) == 0;
-
- CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM) sizeof(ver), (LPARAM) ver);
- g_popup.isMirUnicode = strstr(ver, "Unicode") != NULL;
+ g_popup.isMirUnicode = true;
hGetStatus = CreateServiceFunction(MS_POPUP_GETSTATUS, GetStatus);
diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp
index 3551119adc..6c7de9de2b 100644
--- a/plugins/Scriver/src/utils.cpp
+++ b/plugins/Scriver/src/utils.cpp
@@ -148,15 +148,10 @@ enum MIMFLAGS {
};
int IsUnicodeMIM() {
- if (!(mimFlags & MIM_CHECKED)) {
- char str[512];
- mimFlags = MIM_CHECKED;
- CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)500, (LPARAM)(char*)str);
- if (strstr(str, "Unicode")) {
- mimFlags |= MIM_UNICODE;
- }
- }
- return (mimFlags & MIM_UNICODE) != 0;
+ if (!(mimFlags & MIM_CHECKED))
+ mimFlags = MIM_CHECKED | MIM_UNICODE;
+
+ return TRUE;
}
const char *filename = "scriver.log";
@@ -283,7 +278,7 @@ char* GetRichTextRTF(HWND hwnd)
return pszText; // pszText contains the text
}
-void rtrimText(TCHAR *text)
+void rtrimText(TCHAR *text)
{
static TCHAR szTrimString[] = _T(":;,.!?\'\"><()[]- \r\n");
int iLen = lstrlen(text)-1;
@@ -296,7 +291,7 @@ void rtrimText(TCHAR *text)
TCHAR *limitText(TCHAR *text, int limit)
{
int len = lstrlen(text);
- if (len > g_dat->limitNamesLength)
+ if (len > g_dat->limitNamesLength)
{
TCHAR *ptszTemp = (TCHAR *)mir_alloc(sizeof(TCHAR) * (limit + 4));
_tcsncpy(ptszTemp, text, limit + 1);
@@ -312,11 +307,11 @@ TCHAR *GetRichTextWord(HWND hwnd, POINTL *ptl)
pszWord = GetRichEditSelection(hwnd);
if (pszWord == NULL) {
iCharIndex = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM)ptl);
- if (iCharIndex >= 0)
+ if (iCharIndex >= 0)
{
start = SendMessage(hwnd, EM_FINDWORDBREAK, WB_LEFT, iCharIndex);//-iChars;
end = SendMessage(hwnd, EM_FINDWORDBREAK, WB_RIGHT, iCharIndex);//-iChars;
- if (end - start > 0)
+ if (end - start > 0)
{
TEXTRANGE tr;
CHARRANGE cr;
@@ -327,7 +322,7 @@ TCHAR *GetRichTextWord(HWND hwnd, POINTL *ptl)
tr.chrg = cr;
tr.lpstrText = pszWord;
iRes = SendMessage(hwnd, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
- if (iRes <= 0)
+ if (iRes <= 0)
{
mir_free(pszWord);
pszWord = NULL;
@@ -335,7 +330,7 @@ TCHAR *GetRichTextWord(HWND hwnd, POINTL *ptl)
}
}
}
- if (pszWord != NULL)
+ if (pszWord != NULL)
{
rtrimText(pszWord);
}
@@ -353,7 +348,7 @@ static DWORD CALLBACK StreamOutCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG
return 0;
}
-TCHAR *GetRichEditSelection(HWND hwnd)
+TCHAR *GetRichEditSelection(HWND hwnd)
{
CHARRANGE sel;
SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel);
@@ -467,11 +462,11 @@ char *url_encode(char *str) {
if ( (48 <= *pstr && *pstr <= 57) ||//0-9
(65 <= *pstr && *pstr <= 90) ||//ABC...XYZ
(97 <= *pstr && *pstr <= 122) ||//abc...xyz
- *pstr == '-' || *pstr == '_' || *pstr == '.')
+ *pstr == '-' || *pstr == '_' || *pstr == '.')
*pbuf++ = *pstr;
- else if (*pstr == ' ')
+ else if (*pstr == ' ')
*pbuf++ = '+';
- else
+ else
*pbuf++ = '%', *pbuf++ = to_hex(*pstr >> 4), *pbuf++ = to_hex(*pstr & 15);
pstr++;
}
@@ -560,7 +555,7 @@ HWND CreateToolTip(HWND hwndParent, LPTSTR ptszText, LPTSTR ptszTitle, RECT* rec
HWND hwndTT;
hwndTT = CreateWindowEx(WS_EX_TOPMOST,
TOOLTIPS_CLASS, NULL,
- WS_POPUP | TTS_NOPREFIX,
+ WS_POPUP | TTS_NOPREFIX,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
hwndParent, NULL, g_hInst, NULL);
@@ -575,7 +570,7 @@ HWND CreateToolTip(HWND hwndParent, LPTSTR ptszText, LPTSTR ptszTitle, RECT* rec
SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti);
SendMessage(hwndTT, TTM_SETTITLE, TTI_NONE, (LPARAM)ptszTitle);
return hwndTT;
-}
+}
void SetToolTipText(HWND hwndParent, HWND hwndTT, LPTSTR ptszText, LPTSTR ptszTitle) {
TOOLINFO ti = { 0 };
@@ -595,7 +590,7 @@ void SetToolTipRect(HWND hwndParent, HWND hwndTT, RECT* rect)
ti.hwnd = hwndParent;
ti.rect = *rect;
SendMessage(hwndTT, TTM_NEWTOOLRECT, 0, (LPARAM) (LPTOOLINFO) &ti);
-}
+}
/* toolbar-related stuff, to be moved to a separate file */
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp
index 205a025ffe..f867591b3b 100644
--- a/plugins/SecureIM/src/main.cpp
+++ b/plugins/SecureIM/src/main.cpp
@@ -114,11 +114,7 @@ extern "C" __declspec(dllexport) int __cdecl Load(void)
if (bIsComCtl6) iBmpDepth = ILC_COLOR32 | ILC_MASK; // 32-bit images are supported
else iBmpDepth = ILC_COLOR24 | ILC_MASK;
-// iBmpDepth = ILC_COLOR32 | ILC_MASK;
-
- char version[512];
- CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(version), (LPARAM)&version);
- bCoreUnicode = strstr(version, "Unicode")!=0;
+ bCoreUnicode = true;
iCoreVersion = CallService(MS_SYSTEM_GETVERSION,0,0);
// load crypo++ dll
diff --git a/plugins/SendScreenshotPlus/src/Utils.cpp b/plugins/SendScreenshotPlus/src/Utils.cpp
index f1b7251fd7..12fa58d369 100644
--- a/plugins/SendScreenshotPlus/src/Utils.cpp
+++ b/plugins/SendScreenshotPlus/src/Utils.cpp
@@ -1,7 +1,7 @@
/*
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
This file is part of Send Screenshot Plus, a Miranda IM plugin.
Copyright (c) 2010 Ing.U.Horn
@@ -176,7 +176,7 @@ FIBITMAP* CaptureScreen (HDC hDC, SIZE size, HWND hCapture) {
}
dib = FIP->FI_CreateDIBFromHBITMAP(hBitmap);
-
+
//alpha channel from window is always wrong,
//coz GDI do not draw all in alpha mode.
//we have to create our own new alpha channel.
@@ -309,7 +309,7 @@ FIBITMAP* CaptureDesktop/*emulate print screen*/() {
int i = 0;
keybd_event(VK_SNAPSHOT, 0x45, KEYEVENTF_EXTENDEDKEY, 0);
keybd_event(VK_SNAPSHOT, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
- do {//Clipboard need time to get bitmap from keybd_event,
+ do {//Clipboard need time to get bitmap from keybd_event,
i++; //we use a counter to get this time.
bBitmap = IsClipboardFormatAvailable(CF_BITMAP);
if(i == 500) return (FIBITMAP*)0; //emergency exit if something go wrong
@@ -410,9 +410,7 @@ BOOL GetLmouse() {
//---------------------------------------------------------------------------
//is miranda unicode
BOOL mir_is_unicode() {
- char ver[1024];
- CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM) sizeof(ver), (LPARAM) ver);
- return strstr(ver, "Unicode") != NULL;
+ return TRUE;
}
//---------------------------------------------------------------------------
@@ -544,11 +542,11 @@ INT_PTR SaveTIF(HBITMAP hBmp, LPTSTR szFilename) {
EncParams->Count = 2 ;
EncParams->Parameter[0].Guid = Gdiplus::EncoderCompression ;
EncParams->Parameter[0].Type = Gdiplus::EncoderParameterValueTypeLong ;
- EncParams->Parameter[0].NumberOfValues = 1 ;
+ EncParams->Parameter[0].NumberOfValues = 1 ;
EncParams->Parameter[0].Value = &ulCompression ;
EncParams->Parameter[1].Guid = Gdiplus::EncoderColorDepth ;
EncParams->Parameter[1].Type = Gdiplus::EncoderParameterValueTypeLong ;
- EncParams->Parameter[1].NumberOfValues = 1 ;
+ EncParams->Parameter[1].NumberOfValues = 1 ;
EncParams->Parameter[1].Value = &ulColorDepth ;
LPWSTR pswFile = mir_t2u(szFilename);
@@ -576,4 +574,3 @@ void ShowPopUp(char *title, char *text) {
CallService(MS_POPUP_ADDPOPUP, (WPARAM)&pude, 0);
}*/
-
diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp
index d4be17b804..4165553cad 100644
--- a/plugins/SmileyAdd/src/main.cpp
+++ b/plugins/SmileyAdd/src/main.cpp
@@ -41,9 +41,9 @@ static HANDLE hService[13];
int hLangpack;
-static const PLUGININFOEX pluginInfoEx =
+static const PLUGININFOEX pluginInfoEx =
{
- sizeof(PLUGININFOEX),
+ sizeof(PLUGININFOEX),
"SmileyAdd",
__VERSION_DWORD,
"Smiley support for Miranda Instant Messanger",
@@ -57,14 +57,14 @@ static const PLUGININFOEX pluginInfoEx =
{ 0xbd542bb4, 0x5ae4, 0x4d0e, { 0xa4, 0x35, 0xba, 0x8d, 0xbe, 0x39, 0x60, 0x7f } }
};
-static SKINICONDESC skinDesc =
-{
- sizeof(SKINICONDESC), "SmileyAdd", NULL,
- "SmileyAdd_ButtonSmiley", NULL, -IDI_SMILINGICON
+static SKINICONDESC skinDesc =
+{
+ sizeof(SKINICONDESC), "SmileyAdd", NULL,
+ "SmileyAdd_ButtonSmiley", NULL, -IDI_SMILINGICON
};
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD /* mirandaVersion */)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD /* mirandaVersion */)
{
return (PLUGININFOEX*)&pluginInfoEx;
}
@@ -82,7 +82,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
HANDLE hSkinIcon = Skin_AddIcon(&skinDesc);
INT_PTR temp = CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
- metaProtoName = mir_strdup(temp == CALLSERVICE_NOTFOUND ? NULL : (char*)temp);
+ metaProtoName = mir_strdup(temp == CALLSERVICE_NOTFOUND ? NULL : (char*)temp);
CLISTMENUITEM mi = {0};
mi.cbSize = sizeof(mi);
@@ -97,7 +97,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
DownloadInit();
//install hooks if enabled
- InstallDialogBoxHook();
+ InstallDialogBoxHook();
g_SmileyCategories.AddAllProtocolsAsCategory();
g_SmileyCategories.ClearAndLoadAll();
@@ -119,23 +119,12 @@ extern "C" __declspec(dllexport) int Load(void)
if (ServiceExists(MS_SMILEYADD_REPLACESMILEYS))
{
static const TCHAR errmsg[] = _T("Only one instance of SmileyAdd could be executed.\n")
- _T("Remove duplicate instances from 'Plugins' directory");
+ _T("Remove duplicate instances from 'Plugins' directory");
ReportError(TranslateTS(errmsg));
return 1;
}
- char temp[80];
- CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)SIZEOF(temp), (LPARAM)temp);
-
-
- if (strstr(temp, "Unicode") == NULL)
- {
- ReportError(TranslateT("Please update SmileyAdd to ANSI Version"));
- return 1;
- }
-
-
InitImageCache();
g_SmileyCategories.SetSmileyPackStore(&g_SmileyPacks);
@@ -165,7 +154,7 @@ extern "C" __declspec(dllexport) int Load(void)
hService[8] = CreateServiceFunction(MS_SMILEYADD_BATCHFREE, FreeTextBatch);
hService[9] = CreateServiceFunction(MS_SMILEYADD_CUSTOMCATMENU, CustomCatMenu);
hService[10] = CreateServiceFunction(MS_SMILEYADD_RELOAD, ReloadPack);
- hService[11] = CreateServiceFunction(MS_SMILEYADD_LOADCONTACTSMILEYS, LoadContactSmileys);
+ hService[11] = CreateServiceFunction(MS_SMILEYADD_LOADCONTACTSMILEYS, LoadContactSmileys);
hService[12] = CreateServiceFunction(MS_SMILEYADD_PARSEW, ParseTextW);
diff --git a/plugins/UserInfoEx/src/init.cpp b/plugins/UserInfoEx/src/init.cpp
index 3b7b0b8249..71c88a53ca 100644
--- a/plugins/UserInfoEx/src/init.cpp
+++ b/plugins/UserInfoEx/src/init.cpp
@@ -164,19 +164,12 @@ static INT OnShutdown(WPARAM wParam, LPARAM lParam)
static BOOL CoreCheck()
{
BOOL bOk = TRUE;
- CHAR szVer[260];
- TCHAR tszExePath[1024];
+ TCHAR tszExePath[1024];
GetModuleFileName(GetModuleHandle(NULL), tszExePath, SIZEOF(tszExePath));
- CallService(MS_SYSTEM_GETVERSIONTEXT, SIZEOF(szVer), (LPARAM)szVer);
-
- strlwr(szVer);
_tcslwr(tszExePath);
-
bOk *= (GetVersion() & 0x80000000) == 0;
- bOk *= strstr(szVer, "unicode") != 0;
-
bOk *= _tcsstr(_tcsrchr(tszExePath, '\\'), _T("miranda")) != 0;
bOk *= !strstr(szVer, "coffee") && strncmp(szVer, "1.", 2) && !strstr(szVer, " 1.");
diff --git a/plugins/Utils/mir_memory.h b/plugins/Utils/mir_memory.h
index 678972805c..d62f4833f3 100644
--- a/plugins/Utils/mir_memory.h
+++ b/plugins/Utils/mir_memory.h
@@ -27,18 +27,11 @@ Boston, MA 02111-1307, USA.
static BOOL mir_is_unicode()
{
- static int is_unicode = -1;
- if (is_unicode == -1)
- {
- char ver[1024];
- CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM) sizeof(ver), (LPARAM) ver);
- is_unicode = (strstr(ver, "Unicode") != NULL ? 1 : 0);
- }
- return is_unicode;
+ return TRUE;
}
-static void * mir_alloc0(size_t size)
+static void * mir_alloc0(size_t size)
{
void * ptr = mir_alloc(size);
diff --git a/plugins/VersionInfo/src/CVersionInfo.cpp b/plugins/VersionInfo/src/CVersionInfo.cpp
index 6796387a35..9b41342a3c 100644
--- a/plugins/VersionInfo/src/CVersionInfo.cpp
+++ b/plugins/VersionInfo/src/CVersionInfo.cpp
@@ -96,7 +96,7 @@ CVersionInfo::~CVersionInfo()
listInactivePlugins.clear();
listActivePlugins.clear();
listUnloadablePlugins.clear();
-
+
lpzMirandaVersion.~basic_string();
lpzNightly.~basic_string();
lpzUnicodeBuild.~basic_string();
@@ -118,7 +118,7 @@ void CVersionInfo::Initialize()
if (verbose) PUShowMessage("Before GetProfileSettings().", SM_NOTIFY);
#endif
GetProfileSettings();
-
+
#ifdef _DEBUG
if (verbose) PUShowMessage("Before GetLangpackInfo().", SM_NOTIFY);
#endif
@@ -158,10 +158,7 @@ bool CVersionInfo::GetMirandaVersion()
else
lpzNightly = _T("No");
- if (lpzMirandaVersion.find( _T("Unicode"), 0) != std::string::npos)
- lpzUnicodeBuild = _T("Yes");
- else
- lpzUnicodeBuild = _T("No");
+ lpzUnicodeBuild = _T("Yes");
TCHAR time[128], date[128];
GetModuleTimeStamp(date, time);
@@ -310,7 +307,7 @@ end:
NotifyError(GetLastError(), _T("RegOpenKeyEx()"), __LINE__);
lpzOSName = _T("<Error in RegOpenKeyEx()>");
}
-
+
//Now we can improve it if we can.
switch (LOWORD(osvi.dwBuildNumber)) {
case 950: lpzOSName = _T("Microsoft Windows 95"); break;
@@ -326,7 +323,7 @@ end:
lpzOSName = _T("Microsoft Windows 2003 R2");
else
lpzOSName = _T("Microsoft Windows 2003");
-
+
break; //added windows 2003 info
}
@@ -336,7 +333,7 @@ end:
bool CVersionInfo::GetHWSettings() {
//Free space on Miranda Partition.
TCHAR szMirandaPath[MAX_PATH] = { 0 };
- {
+ {
GetModuleFileName(GetModuleHandle(NULL), szMirandaPath, SIZEOF(szMirandaPath));
TCHAR* str2 = _tcsrchr(szMirandaPath,'\\');
if ( str2 != NULL) *str2=0;
@@ -344,16 +341,16 @@ bool CVersionInfo::GetHWSettings() {
HMODULE hKernel32;
hKernel32 = LoadLibraryA("kernel32.dll");
if (hKernel32) {
-
+
MyGetDiskFreeSpaceEx = (BOOL (WINAPI *)(LPCTSTR,PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER))GetProcAddress(hKernel32, "GetDiskFreeSpaceExW");
-
+
MyIsWow64Process = (BOOL (WINAPI *) (HANDLE, PBOOL)) GetProcAddress(hKernel32, "IsWow64Process");
MyGetSystemInfo = (void (WINAPI *) (LPSYSTEM_INFO)) GetProcAddress(hKernel32, "GetNativeSystemInfo");
MyGlobalMemoryStatusEx = (BOOL (WINAPI *) (LPMEMORYSTATUSEX)) GetProcAddress(hKernel32, "GlobalMemoryStatusEx");
if ( !MyGetSystemInfo )
MyGetSystemInfo = GetSystemInfo;
-
+
FreeLibrary(hKernel32);
}
if ( MyGetDiskFreeSpaceEx ) {
@@ -365,25 +362,25 @@ bool CVersionInfo::GetHWSettings() {
luiFreeDiskSpace = (unsigned long int)aux;
}
else luiFreeDiskSpace = 0;
-
+
TCHAR szInfo[1024];
GetWindowsShell(szInfo, SIZEOF(szInfo));
lpzShell = szInfo;
GetInternetExplorerVersion(szInfo, SIZEOF(szInfo));
lpzIEVersion = szInfo;
-
-
+
+
lpzAdministratorPrivileges = (IsCurrentUserLocalAdministrator()) ? _T("Yes") : _T("No");
-
+
bIsWOW64 = 0;
if (MyIsWow64Process)
if (!MyIsWow64Process(GetCurrentProcess(), &bIsWOW64))
bIsWOW64 = 0;
-
+
SYSTEM_INFO sysInfo = {0};
GetSystemInfo(&sysInfo);
luiProcessors = sysInfo.dwNumberOfProcessors;
-
+
//Installed RAM
if (MyGlobalMemoryStatusEx) { //windows 2000+
MEMORYSTATUSEX ms = {0};
@@ -438,7 +435,7 @@ BOOL CALLBACK EnumSystemLocalesProc(TCHAR *szLocale)
_tcscat(szSystemLocales, name);
_tcscat(szSystemLocales, _T(", "));
}
-
+
return TRUE;
}
@@ -456,14 +453,14 @@ BOOL CALLBACK EnumResLangProc(HMODULE hModule, LPCTSTR lpszType, LPCTSTR lpszNam
bool CVersionInfo::GetOSLanguages()
{
lpzOSLanguages = _T("(UI | Locale (User/System)) : ");
-
+
LANGID UILang;
-
+
OSVERSIONINFO os = {0};
os.dwOSVersionInfoSize = sizeof(os);
GetVersionEx(&os);
if (os.dwMajorVersion == 4) {
- if (os.dwPlatformId == VER_PLATFORM_WIN32_NT) { //Win NT
+ if (os.dwPlatformId == VER_PLATFORM_WIN32_NT) { //Win NT
HMODULE hLib = LoadLibraryA("ntdll.dll");
if (hLib) {
@@ -488,7 +485,7 @@ bool CVersionInfo::GetOSLanguages()
case 1256: // Arabic code page activated, it's a Arabic enabled system
systemLangID = MAKELANGID(LANG_ARABIC, SUBLANG_ARABIC_SAUDI_ARABIA);
break;
-
+
default:
break;
}
@@ -500,7 +497,7 @@ bool CVersionInfo::GetOSLanguages()
TCHAR szLangID[128] = _T("0x");
DWORD size = SIZEOF(szLangID) - 2;
TCHAR err[512];
-
+
if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Control Panel\\Desktop\\ResourceLocale"), 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) {
if (RegQueryValueEx(hKey, _T(""), 0, NULL, (LPBYTE) &szLangID + 2, &size) == ERROR_SUCCESS)
_tscanf(szLangID, _T("%lx"), &systemLangID);
@@ -523,10 +520,10 @@ bool CVersionInfo::GetOSLanguages()
if (hKernel32) {
MyGetUserDefaultUILanguage = (LANGID (WINAPI *)()) GetProcAddress(hKernel32, "GetUserDefaultUILanguage");
MyGetSystemDefaultUILanguage = (LANGID (WINAPI *)()) GetProcAddress(hKernel32, "GetSystemDefaultUILanguage");
-
+
FreeLibrary(hKernel32);
}
-
+
if ((MyGetUserDefaultUILanguage) && (MyGetSystemDefaultUILanguage)) {
UILang = MyGetUserDefaultUILanguage();
lpzOSLanguages += GetLanguageName(UILang);
@@ -536,7 +533,7 @@ bool CVersionInfo::GetOSLanguages()
}
else lpzOSLanguages += _T("Missing functions in kernel32.dll (GetUserDefaultUILanguage, GetSystemDefaultUILanguage)");
}
-
+
lpzOSLanguages += _T(" | ");
lpzOSLanguages += GetLanguageName(LOCALE_USER_DEFAULT);
lpzOSLanguages += _T("/");
@@ -552,7 +549,7 @@ bool CVersionInfo::GetOSLanguages()
lpzOSLanguages += szSystemLocales;
lpzOSLanguages += _T("]");
}
-
+
return true;
}
@@ -564,7 +561,7 @@ int SaveInfo(const char *data, const char *lwrData, const char *search, TCHAR *d
_tcsncpy(dest, _A2T(&data[strlen(search)]), size);
res = 0;
}
-
+
return res;
}
@@ -573,13 +570,13 @@ bool CVersionInfo::GetLangpackInfo()
TCHAR langpackPath[MAX_PATH] = {0};
TCHAR search[MAX_PATH] = {0};
- lpzLangpackModifiedDate = _T("");
+ lpzLangpackModifiedDate = _T("");
GetModuleFileName(GetModuleHandle(NULL), langpackPath, SIZEOF(langpackPath));
TCHAR* p = _tcsrchr(langpackPath, '\\');
if (p) {
WIN32_FIND_DATA data = {0};
HANDLE hLangpack;
-
+
p[1] = '\0';
_tcscpy(search, langpackPath);
_tcscat(search, _T("langpack_*.txt"));
@@ -588,16 +585,16 @@ bool CVersionInfo::GetLangpackInfo()
char buffer[1024];
char temp[1024];
FillLocalTime(lpzLangpackModifiedDate, &data.ftLastWriteTime);
-
+
TCHAR locale[128] = {0};
TCHAR language[128] = {0};
TCHAR version[128] = {0};
_tcscpy(version, _T("N/A"));
-
+
_tcsncpy(language, data.cFileName, SIZEOF(language));
p = _tcsrchr(language, '.');
p[0] = '\0';
-
+
_tcscat(langpackPath, data.cFileName);
FILE *fin = _tfopen(langpackPath, _T("rt"));
if (fin) {
@@ -627,7 +624,7 @@ bool CVersionInfo::GetLangpackInfo()
else
_tcsncpy(version, _T("<unknown>"), SIZEOF(version));
} } } }
-
+
lpzLangpackInfo = std::tstring(language) + _T(" [") + std::tstring(locale) + _T("]");
if ( version[0] )
lpzLangpackInfo += _T(" v. ") + std::tstring(version);
@@ -641,8 +638,8 @@ bool CVersionInfo::GetLangpackInfo()
FindClose(hLangpack);
}
else lpzLangpackInfo = _T("No language pack installed");
- }
-
+ }
+
return true;
}
@@ -673,7 +670,7 @@ bool CVersionInfo::GetPluginLists()
// SYSTEMTIME sysTime; //for timestamp
mirandaVersion=(DWORD)CallService(MS_SYSTEM_GETVERSION,0,0);
- {
+ {
GetModuleFileName(GetModuleHandle(NULL), szMirandaPath, SIZEOF(szMirandaPath));
TCHAR* str2 = _tcsrchr(szMirandaPath,'\\');
if(str2!=NULL) *str2=0;
@@ -710,7 +707,7 @@ bool CVersionInfo::GetPluginLists()
loadError = GetLastError();
int bUnknownError = 1; //assume plugin didn't load because of unknown error
//Some error messages.
- //get the dlls the plugin statically links to
+ //get the dlls the plugin statically links to
if (DBGetContactSettingByte(NULL, ModuleName, "CheckForDependencies", TRUE))
{
std::tstring linkedModules;
@@ -738,7 +735,7 @@ bool CVersionInfo::GetPluginLists()
else { //It was successfully loaded.
MirandaPluginInfo = (PLUGININFOEX *(*)(DWORD))GetProcAddress(hInstPlugin, "MirandaPluginInfoEx");
if (!MirandaPluginInfo)
- MirandaPluginInfo = (PLUGININFOEX *(*)(DWORD))GetProcAddress(hInstPlugin, "MirandaPluginInfo");
+ MirandaPluginInfo = (PLUGININFOEX *(*)(DWORD))GetProcAddress(hInstPlugin, "MirandaPluginInfo");
if (!MirandaPluginInfo) //There is no function: it's not a valid plugin. Let's move on to the next file.
continue;
@@ -904,7 +901,7 @@ std::tstring CVersionInfo::GetListAsString(std::list<CPlugin> &aList, DWORD flag
GetStringFromDatabase("BoldBegin", _T("[b]"), szHeader, SIZEOF(szHeader));
GetStringFromDatabase("BoldEnd", _T("[/b]"), szFooter, SIZEOF(szFooter));
}
-
+
while (pos != aList.end()) {
out.append(std::tstring((*pos).getInformations(flags, szHeader, szFooter)));
pos++;
@@ -943,7 +940,7 @@ void CVersionInfo::AddInfoHeader(int suppressHeader, int forumStyle, int beautif
} }
TCHAR buffer[1024]; //for beautification
- GetStringFromDatabase("BeautifyHorizLine", _T("<hr />"), buffer, SIZEOF(buffer));
+ GetStringFromDatabase("BeautifyHorizLine", _T("<hr />"), buffer, SIZEOF(buffer));
BeautifyReport(beautify, buffer, _T(""), out);
GetStringFromDatabase("BeautifyBlockStart", _T("<blockquote>"), buffer, SIZEOF(buffer));
BeautifyReport(beautify, buffer, _T(""), out);
@@ -965,27 +962,27 @@ void CVersionInfo::AddInfoHeader(int suppressHeader, int forumStyle, int beautif
out.append(noProcs);
}
out.append( _T("\r\n"));
-
+
//RAM
TCHAR szRAM[64]; wsprintf(szRAM, _T("%d"), luiRAM);
out.append( _T("Installed RAM: ") + std::tstring(szRAM) + _T(" MBytes\r\n"));
-
+
//operating system
out.append( _T("Operating System: ") + lpzOSName + _T(" [version: ") + lpzOSVersion + _T("]\r\n"));
-
+
//shell, IE, administrator
out.append( _T("Shell: ") + lpzShell + _T(", Internet Explorer ") + lpzIEVersion + _T("\r\n"));
out.append( _T("Administrator privileges: ") + lpzAdministratorPrivileges + _T("\r\n"));
-
+
//languages
out.append( _T("OS Languages: ") + lpzOSLanguages + _T("\r\n"));
-
+
//FreeDiskSpace
if (luiFreeDiskSpace) {
TCHAR szDiskSpace[64]; wsprintf(szDiskSpace, _T("%d"), luiFreeDiskSpace);
out.append( _T("Free disk space on Miranda partition: ") + std::tstring(szDiskSpace) + _T(" MBytes\r\n"));
}
-
+
//Miranda
out.append( _T("Miranda path: ") + lpzMirandaPath + _T("\r\n"));
out.append( _T("Miranda NG version: ") + lpzMirandaVersion);
@@ -1001,10 +998,10 @@ void CVersionInfo::AddInfoHeader(int suppressHeader, int forumStyle, int beautif
out.append( _T("Language pack: ") + lpzLangpackInfo);
out.append((lpzLangpackModifiedDate.size() > 0) ? _T(", modified: ") + lpzLangpackModifiedDate : _T(""));
out.append( _T("\r\n"));
-
+
out.append( _T("Nightly: ") + lpzNightly + _T("\r\n"));
out.append( _T("Unicode core: ") + lpzUnicodeBuild);
-
+
GetStringFromDatabase("BeautifyBlockEnd", _T("</blockquote>"), buffer, SIZEOF(buffer));
BeautifyReport(beautify, buffer, _T("\r\n"), out);
}
@@ -1056,7 +1053,7 @@ std::tstring CVersionInfo::GetInformationsAsString(int bDisableForumStyle) {
TCHAR normalPluginsEnd[1024]; //for beautification purposes, for normal plugins text (end)
TCHAR horizLine[1024]; //for beautification purposes
TCHAR buffer[1024]; //for beautification purposes
-
+
TCHAR headerHighlightStart[10] = _T("");
TCHAR headerHighlightEnd[10] = _T("");
if (forumStyle) {
@@ -1105,7 +1102,7 @@ std::tstring CVersionInfo::GetInformationsAsString(int bDisableForumStyle) {
out.append( _T("\r\n"));
BeautifyReport(beautify, normalPluginsStart, _T(""), out);
out.append(GetListAsString(listUnloadablePlugins, flags, beautify));
- BeautifyReport(beautify, normalPluginsEnd, _T(""), out);
+ BeautifyReport(beautify, normalPluginsEnd, _T(""), out);
}
AddInfoFooter(suppressHeader, forumStyle, beautify, out);
return out;
@@ -1123,7 +1120,7 @@ void CVersionInfo::PrintInformationsToFile(const TCHAR *info)
else GetStringFromDatabase("OutputFile", _T("VersionInfo.txt"), buffer, SIZEOF(buffer));
RelativePathToAbsolute(buffer, outputFileName, SIZEOF(buffer));
-
+
FILE *fp = _tfopen(outputFileName, _T("wb"));
if ( fp != NULL ) {
char* utf = mir_utf8encodeT( info );
@@ -1163,7 +1160,7 @@ void CVersionInfo::PrintInformationsToDialogBox()
HWND DialogBox = CreateDialogParam(hInst,
MAKEINTRESOURCE(IDD_DIALOGINFO),
NULL, DialogBoxProc, (LPARAM) this);
-
+
SetDlgItemText(DialogBox, IDC_TEXT, GetInformationsAsString().c_str());
}
@@ -1173,7 +1170,7 @@ void CVersionInfo::PrintInformationsToClipboard(bool showLog)
Log( TranslateT("The clipboard is not available, retry."));
return;
}
-
+
OpenClipboard(NULL);
//Ok, let's begin, then.
EmptyClipboard();
@@ -1188,7 +1185,7 @@ void CVersionInfo::PrintInformationsToClipboard(bool showLog)
lptstrCopy[length] = '\0';
GlobalUnlock(hData);
//Now set the clipboard data.
-
+
SetClipboardData(CF_UNICODETEXT, hData);
//Remove the lock on the clipboard.
diff --git a/plugins/helpers/gen_helpers.cpp b/plugins/helpers/gen_helpers.cpp
index 7c55d9509b..30b012f785 100644
--- a/plugins/helpers/gen_helpers.cpp
+++ b/plugins/helpers/gen_helpers.cpp
@@ -112,16 +112,16 @@ static int WriteToDebugLogA(const char *szMsg) {
OutputDebugStringA(szMsg);
OutputDebugStringA("\r\n");
}
-
+
return res;
}
int AddDebugLogMessageA(const char* fmt, ...)
-{
+{
int res;
char szText[MAX_DEBUG], szFinal[MAX_DEBUG];
va_list va;
-
+
va_start(va,fmt);
_vsnprintf(szText, sizeof(szText), fmt, va);
va_end(va);
@@ -165,7 +165,7 @@ int AddErrorLogMessageA(const char* fmt, ...) {
int res;
char szText[MAX_DEBUG], szFinal[MAX_DEBUG];
va_list va;
-
+
va_start(va,fmt);
_vsnprintf(szText, sizeof(szText), fmt, va);
va_end(va);
@@ -181,7 +181,7 @@ int AddErrorLogMessageA(const char* fmt, ...) {
}
int AddErrorLogMessage(const TCHAR* fmt, ...) {
-
+
int res;
TCHAR tszText[MAX_DEBUG], tszFinal[MAX_DEBUG];
char *szFinal;
@@ -228,30 +228,7 @@ TCHAR *itot(int num) {
// Helper functions that need MODULENAME
#define SETTING_NOENCODINGCHECK "NoEncodingCheck"
-int Hlp_UnicodeCheck(char *szPluginName, BOOL bForce, const char *szModule) {
-
-#ifndef _DEBUG
- char *ptr;
- char szVersionText[256];
-
- if (!CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)sizeof(szVersionText), (LPARAM)szVersionText)) {
- ptr = strstr(szVersionText, "Unicode");
-
- if ((ptr == NULL) && (!DBGetContactSettingByte(NULL, szModule, SETTING_NOENCODINGCHECK, 0))) {
- if (bForce) {
- MessageBoxA(NULL, "You are running the ANSI version Miranda. Please use the ANSI build of this plugin.", szPluginName, MB_OK);
-
- return -1;
- }
- else {
- MessageBoxA(NULL, "You are running the ANSI version Miranda. It's recommened to use the ANSI build of this plugin.", szPluginName, MB_OK);
- DBWriteContactSettingByte(NULL, szModule, SETTING_NOENCODINGCHECK, 1);
-
- return 0;
- }
- }
- }
-#endif
-
+int Hlp_UnicodeCheck(char *szPluginName, BOOL bForce, const char *szModule)
+{
return 0;
-} \ No newline at end of file
+}
diff --git a/protocols/IcqOscarJ/init.cpp b/protocols/IcqOscarJ/init.cpp
index 429abc7870..450ea73b16 100644
--- a/protocols/IcqOscarJ/init.cpp
+++ b/protocols/IcqOscarJ/init.cpp
@@ -93,11 +93,6 @@ extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP( &pluginInfo );
- // Are we running under unicode Miranda core ?
- char szVer[MAX_PATH];
- CallService(MS_SYSTEM_GETVERSIONTEXT, MAX_PATH, (LPARAM)szVer);
- _strlwr(szVer); // make sure it is lowercase
-
srand(time(NULL));
_tzset();
diff --git a/protocols/JabberG/jabber_caps.cpp b/protocols/JabberG/jabber_caps.cpp
index 884dcfa24b..76fc735b91 100644
--- a/protocols/JabberG/jabber_caps.cpp
+++ b/protocols/JabberG/jabber_caps.cpp
@@ -241,7 +241,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites( const TCHAR *jid, BOOL appe
pInfo->SetTimeout( JABBER_RESOURCE_CAPS_QUERY_TIMEOUT );
m_clientCapsManager.SetClientCaps( r->szCapsNode, r->szCapsVer, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId());
r->dwDiscoInfoRequestTime = pInfo->GetRequestTime();
-
+
TCHAR queryNode[512];
mir_sntprintf( queryNode, SIZEOF(queryNode), _T("%s#%s"), r->szCapsNode, r->szCapsVer );
m_ThreadInfo->send( XmlNodeIq( pInfo ) << XQUERY( _T(JABBER_FEAT_DISCO_INFO)) << XATTR( _T("node"), queryNode ));
@@ -309,7 +309,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites( const TCHAR *jid, BOOL appe
CJabberIqInfo *pInfo = m_iqManager.AddHandler( &CJabberProto::OnIqResultVersion, JABBER_IQ_TYPE_GET, fullJid, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_HCONTACT | JABBER_IQ_PARSE_CHILD_TAG_NODE );
pInfo->SetTimeout( JABBER_RESOURCE_CAPS_QUERY_TIMEOUT );
r->dwVersionRequestTime = pInfo->GetRequestTime();
-
+
XmlNodeIq iq( pInfo );
iq << XQUERY( _T(JABBER_FEAT_VERSION));
m_ThreadInfo->send( iq );
@@ -653,7 +653,7 @@ BOOL CJabberClientCapsManager::HandleInfoRequest( HXML, CJabberIqInfo* pInfo, co
if ( szNode )
query << XATTR( _T("node"), szNode );
- query << XCHILD( _T("identity")) << XATTR( _T("category"), _T("client"))
+ query << XCHILD( _T("identity")) << XATTR( _T("category"), _T("client"))
<< XATTR( _T("type"), _T("pc")) << XATTR( _T("name"), _T("Miranda"));
for ( i = 0; g_JabberFeatCapPairs[i].szFeature; i++ )
@@ -679,9 +679,6 @@ BOOL CJabberClientCapsManager::HandleInfoRequest( HXML, CJabberIqInfo* pInfo, co
}
}
- char szCoreVersion[ 256 ];
- JCallService( MS_SYSTEM_GETVERSIONTEXT, SIZEOF(szCoreVersion), (LPARAM)szCoreVersion);
-
HXML form = query << XCHILDNS( _T("x"), _T(JABBER_FEAT_DATA_FORMS)) << XATTR( _T("type"), _T("result"));
form << XCHILD( _T("field")) << XATTR( _T("var"), _T("FORM_TYPE")) << XATTR( _T("type"), _T("hidden"))
<< XCHILD( _T("value"), _T("urn:xmpp:dataforms:softwareinfo"));
@@ -695,6 +692,6 @@ BOOL CJabberClientCapsManager::HandleInfoRequest( HXML, CJabberIqInfo* pInfo, co
}
ppro->m_ThreadInfo->send( iq );
-
+
return TRUE;
}
diff --git a/protocols/MRA/Mra_functions.cpp b/protocols/MRA/Mra_functions.cpp
index e168bd421d..b3d1e1fbab 100644
--- a/protocols/MRA/Mra_functions.cpp
+++ b/protocols/MRA/Mra_functions.cpp
@@ -55,7 +55,7 @@ DWORD MraGetSelfVersionString(LPSTR lpszSelfVersion,SIZE_T dwSelfVersionSize,SIZ
SIZE_T dwSelfVersionSizeRet;
dwSelfVersionSizeRet=mir_snprintf(lpszSelfVersion,dwSelfVersionSize,"Miranda IM %lu.%lu.%lu.%lu%s (MRA v%lu.%lu.%lu.%lu)%s, version: %lu.%lu",(((dwMirVer)>>24)&0xFF),(((dwMirVer)>>16)&0xFF),(((dwMirVer)>>8)&0xFF),((dwMirVer)&0xFF),lpszUnicode,(((PLUGIN_VERSION_DWORD)>>24)&0xFF),(((PLUGIN_VERSION_DWORD)>>16)&0xFF),(((PLUGIN_VERSION_DWORD)>>8)&0xFF),((PLUGIN_VERSION_DWORD)&0xFF),lpszSecIM,PROTO_MAJOR(PROTO_VERSION),PROTO_MINOR(PROTO_VERSION));
-
+
if (pdwSelfVersionSizeRet) (*pdwSelfVersionSizeRet)=dwSelfVersionSizeRet;
dwRetErrorCode=NO_ERROR;
}else{
@@ -169,7 +169,7 @@ DWORD MraAddrListGetFromBuff(LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_ADDR_L
pmalAddrList->dwAddrCount=0;
pmalAddrList->pmaliAddress=(MRA_ADDR_LIST_ITEM*)MEMALLOC(sizeof(MRA_ADDR_LIST_ITEM)*dwAllocatedCount);
lpszCurrentItem=lpszAddreses;
-
+
while(TRUE)
{
lpszEndItem=(LPSTR)MemoryFindByte((lpszCurrentItem-lpszAddreses),lpszAddreses,dwAddresesSize,';');
@@ -336,7 +336,7 @@ return(bRet);
BOOL DB_SetStringExA(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPSTR lpszValue,SIZE_T dwValueSize)
{
BOOL bRet=FALSE;
-
+
if (lpszValue && dwValueSize)
{
LPWSTR lpwszValueLocal;
@@ -371,11 +371,11 @@ return(bRet);
BOOL DB_SetStringExW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpwszValue,SIZE_T dwValueSize)
{
BOOL bRet=FALSE;
-
+
if (lpwszValue && dwValueSize)
{
LPWSTR lpwszValueLocal=(LPWSTR)MEMALLOC(((dwValueSize+MAX_PATH)*sizeof(WCHAR)));
-
+
if (lpwszValueLocal)
{
DBCONTACTWRITESETTING cws={0};
@@ -386,7 +386,7 @@ BOOL DB_SetStringExW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR
cws.value.pwszVal=(WCHAR*)lpwszValueLocal;
memmove(lpwszValueLocal,lpwszValue,(dwValueSize*sizeof(WCHAR)));
bRet=(CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws)==0);
-
+
MEMFREE(lpwszValueLocal);
}
}else{
@@ -461,7 +461,7 @@ DWORD GetContactFlags(HANDLE hContact)
}
if (DBGetContactSettingByte(hContact,"CList","Hidden",0)) dwRet|=CONTACT_FLAG_SHADOW;
-
+
switch(DB_Mra_GetWord(hContact,"ApparentMode",0)) {
case ID_STATUS_OFFLINE:
dwRet|=CONTACT_FLAG_INVISIBLE;
@@ -567,7 +567,7 @@ DWORD SetContactBasicInfoW(HANDLE hContact,DWORD dwSetInfoFlags,DWORD dwFlags,DW
// поля которые нужны, и изменения которых не отслеживаются
if(dwFlags&SCBIF_ID) DB_Mra_SetDword(hContact,"ContactID",dwID);
-
+
if(dwFlags&SCBIF_EMAIL)
{
if (lpszEMail && dwEMailSize) DB_Mra_SetStringExA(hContact,"e-mail",lpszEMail,dwEMailSize);
@@ -575,7 +575,7 @@ DWORD SetContactBasicInfoW(HANDLE hContact,DWORD dwSetInfoFlags,DWORD dwFlags,DW
// поля изменения которых отслеживаются
if(dwFlags&SCBIF_GROUP_ID) DB_Mra_SetDword(hContact,"GroupID",dwGroupID);
-
+
if(dwFlags&SCBIF_NICK)
{
if ((dwFlags&SCBIF_FLAG) && ((dwContactFlag&CONTACT_FLAG_UNICODE_NAME)==0))
@@ -694,7 +694,7 @@ HANDLE MraHContactFromEmail(LPSTR lpszEMail,SIZE_T dwEMailSize,BOOL bAddIfNeeded
hContact=(HANDLE)CallService(MS_DB_CONTACT_ADD,0,0);
CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)PROTOCOL_NAMEA);
}
-
+
if (hContact)
{
if (IsEMailChatAgent(lpszEMail,dwEMailSize))
@@ -760,7 +760,7 @@ return(DB_Mra_GetWord(hContact,"Status",ID_STATUS_OFFLINE));
DWORD MraSetContactStatus(HANDLE hContact,DWORD dwNewStatus)
{
DWORD dwOldStatus=MraGetContactStatus(hContact);
-
+
if (dwNewStatus!=dwOldStatus)
{
BOOL bChatAgent;
@@ -838,7 +838,7 @@ void MraUpdateEmailStatus(LPSTR lpszFrom,SIZE_T dwFromSize,LPSTR lpszSubject,SIZ
}else{
lstrcpynW(szStatusText,szMailBoxStatus,SIZEOF(szStatusText));
}
-
+
if (bTrayIconNewMailNotify)
{
char szServiceFunction[MAX_PATH],*pszServiceFunctionName;
@@ -887,15 +887,7 @@ void MraUpdateEmailStatus(LPSTR lpszFrom,SIZE_T dwFromSize,LPSTR lpszSubject,SIZ
BOOL IsUnicodeEnv()
{// Are we running under unicode Miranda core ?
- BOOL bRet=FALSE;
- char szBuff[64]={0};
-
- if (CallService(MS_SYSTEM_GETVERSIONTEXT,SIZEOF(szBuff),(LPARAM)szBuff)==0)
- {
- BuffToLowerCase(szBuff,szBuff,SIZEOF(szBuff));
- bRet=(MemoryFind(0,szBuff,SIZEOF(szBuff),"unicode",7)!=NULL);
- }
-return(bRet);
+ return TRUE;
}
@@ -1166,7 +1158,7 @@ return(bRet);
/////////////////////////////////////////////////////////////////////////////////////////
-//
+//
DWORD MraAPCQueueAdd(PAPCFUNC pfnAPC,PFIFO_MT pffmtAPCQueue,ULONG_PTR dwData)
{
DWORD dwRetErrorCode;
@@ -1352,11 +1344,11 @@ DWORD CreateBlobFromContact(HANDLE hContact,LPWSTR lpwszRequestReason,SIZE_T dwR
{
DWORD dwRetErrorCode;
SIZE_T dwBuffSizeRet=((sizeof(DWORD)*2)+dwRequestReasonSize+5),dwSize;
-
+
if (dwBuffSize>=dwBuffSizeRet)
{
PBYTE pCurBlob=lpbBuff;
-
+
(*(DWORD*)pCurBlob)=0;pCurBlob+=sizeof(DWORD);
(*(DWORD*)pCurBlob)=(DWORD)hContact;pCurBlob+=sizeof(DWORD);
@@ -1380,7 +1372,7 @@ DWORD CreateBlobFromContact(HANDLE hContact,LPWSTR lpwszRequestReason,SIZE_T dwR
//memmove(pCurBlob,lpszRequestReason,dwRequestReasonSize);
(*(pCurBlob+dwSize))=0;
pCurBlob+=(dwSize+1);
-
+
dwBuffSizeRet=(pCurBlob-lpbBuff);
dwRetErrorCode=NO_ERROR;
}else{
@@ -1490,7 +1482,7 @@ int ExtraSetIcon(HANDLE hExtraIcon,HANDLE hContact,HANDLE hImage,int iColumnType
iRet=ExtraIcon_SetIcon(hExtraIcon,hContact,hImage);
}else{
IconExtraColumn iec;
-
+
iec.cbSize=sizeof(iec);
iec.ColumnType=iColumnType;
iec.hImage=((hImage!=NULL)? hImage:INVALID_HANDLE_VALUE);
@@ -1657,25 +1649,25 @@ LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM
WNDPROC OldMessageEditProc=(WNDPROC)GetWindowLongPtr(hwnd,GWLP_USERDATA);
if (msg==WM_CHAR)
- if (GetKeyState(VK_CONTROL)&0x8000)
+ if (GetKeyState(VK_CONTROL)&0x8000)
{
- if(wParam=='\n')
+ if(wParam=='\n')
{
PostMessage(GetParent(hwnd),WM_COMMAND,IDOK,0);
return(0);
}
- if (wParam==1)
+ if (wParam==1)
{// ctrl-a
SendMessage(hwnd,EM_SETSEL,0,-1);
return(0);
}
- if (wParam==23)
+ if (wParam==23)
{// ctrl-w
SendMessage(GetParent(hwnd),WM_CLOSE,0,0);
return(0);
}
}
-
+
if (OldMessageEditProc) lrRet=CallWindowProc(OldMessageEditProc,hwnd,msg,wParam,lParam);
return(lrRet);
@@ -1752,7 +1744,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARA
}
break;
case WM_TIMER:
- if(psxsData->dwCountdown!=-1)
+ if(psxsData->dwCountdown!=-1)
{
WCHAR szBuff[MAX_PATH];
mir_sntprintf(szBuff,SIZEOF(szBuff),L"%s %ld",TranslateW(L"Closing in"),psxsData->dwCountdown);
@@ -1811,7 +1803,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARA
mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%dName",psxsData->dwXStatus);
DB_Mra_SetStringExW(NULL,szValueName,szBuff,dwBuffSize);
DB_Mra_SetStringExW(NULL,DBSETTING_XSTATUSNAME,szBuff,dwBuffSize);
-
+
mi.cbSize=sizeof(mi);
mi.flags=(CMIM_NAME|CMIF_UNICODE);
mi.ptszName=szBuff;
@@ -1933,7 +1925,7 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg,UINT message,WPARAM wPa
mir_sntprintf(wszBuff,SIZEOF(wszBuff),L"%d/%d",dwMessageSize,MICBLOG_STATUS_MAX);
SET_DLG_ITEM_TEXTW(hWndDlg,IDC_STATIC_CHARS_COUNTER,wszBuff);
}
- break;
+ break;
}
break;
case WM_DESTROY:
@@ -2071,7 +2063,7 @@ DWORD FindFile(LPWSTR lpszFolder,DWORD dwFolderLen,LPWSTR lpszFileName,DWORD dwF
}
}
}
-
+
if (prdsiItems) FindClose(prdsiItems[dwRecDeepCurPos].hFind);
dwRecDeepCurPos--;
}while(dwRecDeepCurPos!=-1);
@@ -2135,7 +2127,7 @@ BOOL SetPassDB(LPSTR lpszBuff,SIZE_T dwBuffSize)
#if /*defined (_DEBUG) ||*/ defined (REL_DEB)
-
+
DB_Mra_SetStringExA(NULL,"Pass",lpszBuff,dwBuffSize);
bRet=TRUE;
#else
@@ -2157,11 +2149,11 @@ BOOL SetPassDB(LPSTR lpszBuff,SIZE_T dwBuffSize)
CopyMemoryReverseDWORD(btCryptedPass,btCryptedPass,sizeof(btCryptedPass));
RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
-
+
DB_Mra_SetDword(NULL,"pCryptVer",MRA_PASS_CRYPT_VER);
DB_Mra_WriteContactSettingBlob(NULL,"pCryptData",btRandomData,sizeof(btRandomData));
DB_Mra_WriteContactSettingBlob(NULL,"pCryptPass",btCryptedPass,sizeof(btCryptedPass));
-
+
bRet=TRUE;
}
#endif
@@ -2180,7 +2172,7 @@ BOOL SetPassDB(LPSTR lpszBuff,SIZE_T dwBuffSize)
#if /*defined (_DEBUG) ||*/ defined (REL_DEB)
-
+
DB_Mra_SetStringExA(NULL,"Pass",lpszBuff,dwBuffSize);
bRet=TRUE;
#else
@@ -2203,11 +2195,11 @@ BOOL SetPassDB(LPSTR lpszBuff,SIZE_T dwBuffSize)
CopyMemoryReverseDWORD(btCryptedPass,btCryptedPass,sizeof(btCryptedPass));
RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
-
+
DB_Mra_SetDword(NULL,"pCryptVer",MRA_PASS_CRYPT_VER);
DB_Mra_WriteContactSettingBlob(NULL,"pCryptData",btRandomData,sizeof(btRandomData));
DB_Mra_WriteContactSettingBlob(NULL,"pCryptPass",btCryptedPass,sizeof(btCryptedPass));
-
+
bRet=TRUE;
}
#endif
@@ -2415,8 +2407,7 @@ return(dwRet);
DWORD EncodeXML(LPTSTR lptszMessage,SIZE_T dwMessageSize,LPTSTR lptszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize)
{
DWORD dwRet=ReplaceInBuff(lptszMessage,(dwMessageSize*sizeof(TCHAR)),SIZEOF(lpszXMLTags),(LPVOID*)lpszXMLSymbols,(SIZE_T*)dwXMLSymbolsCount,(LPVOID*)lpszXMLTags,(SIZE_T*)dwXMLTagsCount,lptszMessageConverted,(dwMessageConvertedBuffSize*sizeof(TCHAR)),pdwMessageConvertedSize);
-
+
if (pdwMessageConvertedSize) (*pdwMessageConvertedSize)/=sizeof(TCHAR);
return(dwRet);
}
-
diff --git a/src/core/stdhelp/about.cpp b/src/core/stdhelp/about.cpp
index ff87c595ad..d0ae6ee7f1 100644
--- a/src/core/stdhelp/about.cpp
+++ b/src/core/stdhelp/about.cpp
@@ -2,8 +2,8 @@
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2009 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
+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.
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "commonheaders.h"
-#define STR_VERSION_FORMAT "%s%S%S"
+#define STR_VERSION_FORMAT "%s%S"
INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
@@ -44,26 +44,17 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
SetDlgItemText(hwndDlg, IDC_DEVS, productCopyright);
mir_free(pVerInfo);
}
- { char productVersion[56], *p;
- int isAnsi = 0;
+ {
TCHAR str[64];
- CallService(MS_SYSTEM_GETVERSIONTEXT, SIZEOF(productVersion), (LPARAM)productVersion);
- // Hide Unicode from version text as it is assumed at this point
- p = strstr(productVersion, " Unicode");
- if (p)
- *p = '\0';
- else
- isAnsi = 1;
- mir_sntprintf(str, SIZEOF(str), _T(STR_VERSION_FORMAT), TranslateT("v"), productVersion, isAnsi?" ANSI":"");
- {
- TCHAR oldTitle[256], newTitle[256];
- GetDlgItemText(hwndDlg, IDC_HEADERBAR, oldTitle, SIZEOF(oldTitle));
- mir_sntprintf(newTitle, SIZEOF(newTitle), oldTitle, str);
- SetDlgItemText(hwndDlg, IDC_HEADERBAR, newTitle);
- }
+ mir_sntprintf(str, SIZEOF(str), _T(STR_VERSION_FORMAT), TranslateT("v"), productVersion);
+
+ TCHAR oldTitle[256], newTitle[256];
+ GetDlgItemText(hwndDlg, IDC_HEADERBAR, oldTitle, SIZEOF(oldTitle));
+ mir_sntprintf(newTitle, SIZEOF(newTitle), oldTitle, str);
+ SetDlgItemText(hwndDlg, IDC_HEADERBAR, newTitle);
}
ShowWindow(GetDlgItem(hwndDlg, IDC_CREDITSFILE), SW_HIDE);
- {
+ {
HRSRC hResInfo = FindResource(hInst, MAKEINTRESOURCE(IDR_CREDITS), _T("TEXT"));
DWORD ResSize = SizeofResource(hInst, hResInfo);
HGLOBAL hRes = LoadResource(hInst, hResInfo);
@@ -127,10 +118,10 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
case WM_DESTROY:
Window_FreeIcon_IcoLib(hwndDlg);
- {
+ {
HFONT hFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_VERSION, WM_GETFONT, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_VERSION, WM_SETFONT, SendDlgItemMessage(hwndDlg, IDOK, WM_GETFONT, 0, 0), 0);
- DeleteObject(hFont);
+ DeleteObject(hFont);
}
break;
}