summaryrefslogtreecommitdiff
path: root/plugins/CrashDumper
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-27 14:23:31 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-27 14:23:31 +0000
commit2f261839b60692e33d0e160344d0d636d49c90ba (patch)
tree187921722698b681d29df3f6e60fb18394a5e9d5 /plugins/CrashDumper
parent2e931a0b2780587d85f3902468c935f5adba70c8 (diff)
less TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CrashDumper')
-rw-r--r--plugins/CrashDumper/src/crshdmp.cpp14
-rw-r--r--plugins/CrashDumper/src/dumper.cpp14
-rw-r--r--plugins/CrashDumper/src/exhndlr.cpp14
-rw-r--r--plugins/CrashDumper/src/ui.cpp8
-rw-r--r--plugins/CrashDumper/src/utils.cpp16
5 files changed, 33 insertions, 33 deletions
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp
index 5c96a12456..eec8817037 100644
--- a/plugins/CrashDumper/src/crshdmp.cpp
+++ b/plugins/CrashDumper/src/crshdmp.cpp
@@ -68,7 +68,7 @@ INT_PTR StoreVersionInfoToFile(WPARAM, LPARAM lParam)
CreateDirectoryTreeT(VersionInfoFolder);
wchar_t path[MAX_PATH];
- mir_sntprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
+ mir_snwprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
HANDLE hDumpFile = CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hDumpFile != INVALID_HANDLE_VALUE) {
@@ -103,7 +103,7 @@ INT_PTR UploadVersionInfo(WPARAM, LPARAM lParam)
PrintVersionInfo(buffer);
VerTrnsfr *trn = (VerTrnsfr*)mir_alloc(sizeof(VerTrnsfr));
- trn->buf = mir_utf8encodeT(buffer.c_str());
+ trn->buf = mir_utf8encodeW(buffer.c_str());
trn->autot = lParam == 0xa1;
mir_forkthread(VersionInfoUploadThread, trn);
@@ -133,7 +133,7 @@ INT_PTR GetVersionInfo(WPARAM wParam, LPARAM lParam)
CMString buffer;
PrintVersionInfo(buffer, (unsigned int)wParam);
char **retData = (char **)lParam;
- *retData = mir_utf8encodeT(buffer.c_str());
+ *retData = mir_utf8encodeW(buffer.c_str());
if (*retData)
result = 0; //success
}
@@ -156,10 +156,10 @@ INT_PTR OpenUrl(WPARAM wParam, LPARAM)
INT_PTR CopyLinkToClipboard(WPARAM, LPARAM)
{
- ptrT tmp(db_get_wsa(NULL, PluginName, "Username"));
+ ptrW tmp(db_get_wsa(NULL, PluginName, "Username"));
if (tmp != NULL) {
wchar_t buffer[MAX_PATH];
- mir_sntprintf(buffer, L"http://vi.miranda-ng.org/detail/%s", tmp);
+ mir_snwprintf(buffer, L"http://vi.miranda-ng.org/detail/%s", tmp);
int bufLen = (sizeof(buffer) + 1) * sizeof(wchar_t);
HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, bufLen);
@@ -245,7 +245,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
crs_a2t(vertxt, temp);
if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) {
- replaceStrT(profpath, L"%miranda_userdata%");
+ replaceStrW(profpath, L"%miranda_userdata%");
// Removed because it isn't available on Load()
// hCrashLogFolder = FoldersRegisterCustomPathT(PluginName, LPGEN("Crash Reports"), CrashLogFolder);
@@ -368,7 +368,7 @@ extern "C" int __declspec(dllexport) Load(void)
profname = Utils_ReplaceVarsT(L"%miranda_profilename%.dat");
profpath = Utils_ReplaceVarsT(L"%miranda_userdata%");
if (catchcrashes && !needrestart)
- mir_sntprintf(CrashLogFolder, TEXT("%s\\CrashLog"), profpath);
+ mir_snwprintf(CrashLogFolder, TEXT("%s\\CrashLog"), profpath);
wcsncpy_s(VersionInfoFolder, profpath, _TRUNCATE);
diff --git a/plugins/CrashDumper/src/dumper.cpp b/plugins/CrashDumper/src/dumper.cpp
index 3fa432aa47..7843451951 100644
--- a/plugins/CrashDumper/src/dumper.cpp
+++ b/plugins/CrashDumper/src/dumper.cpp
@@ -178,7 +178,7 @@ static void GetPluginsString(CMString& buffer, unsigned& flags)
LPTSTR fname = wcsrchr(path, TEXT('\\'));
if (fname == NULL) fname = path;
- mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\*.dll"));
+ mir_snwprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\*.dll"));
WIN32_FIND_DATA FindFileData;
HANDLE hFind = FindFirstFile(path, &FindFileData);
@@ -193,7 +193,7 @@ static void GetPluginsString(CMString& buffer, unsigned& flags)
do {
bool loaded = false;
- mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\%s"), FindFileData.cFileName);
+ mir_snwprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\%s"), FindFileData.cFileName);
HMODULE hModule = GetModuleHandle(path);
if (hModule == NULL && servicemode) {
hModule = LoadLibrary(path);
@@ -264,7 +264,7 @@ static void GetPluginsString(CMString& buffer, unsigned& flags)
else
lsttmppv->next = lst;
- if (mir_tstrcmpi(FindFileData.cFileName, TEXT("weather.dll")) == 0)
+ if (mir_wstrcmpi(FindFileData.cFileName, TEXT("weather.dll")) == 0)
flags |= VI_FLAG_WEATHER;
++count;
@@ -357,7 +357,7 @@ static void GetWeatherStrings(CMString& buffer, unsigned flags)
LPTSTR fname = wcsrchr(path, TEXT('\\'));
if (fname == NULL) fname = path;
- mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\weather\\*.ini"));
+ mir_snwprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\weather\\*.ini"));
WIN32_FIND_DATA FindFileData;
HANDLE hFind = FindFirstFile(path, &FindFileData);
@@ -366,7 +366,7 @@ static void GetWeatherStrings(CMString& buffer, unsigned flags)
do {
if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue;
- mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\weather\\%s"), FindFileData.cFileName);
+ mir_snwprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\weather\\%s"), FindFileData.cFileName);
HANDLE hDumpFile = CreateFile(path, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -424,7 +424,7 @@ static void GetIconStrings(CMString& buffer)
LPTSTR fname = wcsrchr(path, TEXT('\\'));
if (fname == NULL) fname = path;
- mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\Icons\\*.*"));
+ mir_snwprintf(fname, MAX_PATH - (fname - path), TEXT("\\Icons\\*.*"));
WIN32_FIND_DATA FindFileData;
HANDLE hFind = FindFirstFile(path, &FindFileData);
@@ -480,7 +480,7 @@ void PrintVersionInfo(CMString& buffer, unsigned flags)
buffer.AppendFormat(TEXT("Build time: %s\r\n"), mirtime);
wchar_t profpn[MAX_PATH];
- mir_sntprintf(profpn, TEXT("%s\\%s"), profpathfull, profname);
+ mir_snwprintf(profpn, TEXT("%s\\%s"), profpathfull, profname);
DATABASELINK *db = FindDatabasePlugin(profpn);
diff --git a/plugins/CrashDumper/src/exhndlr.cpp b/plugins/CrashDumper/src/exhndlr.cpp
index 6fbace54c1..eef812a33a 100644
--- a/plugins/CrashDumper/src/exhndlr.cpp
+++ b/plugins/CrashDumper/src/exhndlr.cpp
@@ -55,13 +55,13 @@ void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify)
__try {
if (dtsubfldr) {
- mir_sntprintf(path, TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay);
+ mir_snwprintf(path, TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay);
CreateDirectory(path, NULL);
- mir_sntprintf(path, TEXT("%s\\%02d.%02d.%02d\\crash%02d%02d%02d%02d%02d%02d.mdmp"), CrashLogFolder,
+ mir_snwprintf(path, TEXT("%s\\%02d.%02d.%02d\\crash%02d%02d%02d%02d%02d%02d.mdmp"), CrashLogFolder,
st.wYear, st.wMonth, st.wDay, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
}
else
- mir_sntprintf(path, TEXT("%s\\crash%02d%02d%02d%02d%02d%02d.mdmp"), CrashLogFolder,
+ mir_snwprintf(path, TEXT("%s\\crash%02d%02d%02d%02d%02d%02d.mdmp"), CrashLogFolder,
st.wYear, st.wMonth, st.wDay, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
hDumpFile = CreateFile(path, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -82,18 +82,18 @@ void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify)
__try {
if (dtsubfldr) {
- mir_sntprintf(path, TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay);
+ mir_snwprintf(path, TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay);
CreateDirectory(path, NULL);
- mir_sntprintf(path, TEXT("%s\\%02d.%02d.%02d\\crash%02d%02d%02d%02d%02d%02d.txt"), CrashLogFolder,
+ mir_snwprintf(path, TEXT("%s\\%02d.%02d.%02d\\crash%02d%02d%02d%02d%02d%02d.txt"), CrashLogFolder,
st.wYear, st.wMonth, st.wDay, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
}
else
- mir_sntprintf(path, TEXT("%s\\crash%02d%02d%02d%02d%02d%02d.txt"), CrashLogFolder,
+ mir_snwprintf(path, TEXT("%s\\crash%02d%02d%02d%02d%02d%02d.txt"), CrashLogFolder,
st.wYear, st.wMonth, st.wDay, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
hDumpFile = CreateFile(path, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
- mir_sntprintf(path, TranslateT("Miranda crashed. Crash report stored in the folder:\n %s\n\n Would you like store it in the clipboard as well?"), CrashLogFolder);
+ mir_snwprintf(path, TranslateT("Miranda crashed. Crash report stored in the folder:\n %s\n\n Would you like store it in the clipboard as well?"), CrashLogFolder);
if (hDumpFile != INVALID_HANDLE_VALUE)
CreateCrashReport(hDumpFile, exc_ptr, notify ? path : NULL);
diff --git a/plugins/CrashDumper/src/ui.cpp b/plugins/CrashDumper/src/ui.cpp
index 14e018aa2f..319740aaa7 100644
--- a/plugins/CrashDumper/src/ui.cpp
+++ b/plugins/CrashDumper/src/ui.cpp
@@ -69,7 +69,7 @@ INT_PTR CALLBACK DlgProcView(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
CHARFORMAT2 chf;
chf.cbSize = sizeof(chf);
SendDlgItemMessage(hwndDlg, IDC_VIEWVERSIONINFO, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM)&chf);
- mir_tstrcpy(chf.szFaceName, TEXT("Courier New"));
+ mir_wstrcpy(chf.szFaceName, TEXT("Courier New"));
SendDlgItemMessage(hwndDlg, IDC_VIEWVERSIONINFO, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&chf);
CMString buffer;
@@ -279,7 +279,7 @@ LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
case 3:
wchar_t path[MAX_PATH];
- mir_sntprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
+ mir_snwprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
ShellExecute(NULL, TEXT("open"), path, NULL, NULL, SW_SHOW);
break;
@@ -301,12 +301,12 @@ void ShowMessage(int type, const wchar_t* format, ...)
va_list va;
va_start(va, format);
- int len = mir_vsntprintf(pi.lptzText, _countof(pi.lptzText) - 1, format, va);
+ int len = mir_vsnwprintf(pi.lptzText, _countof(pi.lptzText) - 1, format, va);
pi.lptzText[len] = 0;
va_end(va);
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- mir_tstrcpy(pi.lptzContactName, TEXT(PluginName));
+ mir_wstrcpy(pi.lptzContactName, TEXT(PluginName));
pi.lchIcon = LoadIconEx(IDI_VI);
pi.PluginWindowProc = DlgProcPopup;
pi.PluginData = (void*)type;
diff --git a/plugins/CrashDumper/src/utils.cpp b/plugins/CrashDumper/src/utils.cpp
index 356bf6a8a1..df32598f4a 100644
--- a/plugins/CrashDumper/src/utils.cpp
+++ b/plugins/CrashDumper/src/utils.cpp
@@ -52,14 +52,14 @@ void GetISO8061Time(SYSTEMTIME *stLocal, LPTSTR lpszString, DWORD dwSize)
if (clsdates) {
GetDateFormat(LOCALE_INVARIANT, 0, stLocal, TEXT("d MMM yyyy"), lpszString, dwSize);
- int dlen = (int)mir_tstrlen(lpszString);
+ int dlen = (int)mir_wstrlen(lpszString);
GetTimeFormat(LOCALE_INVARIANT, 0, stLocal, TEXT(" H:mm:ss"), lpszString + dlen, dwSize - dlen);
}
else {
int offset = GetTZOffset();
// Build a string showing the date and time.
- mir_sntprintf(lpszString, dwSize, TEXT("%d-%02d-%02d %02d:%02d:%02d%+03d%02d"),
+ mir_snwprintf(lpszString, dwSize, TEXT("%d-%02d-%02d %02d:%02d:%02d%+03d%02d"),
stLocal->wYear, stLocal->wMonth, stLocal->wDay,
stLocal->wHour, stLocal->wMinute, stLocal->wSecond,
offset / 60, offset % 60);
@@ -129,13 +129,13 @@ void GetInternetExplorerVersion(CMString &buffer)
if (ieVersion[0] == 0) {
if (iVer[0] == 0)
buffer.Append(TEXT("<not installed>"));
- else if (mir_tstrcmp(iVer, TEXT("100")) == 0)
+ else if (mir_wstrcmp(iVer, TEXT("100")) == 0)
buffer.Append(TEXT("1.0"));
- else if (mir_tstrcmp(iVer, TEXT("101")) == 0)
+ else if (mir_wstrcmp(iVer, TEXT("101")) == 0)
buffer.Append(TEXT("NT"));
- else if (mir_tstrcmp(iVer, TEXT("102")) == 0)
+ else if (mir_wstrcmp(iVer, TEXT("102")) == 0)
buffer.Append(TEXT("2.0"));
- else if (mir_tstrcmp(iVer, TEXT("103")) == 0)
+ else if (mir_wstrcmp(iVer, TEXT("103")) == 0)
buffer.Append(TEXT("3.0"));
}
else buffer.Append(ieVersion);
@@ -175,12 +175,12 @@ void GetProcessorString(CMString &buffer)
if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Hardware\\Description\\System\\CentralProcessor\\0"), 0, KEY_QUERY_VALUE, &hKey)) {
size = _countof(cpuName);
if (RegQueryValueEx(hKey, TEXT("ProcessorNameString"), NULL, NULL, (LPBYTE)cpuName, &size) != ERROR_SUCCESS)
- mir_tstrcpy(cpuName, TEXT("Unknown"));
+ mir_wstrcpy(cpuName, TEXT("Unknown"));
size = _countof(cpuIdent);
if (RegQueryValueEx(hKey, TEXT("Identifier"), NULL, NULL, (LPBYTE)cpuIdent, &size) != ERROR_SUCCESS)
if (RegQueryValueEx(hKey, TEXT("VendorIdentifier"), NULL, NULL, (LPBYTE)cpuIdent, &size) != ERROR_SUCCESS)
- mir_tstrcpy(cpuIdent, TEXT("Unknown"));
+ mir_wstrcpy(cpuIdent, TEXT("Unknown"));
RegCloseKey(hKey);
}