summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author(no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10>2010-04-06 00:55:48 +0000
committer(no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10>2010-04-06 00:55:48 +0000
commit03e3e4ebe0fee7bbe8014014b77a21d22cc090a8 (patch)
tree59eb86b2a5252bd336398594b21ff8a6c4252c00
parent92f7a736e44f3d5199e48459daa78b89a0c9f46d (diff)
Fixed translation issue
Removed unneeded/duplicated code (thus shaved few more kb from the dll) git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@496 4f64403b-2f21-0410-a795-97e2b3489a10
-rw-r--r--updater/conf_dialog.cpp12
-rw-r--r--updater/extern.cpp8
-rw-r--r--updater/icons.cpp2
-rw-r--r--updater/options.cpp8
-rw-r--r--updater/resource.h2
-rw-r--r--updater/services.cpp32
-rw-r--r--updater/socket.cpp16
-rw-r--r--updater/updater.cpp4
-rw-r--r--updater/updater.dsp8
-rw-r--r--updater/updater_9.vcproj219
-rw-r--r--updater/utils.cpp52
-rw-r--r--updater/utils.h3
-rw-r--r--updater/xmldata.cpp24
13 files changed, 77 insertions, 313 deletions
diff --git a/updater/conf_dialog.cpp b/updater/conf_dialog.cpp
index 9c6bdba..cbd6887 100644
--- a/updater/conf_dialog.cpp
+++ b/updater/conf_dialog.cpp
@@ -70,23 +70,23 @@ INT_PTR CALLBACK DlgProcConfirm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
lvI.mask = LVIF_TEXT | LVIF_PARAM;// | LVIF_IMAGE;
lvI.iSubItem = 0;
lvI.lParam = (LPARAM)&todo[i];
- lvI.pszText = TranslateTS(temp_str = GetTString(todo[i].update.szComponentName));
+ lvI.pszText = (temp_str = GetTString(todo[i].update.szComponentName));
lvI.iItem = ListView_InsertItem(GetDlgItem(hwndDlg, IDC_LIST_UPDATES), &lvI);
- free(temp_str);
+ mir_free(temp_str);
lvI.mask = LVIF_TEXT;// | LVIF_IMAGE;
lvI.iSubItem = 1;
//lvI.pszText = LPSTR_TEXTCALLBACK; //i->newVersion;
- lvI.pszText = TranslateTS(temp_str = GetTString(((UpdateInternal *)lvI.lParam)->newVersion));
+ lvI.pszText = (temp_str = GetTString(((UpdateInternal *)lvI.lParam)->newVersion));
ListView_SetItem(GetDlgItem(hwndDlg, IDC_LIST_UPDATES), &lvI);
- free(temp_str);
+ mir_free(temp_str);
lvI.iSubItem = 2;
//lvI.pszText = LPSTR_TEXTCALLBACK; //i->newVersion;
- lvI.pszText = TranslateTS(temp_str = GetTString((char *)((UpdateInternal *)lvI.lParam)->update.pbVersion));
+ lvI.pszText = (temp_str = GetTString((char *)((UpdateInternal *)lvI.lParam)->update.pbVersion));
ListView_SetItem(GetDlgItem(hwndDlg, IDC_LIST_UPDATES), &lvI);
- free(temp_str);
+ mir_free(temp_str);
//MessageBox(0, i->newVersion,
//"Version", MB_OK);
//i->update.szComponentName, MB_OK);
diff --git a/updater/extern.cpp b/updater/extern.cpp
index 565ba63..629d1eb 100644
--- a/updater/extern.cpp
+++ b/updater/extern.cpp
@@ -23,7 +23,7 @@ int ExternProcess(bool restart) {
// write data to file for external process to use
HANDLE hDatFile = CreateFile(data_filename, GENERIC_WRITE, FILE_SHARE_WRITE, 0, CREATE_ALWAYS, 0, 0);
if(hDatFile == INVALID_HANDLE_VALUE) {
- //MessageBox(0, Translate("Could not create data file for restart."), Translate("Error"), MB_OK | MB_ICONERROR);
+ //MessageBox(0, TranslateT("Could not create data file for restart."), TranslateT("Error"), MB_OK | MB_ICONERROR);
ShowError(TranslateT("Could not create data file for restart"));
return 1;
}
@@ -88,7 +88,7 @@ int ExternProcess(bool restart) {
/*
if(!CallService(MS_SYSTEM_OKTOEXIT,0,0)) {
DeleteFile(data_filename);
- MessageBox(0, Translate("Miranda's not 'OK TO EXIT'."), Translate("Error"), MB_OK | MB_ICONERROR);
+ MessageBox(0, TranslateT("Miranda's not 'OK TO EXIT'."), TranslateT("Error"), MB_OK | MB_ICONERROR);
return;
}
*/
@@ -454,8 +454,8 @@ void CALLBACK ExternalUpdate(HWND hwnd, HINSTANCE hInstance, LPSTR lpszCmdLine,
#endif
TCHAR szArgs[MAX_PATH], *temp_str;
//wsprintf(szArgs, "\"%s\" \"%s\"", db_path, db_name);
- mir_sntprintf(szArgs, SIZEOF(szArgs), _T("\"%s\" \"%s\""), mir_exe, temp_str = GetTStringACP(db_path)); // includes name, dummy instead of executable?
- free(temp_str);
+ mir_sntprintf(szArgs, SIZEOF(szArgs), _T("\"%s\" \"%s\""), mir_exe, temp_str = mir_a2t(db_path)); // includes name, dummy instead of executable?
+ mir_free(temp_str);
//wsprintf(szArgs, "\"%s\"", db_name);
diff --git a/updater/icons.cpp b/updater/icons.cpp
index a8349c5..9b8c3b5 100644
--- a/updater/icons.cpp
+++ b/updater/icons.cpp
@@ -78,7 +78,7 @@ void InitIcons(void)
for (i = 0; i < sizeof(iconList) / sizeof(IconStruct); ++i)
{
- sid.pszDescription = Translate(iconList[i].szDescr);
+ sid.pszDescription = iconList[i].szDescr;
sid.pszName = iconList[i].szName;
sid.iDefaultIndex = -iconList[i].defIconID;
CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
diff --git a/updater/options.cpp b/updater/options.cpp
index 847a66f..f753997 100644
--- a/updater/options.cpp
+++ b/updater/options.cpp
@@ -17,7 +17,7 @@ void add_restart_menu_item() {
menu.flags = CMIM_ALL;
menu.hIcon = LoadIconEx(I_RSTRT);
- menu.pszName = Translate("Restart");
+ menu.pszName = "Restart";
menu.pszService= MS_UPDATE_MENURESTART;
menu.position = 2000099900;
hMainMenuItemRestart = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&menu);
@@ -31,7 +31,7 @@ void add_update_and_exit_menu_item() {
menu.flags = CMIM_ALL;
menu.hIcon = LoadIconEx(I_CHKUPDEXT);
- menu.pszName = Translate("Update and Exit");
+ menu.pszName = "Update and Exit";
menu.pszService= MS_UPDATE_MENUUPDATEANDEXIT;
menu.position = 2000099901;
hMainMenuItemUpdateAndExit = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&menu);
@@ -62,9 +62,9 @@ static int EnumerateFuncFillList(char *szComponentName, UpdateOptions *update_op
lvI.lParam = (update_options->enabled ? 1 : 0) + (update_options->use_beta ? 2 : 0) + (update_options->fixed ? 4 : 0);
lvI.iSubItem = 0;
- lvI.pszText = TranslateTS(temp_str = GetTString(szComponentName));
+ lvI.pszText = (temp_str = GetTString(szComponentName));
lvI.iItem = ListView_InsertItem(GetDlgItem(hwndDlg, IDC_LST_REGISTERED), &lvI);
- free(temp_str);
+ mir_free(temp_str);
lvI.mask = LVIF_TEXT;
lvI.iSubItem = 1;
diff --git a/updater/resource.h b/updater/resource.h
index d8252f5..35617cc 100644
--- a/updater/resource.h
+++ b/updater/resource.h
@@ -50,12 +50,12 @@
#define IDC_BTN_SELECTDLLS2 1030
#define IDC_BTN_SELECTINV 1030
#define IDC_BTN_SELECTALL 1031
-#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1030
diff --git a/updater/services.cpp b/updater/services.cpp
index 4b232b1..b5c8a88 100644
--- a/updater/services.cpp
+++ b/updater/services.cpp
@@ -63,11 +63,11 @@ bool DownloadUpdates(UpdateList &todo, FilenameMap *map, bool dlls_only) {
}
if(download) {
- mir_sntprintf(msg, SIZEOF(msg), TranslateT("Downloading plugin: %s"), TranslateTS(temp_str = GetTString(todo[index].update.szComponentName)));
- free(temp_str);
+ mir_sntprintf(msg, SIZEOF(msg), TranslateT("Downloading plugin: %s"), (temp_str = GetTString(todo[index].update.szComponentName)));
+ mir_free(temp_str);
} else {
- mir_sntprintf(msg, SIZEOF(msg), TranslateT("Skipping plugin: %s"), TranslateTS(temp_str = GetTString(todo[index].update.szComponentName)));
- free(temp_str);
+ mir_sntprintf(msg, SIZEOF(msg), TranslateT("Skipping plugin: %s"), (temp_str = GetTString(todo[index].update.szComponentName)));
+ mir_free(temp_str);
}
if(!use_popup) {
@@ -227,11 +227,11 @@ void CheckForUpdatesWorker(void *param) {
for(index = 0; index < count; index++) {
if(update_list2[index].update_options.enabled) {
- mir_sntprintf(msg, SIZEOF(msg), TranslateT("Checking plugin: %s"), TranslateTS(temp_str = GetTString(update_list2[index].update.szComponentName)));
- free(temp_str);
+ mir_sntprintf(msg, SIZEOF(msg), TranslateT("Checking plugin: %s"), (temp_str = GetTString(update_list2[index].update.szComponentName)));
+ mir_free(temp_str);
} else {
- mir_sntprintf(msg, SIZEOF(msg), TranslateT("Skipping plugin: %s"), TranslateTS(temp_str = GetTString(update_list2[index].update.szComponentName)));
- free(temp_str);
+ mir_sntprintf(msg, SIZEOF(msg), TranslateT("Skipping plugin: %s"), (temp_str = GetTString(update_list2[index].update.szComponentName)));
+ mir_free(temp_str);
}
if(!use_popup) {
@@ -414,13 +414,13 @@ void SaveUpdateOptions(char *szComponentName, UpdateOptions *update_options) {
INT_PTR SetUpdateOptions(WPARAM wParam, LPARAM lParam) {
char *szComponentName = (char *)wParam;
UpdateOptions *uo = (UpdateOptions *)lParam;
- TCHAR *temp1 = 0, *temp2 = 0;
+ TCHAR *temp1 = 0;
bool found = false;
EnterCriticalSection(&list_cs);
for (int i=0; i<update_list.getCount(); ++i) {
if(strcmp(update_list[i].update.szComponentName, szComponentName) == 0
- || _tcscmp(TranslateTS(temp1 = GetTString(update_list[i].update.szComponentName)), (TCHAR *)szComponentName) == 0) // when set via options, szComponentName is translated and potentially already converted to unicode
+ || _tcscmp(temp1 = GetTString(update_list[i].update.szComponentName), (TCHAR *)szComponentName) == 0) // when set via options, szComponentName is translated and potentially already converted to unicode
{
found = true;
update_list[i].update_options = *uo;
@@ -432,8 +432,7 @@ INT_PTR SetUpdateOptions(WPARAM wParam, LPARAM lParam) {
}
}
LeaveCriticalSection(&list_cs);
- if(temp1) free(temp1);
- if(temp2) free(temp2);
+ mir_free(temp1);
return found ? 0 : 1;
}
@@ -441,13 +440,13 @@ INT_PTR SetUpdateOptions(WPARAM wParam, LPARAM lParam) {
INT_PTR GetUpdateOptions(WPARAM wParam, LPARAM lParam) {
char *szComponentName = (char *)wParam;
UpdateOptions *uo = (UpdateOptions *)lParam;
- TCHAR *temp1 = 0, *temp2 = 0;
+ TCHAR *temp1 = 0;
bool found = false;
EnterCriticalSection(&list_cs);
for (int i=0; i<update_list.getCount(); ++i) {
if(strcmp(update_list[i].update.szComponentName, szComponentName) == 0
- || _tcscmp(TranslateTS(temp1 = GetTString(update_list[i].update.szComponentName)), (TCHAR *)szComponentName) == 0) // when set via options, szComponentName is translated and potentially already converted to unicode
+ || _tcscmp((temp1 = GetTString(update_list[i].update.szComponentName)), (TCHAR *)szComponentName) == 0) // when set via options, szComponentName is translated and potentially already converted to unicode
{
found = true;
*uo = update_list[i].update_options;
@@ -455,8 +454,7 @@ INT_PTR GetUpdateOptions(WPARAM wParam, LPARAM lParam) {
}
}
LeaveCriticalSection(&list_cs);
- if(temp1) free(temp1);
- if(temp2) free(temp2);
+ mir_free(temp1);
return found ? 0 : 1;
}
@@ -750,7 +748,7 @@ int ServicesModulesLoaded(WPARAM wParam, LPARAM lParam) {
menu.flags = CMIM_ALL;
menu.hIcon = LoadIconEx(I_CHKUPD);
- menu.pszName = Translate("Check for updates");
+ menu.pszName = "Check for updates";
menu.pszService= MS_UPDATE_CHECKFORUPDATES;
menu.position = 500010000;
#ifdef MS_CLIST_ADDGROUPMENUITEM
diff --git a/updater/socket.cpp b/updater/socket.cpp
index 61e64bf..2413f7d 100644
--- a/updater/socket.cpp
+++ b/updater/socket.cpp
@@ -43,7 +43,7 @@ bool GetFile(char *url, TCHAR *temp_folder, char *plugin_name, char *version, bo
temp_str = GetTString(version);
_tcscat(save_file, _T("_"));
_tcscat(save_file, temp_str);
- free(temp_str);
+ mir_free(temp_str);
}
// copt extension from url
char *ext = strrchr(url, '.');
@@ -100,11 +100,11 @@ bool GetFile(char *url, TCHAR *temp_folder, char *plugin_name, char *version, bo
if(ext && *ext && strcmp(ext, ".zip") == 0) {
if(!options.no_unzip) {
- char *ans_save_file = GetAString(save_file), *ans_temp_folder = GetAString(temp_folder);
+ char *ans_save_file = mir_t2a(save_file), *ans_temp_folder = mir_t2a(temp_folder);
//MessageBoxA(0, ans_temp_folder, ans_save_file, MB_OK);
unzip_file(ans_save_file, ans_temp_folder);
- free(ans_save_file);
- free(ans_temp_folder);
+ mir_free(ans_save_file);
+ mir_free(ans_temp_folder);
}
if(options.save_zips) {
@@ -170,9 +170,9 @@ bool GetFile(char *url, TCHAR *temp_folder, char *plugin_name, char *version, bo
mir_sntprintf(buff, SIZEOF(buff), TranslateT("Failed to download \"%s\" - Invalid response, code %d"), plugin_name, resp->resultCode);
ShowError(buff);
- char *ts = GetAString(buff);
+ char *ts = mir_t2a(buff);
NLog(ts);
- free(ts);
+ mir_free(ts);
}
CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)resp);
@@ -186,9 +186,9 @@ bool GetFile(char *url, TCHAR *temp_folder, char *plugin_name, char *version, bo
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, err, 0, buff + len, 512 - len, 0);
ShowError(buff);
- char *ts = GetAString(buff);
+ char *ts = mir_t2a(buff);
NLog(ts);
- free(ts);
+ mir_free(ts);
}
}
diff --git a/updater/updater.cpp b/updater/updater.cpp
index d2ee45a..db25aad 100644
--- a/updater/updater.cpp
+++ b/updater/updater.cpp
@@ -67,8 +67,8 @@ void InitNetlib() {
NETLIBUSER nl_user = {0};
nl_user.cbSize = sizeof(nl_user);
nl_user.szSettingsModule = MODULE;
- nl_user.flags = NUF_OUTGOING | NUF_HTTPCONNS;
- nl_user.szDescriptiveName = Translate("Updater connection");
+ nl_user.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
+ nl_user.ptszDescriptiveName = TranslateT("Updater connection");
hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nl_user);
}
diff --git a/updater/updater.dsp b/updater/updater.dsp
index b5baf79..fb19bbb 100644
--- a/updater/updater.dsp
+++ b/updater/updater.dsp
@@ -45,7 +45,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 1
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UPDATER_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O1 /I "../../include" /I "../../../include" /I "zbin" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UPDATER_EXPORTS" /FR /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "../../include" /I "../../../include" /I "zbin" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BZ_NO_STDIO" /D "UPDATER_EXPORTS" /FR /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x809 /d "NDEBUG"
@@ -72,7 +72,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UPDATER_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../../include" /I "zbin" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UPDATER_EXPORTS" /FR /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../../include" /I "zbin" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BZ_NO_STDIO" /D "UPDATER_EXPORTS" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x809 /d "_DEBUG"
@@ -99,7 +99,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 1
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UPDATER_EXPORTS" /FR /YX /FD /c
-# ADD CPP /nologo /MD /W3 /O1 /I "../../../include" /I "." /I "zbin" /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "UNICODE" /FR /YX /FD /c
+# ADD CPP /nologo /MD /W3 /O1 /I "../../../include" /I "." /I "zbin" /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "BZ_NO_STDIO" /D "_UNICODE" /D "UNICODE" /FR /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0xc09 /d "NDEBUG"
@@ -128,7 +128,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UPDATER_EXPORTS" /FR /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../../include" /I "zbin" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UPDATER_EXPORTS" /D "_UNICODE" /D "UNICODE" /FR /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../../include" /I "zbin" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BZ_NO_STDIO" /D "UPDATER_EXPORTS" /D "_UNICODE" /D "UNICODE" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0xc09 /d "_DEBUG"
diff --git a/updater/updater_9.vcproj b/updater/updater_9.vcproj
index 7feb7e6..80262eb 100644
--- a/updater/updater_9.vcproj
+++ b/updater/updater_9.vcproj
@@ -52,7 +52,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="zbin;../../include;..\..\..\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;BZ_NO_STDIO;UPDATER_EXPORTS;UNICODE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderThrough="common.h"
@@ -146,7 +146,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="zbin;../../include;..\..\..\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_CRT_SECURE_NO_WARNINGS"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;BZ_NO_STDIO;UPDATER_EXPORTS;_CRT_SECURE_NO_WARNINGS"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderThrough="common.h"
@@ -242,7 +242,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="zbin;../../include;..\..\..\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;BZ_NO_STDIO;UPDATER_EXPORTS"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderThrough="common.h"
@@ -336,7 +336,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="zbin;../../include;..\..\..\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;BZ_NO_STDIO;UPDATER_EXPORTS"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderThrough="common.h"
@@ -435,7 +435,7 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="2"
AdditionalIncludeDirectories="zbin;../../include;..\..\..\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;BZ_NO_STDIO;UPDATER_EXPORTS;UNICODE"
StringPooling="true"
RuntimeLibrary="2"
BufferSecurityCheck="false"
@@ -537,7 +537,7 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="2"
AdditionalIncludeDirectories="zbin;../../include;..\..\..\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_CRT_SECURE_NO_WARNINGS"
+ PreprocessorDefinitions="BZ_NO_STDIO;WIN32;NDEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_CRT_SECURE_NO_WARNINGS"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
@@ -638,7 +638,7 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="2"
AdditionalIncludeDirectories="zbin;../../include;..\..\..\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;BZ_NO_STDIO;UPDATER_EXPORTS"
StringPooling="true"
RuntimeLibrary="2"
BufferSecurityCheck="false"
@@ -741,7 +741,7 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="2"
AdditionalIncludeDirectories="zbin;../../include;..\..\..\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;BZ_NO_STDIO;UPDATER_EXPORTS"
StringPooling="true"
RuntimeLibrary="2"
BufferSecurityCheck="false"
@@ -2223,7 +2223,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"
BrowseInformation="1"
@@ -2234,7 +2233,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"
BrowseInformation="1"
@@ -2245,7 +2243,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"
BrowseInformation="1"
@@ -2267,7 +2264,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
UsePrecompiledHeader="0"
BrowseInformation="1"
/>
@@ -2277,7 +2273,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
UsePrecompiledHeader="0"
BrowseInformation="1"
/>
@@ -2287,7 +2282,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
UsePrecompiledHeader="0"
BrowseInformation="1"
/>
@@ -2304,92 +2298,8 @@
</FileConfiguration>
</File>
<File
- RelativePath="bzip2-1.0.3\bzlib.c"
+ RelativePath=".\bzip2-1.0.3\bzlib.c"
>
- <FileConfiguration
- Name="Debug Unicode|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
- BasicRuntimeChecks="3"
- UsePrecompiledHeader="0"
- BrowseInformation="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug Unicode|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
- BasicRuntimeChecks="3"
- UsePrecompiledHeader="0"
- BrowseInformation="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
- BasicRuntimeChecks="3"
- UsePrecompiledHeader="0"
- BrowseInformation="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
- BasicRuntimeChecks="3"
- UsePrecompiledHeader="0"
- BrowseInformation="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release Unicode|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
- UsePrecompiledHeader="0"
- BrowseInformation="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release Unicode|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
- UsePrecompiledHeader="0"
- BrowseInformation="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
- UsePrecompiledHeader="0"
- BrowseInformation="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
- UsePrecompiledHeader="0"
- BrowseInformation="1"
- />
- </FileConfiguration>
</File>
<File
RelativePath="bzip2-1.0.3\bzlib.h"
@@ -2400,92 +2310,8 @@
>
</File>
<File
- RelativePath="bzip2-1.0.3\compress.c"
+ RelativePath=".\bzip2-1.0.3\compress.c"
>
- <FileConfiguration
- Name="Debug Unicode|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
- BasicRuntimeChecks="3"
- UsePrecompiledHeader="0"
- BrowseInformation="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug Unicode|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
- BasicRuntimeChecks="3"
- UsePrecompiledHeader="0"
- BrowseInformation="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
- BasicRuntimeChecks="3"
- UsePrecompiledHeader="0"
- BrowseInformation="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
- BasicRuntimeChecks="3"
- UsePrecompiledHeader="0"
- BrowseInformation="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release Unicode|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
- UsePrecompiledHeader="0"
- BrowseInformation="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release Unicode|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
- UsePrecompiledHeader="0"
- BrowseInformation="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
- UsePrecompiledHeader="0"
- BrowseInformation="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
- UsePrecompiledHeader="0"
- BrowseInformation="1"
- />
- </FileConfiguration>
</File>
<File
RelativePath="bzip2-1.0.3\crctable.c"
@@ -2495,7 +2321,7 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
+ PreprocessorDefinitions=" "
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"
BrowseInformation="1"
@@ -2517,7 +2343,7 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
+ PreprocessorDefinitions=" "
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"
BrowseInformation="1"
@@ -2539,7 +2365,7 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
+ PreprocessorDefinitions=" "
UsePrecompiledHeader="0"
BrowseInformation="1"
/>
@@ -2559,7 +2385,7 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
+ PreprocessorDefinitions=" "
UsePrecompiledHeader="0"
BrowseInformation="1"
/>
@@ -2583,7 +2409,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"
BrowseInformation="1"
@@ -2594,7 +2419,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"
BrowseInformation="1"
@@ -2605,7 +2429,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"
BrowseInformation="1"
@@ -2627,7 +2450,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
UsePrecompiledHeader="0"
BrowseInformation="1"
/>
@@ -2637,7 +2459,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
UsePrecompiledHeader="0"
BrowseInformation="1"
/>
@@ -2647,7 +2468,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
UsePrecompiledHeader="0"
BrowseInformation="1"
/>
@@ -2671,7 +2491,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"
BrowseInformation="1"
@@ -2682,7 +2501,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"
BrowseInformation="1"
@@ -2693,7 +2511,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"
BrowseInformation="1"
@@ -2715,7 +2532,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
UsePrecompiledHeader="0"
BrowseInformation="1"
/>
@@ -2725,7 +2541,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
UsePrecompiledHeader="0"
BrowseInformation="1"
/>
@@ -2735,7 +2550,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
UsePrecompiledHeader="0"
BrowseInformation="1"
/>
@@ -2759,7 +2573,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"
BrowseInformation="1"
@@ -2770,7 +2583,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"
BrowseInformation="1"
@@ -2781,7 +2593,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"
BrowseInformation="1"
@@ -2803,7 +2614,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE;_UNICODE;$(NoInherit)"
UsePrecompiledHeader="0"
BrowseInformation="1"
/>
@@ -2823,7 +2633,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_MBCS;$(NoInherit)"
UsePrecompiledHeader="0"
BrowseInformation="1"
/>
diff --git a/updater/utils.cpp b/updater/utils.cpp
index 5be5897..daed5a8 100644
--- a/updater/utils.cpp
+++ b/updater/utils.cpp
@@ -94,53 +94,11 @@ bool CreatePath(const TCHAR *path) {
*/
}
-// must 'free' return val
-TCHAR *GetTString(const char *asc) {
- if(!asc) return 0;
-
-#ifdef _UNICODE
- wchar_t *ret;
- int code_page = CP_ACP;
- if(ServiceExists(MS_LANGPACK_GETCODEPAGE)) code_page = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
- int size = MultiByteToWideChar(code_page, MB_PRECOMPOSED, asc, -1, 0, 0);
- ret = (wchar_t *)malloc(sizeof(wchar_t) * size);
- MultiByteToWideChar(code_page, MB_PRECOMPOSED, asc, -1, ret, size);
- return ret;
-#else
- return _strdup(asc);
-#endif
-}
-
-TCHAR *GetTStringACP(const char *asc) {
- if(!asc) return 0;
-
-#ifdef _UNICODE
- wchar_t *ret;
-
- int size = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, asc, -1, 0, 0);
- ret = (wchar_t *)malloc(sizeof(wchar_t) * size);
- MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, asc, -1, ret, size);
- return ret;
-#else
- return _strdup(asc);
-#endif
-}
-
-char *GetAString(const TCHAR *t) {
- if(!t) return 0;
-
-#ifdef _UNICODE
- char *ret;
-
- int code_page = CP_ACP;
- if(ServiceExists(MS_LANGPACK_GETCODEPAGE)) code_page = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
- int size = WideCharToMultiByte(code_page, 0, t, -1, 0, 0, 0, 0);
- ret = (char *)malloc(size);
- WideCharToMultiByte(code_page, 0, t, -1, ret, size, 0, 0);
- return ret;
-#else
- return _strdup(t);
-#endif
+// must 'mir_free' return val
+TCHAR *GetTString(const char *asc)
+{
+ if (!asc) return NULL;
+ return (TCHAR*)CallService(MS_LANGPACK_PCHARTOTCHAR, 0, (LPARAM)asc);
}
void RemoveFolder(const TCHAR *src_folder) {
diff --git a/updater/utils.h b/updater/utils.h
index 0a46518..28dfa1e 100644
--- a/updater/utils.h
+++ b/updater/utils.h
@@ -12,9 +12,6 @@ bool CreatePath(const TCHAR *path);
// must 'free' return val
TCHAR *GetTString(const char *asc);
// use system default codepage - called from external process where langpack codepage is not (easily) accessible
-TCHAR *GetTStringACP(const char *asc);
-
-char *GetAString(const TCHAR *t);
void RemoveFolder(const TCHAR *src_folder);
diff --git a/updater/xmldata.cpp b/updater/xmldata.cpp
index bffba57..46c4449 100644
--- a/updater/xmldata.cpp
+++ b/updater/xmldata.cpp
@@ -28,7 +28,7 @@ bool OldXMLDataExists(const Category cat) {
_tcscat(xml_data_filename, _T("\\"));
_tcscat(xml_data_filename, ts = GetTString(category_files[cat]));
_tcscat(xml_data_filename, _T(".xml"));
- free(ts);
+ mir_free(ts);
HANDLE hDataFile = CreateFile(xml_data_filename, 0, 0, 0, OPEN_EXISTING, 0, 0);
if(hDataFile != INVALID_HANDLE_VALUE) {
@@ -48,7 +48,7 @@ long OldXMLDataAge(const Category cat) {
_tcscat(xml_data_filename, _T("\\"));
_tcscat(xml_data_filename, ts = GetTString(category_files[cat]));
_tcscat(xml_data_filename, _T(".xml"));
- free(ts);
+ mir_free(ts);
HANDLE hDataFile = CreateFile(xml_data_filename, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
if(hDataFile != INVALID_HANDLE_VALUE) {
@@ -84,7 +84,7 @@ bool LoadOldXMLData(const Category cat, bool update_age) {
_tcscat(xml_data_filename, _T("\\"));
_tcscat(xml_data_filename, ts = GetTString(category_files[cat]));
_tcscat(xml_data_filename, _T(".xml"));
- free(ts);
+ mir_free(ts);
if(pData[cat]) free(pData[cat]);
pData[cat] = 0;
@@ -132,7 +132,7 @@ bool SaveXMLData(const Category cat) {
_tcscat(xml_data_filename, _T("\\"));
_tcscat(xml_data_filename, ts = GetTString(category_files[cat]));
_tcscat(xml_data_filename, _T(".xml"));
- free(ts);
+ mir_free(ts);
if(!CreatePath(options.data_folder)) {
return false;
@@ -152,6 +152,8 @@ bool SaveXMLData(const Category cat) {
return false;
}
+extern "C" void bz_internal_error ( int errcode ){}
+
bool bz2_decompress_xml(char *in_data, int in_data_length, BYTE **pDat, int *data_length) {
const int BLOCKSIZE = 1024 * 100;
@@ -215,7 +217,7 @@ bool bz2_decompress_xml(char *in_data, int in_data_length, BYTE **pDat, int *dat
bool UpdateXMLData(const Category cat, const char *redirect_url /*= 0*/, int recurse_count /*=0*/) {
if(recurse_count > MAX_REDIRECT_RECURSE) {
- PUShowMessage(Translate("Updater: Error getting data - too many redirects"), SM_WARNING);
+ PUShowMessageT(TranslateT("Updater: Error getting data - too many redirects"), SM_WARNING);
return false;
}
@@ -278,13 +280,13 @@ bool UpdateXMLData(const Category cat, const char *redirect_url /*= 0*/, int rec
int len = mir_sntprintf(buff, SIZEOF(buff), TranslateT("Failed to download XML data: "));
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, err, 0, buff + len, 512 - len, 0);
ShowError(buff);
- //MessageBox(0, buff + len, Translate("Updater: Error Downloading XML Data"), MB_OK | MB_ICONWARNING);
- char *ts = GetAString(buff);
+ //MessageBox(0, buff + len, TranslateT("Updater: Error Downloading XML Data"), MB_OK | MB_ICONWARNING);
+ char *ts = mir_t2a(buff);
NLog(ts);
- free(ts);
+ mir_free(ts);
} else {
ShowError(TranslateT("Failed to download XML data - Response is NULL"));
- //MessageBox(0, "Error downloading XML data...\nResponse is NULL"), Translate("Updater Error"), MB_OK | MB_ICONWARNING);
+ //MessageBox(0, TranslateT("Error downloading XML data...\nResponse is NULL"), Translate("Updater Error"), MB_OK | MB_ICONWARNING);
NLog("Failed to download XML data - Response is NULL");
}
return LoadOldXMLData(cat, false);
@@ -322,9 +324,9 @@ bool UpdateXMLData(const Category cat, const char *redirect_url /*= 0*/, int rec
mir_sntprintf(buff, SIZEOF(buff), TranslateT("Failed to download XML data - Invalid response, code %d"), resp->resultCode);
ShowError(buff);
- char *ts = GetAString(buff);
+ char *ts = mir_t2a(buff);
NLog(ts);
- free(ts);
+ mir_free(ts);
CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)resp);
resp = 0;
return LoadOldXMLData(cat, false);