From 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Jul 2016 09:20:25 +0000 Subject: less TCHARs: - TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/CrashDumper/src/dumper.cpp | 68 +++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'plugins/CrashDumper/src/dumper.cpp') diff --git a/plugins/CrashDumper/src/dumper.cpp b/plugins/CrashDumper/src/dumper.cpp index 0ea80781bd..3fa432aa47 100644 --- a/plugins/CrashDumper/src/dumper.cpp +++ b/plugins/CrashDumper/src/dumper.cpp @@ -18,9 +18,9 @@ along with this program. If not, see . #include "stdafx.h" -extern TCHAR* vertxt; -extern TCHAR* profname; -extern TCHAR* profpath; +extern wchar_t* vertxt; +extern wchar_t* profname; +extern wchar_t* profpath; void CreateMiniDump(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr) { @@ -36,8 +36,8 @@ void CreateMiniDump(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr) void WriteBBFile(CMString& buffer, bool hdr) { - static const TCHAR header[] = TEXT("[spoiler=VersionInfo][quote]"); - static const TCHAR footer[] = TEXT("[/quote][/spoiler]"); + static const wchar_t header[] = TEXT("[spoiler=VersionInfo][quote]"); + static const wchar_t footer[] = TEXT("[/quote][/spoiler]"); buffer.Append(hdr ? header : footer); } @@ -59,14 +59,14 @@ BOOL CALLBACK LoadedModules64(LPCSTR, DWORD64 ModuleBase, ULONG ModuleSize, PVOI const HMODULE hModule = (HMODULE)ModuleBase; - TCHAR path[MAX_PATH]; + wchar_t path[MAX_PATH]; GetModuleFileName(hModule, path, MAX_PATH); buffer.AppendFormat(TEXT("%s %p - %p"), path, (void*)ModuleBase, (void*)(ModuleBase + ModuleSize)); GetVersionInfo(hModule, buffer); - TCHAR timebuf[30] = TEXT(""); + wchar_t timebuf[30] = TEXT(""); GetLastWriteTime(path, timebuf, 30); buffer.AppendFormat(TEXT(" [%s]\r\n"), timebuf); @@ -100,7 +100,7 @@ BOOL CALLBACK LoadedModulesFind64(LPCSTR ModuleName, DWORD64 ModuleBase, ULONG M } -void GetLinkedModulesInfo(TCHAR *moduleName, CMString &buffer) +void GetLinkedModulesInfo(wchar_t *moduleName, CMString &buffer) { HANDLE hDllFile = CreateFile(moduleName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hDllFile == INVALID_HANDLE_VALUE) @@ -114,7 +114,7 @@ void GetLinkedModulesInfo(TCHAR *moduleName, CMString &buffer) LPVOID dllAddr = MapViewOfFile(hDllMapping, FILE_MAP_READ, 0, 0, 0); - static const TCHAR format[] = TEXT(" Plugin statically linked to missing module: %S\r\n"); + static const wchar_t format[] = TEXT(" Plugin statically linked to missing module: %S\r\n"); __try { PIMAGE_NT_HEADERS nthdrs = ImageNtHeader(dllAddr); @@ -173,10 +173,10 @@ static void GetPluginsString(CMString& buffer, unsigned& flags) { buffer.AppendFormat(TEXT("Service Mode: %s\r\n"), servicemode ? TEXT("Yes") : TEXT("No")); - TCHAR path[MAX_PATH]; + wchar_t path[MAX_PATH]; GetModuleFileName(NULL, path, MAX_PATH); - LPTSTR fname = _tcsrchr(path, TEXT('\\')); + LPTSTR fname = wcsrchr(path, TEXT('\\')); if (fname == NULL) fname = path; mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\*.dll")); @@ -189,7 +189,7 @@ static void GetPluginsString(CMString& buffer, unsigned& flags) CMString ubuffer; ListItem* dlllist = NULL; - static const TCHAR format[] = TEXT("\xa4 %s v.%s%d.%d.%d.%d%s [%s] - %S %s\r\n"); + static const wchar_t format[] = TEXT("\xa4 %s v.%s%d.%d.%d.%d%s [%s] - %S %s\r\n"); do { bool loaded = false; @@ -201,7 +201,7 @@ static void GetPluginsString(CMString& buffer, unsigned& flags) } if (hModule == NULL) { if ((flags & VI_FLAG_PRNVAR) && IsPluginEnabled(FindFileData.cFileName)) { - TCHAR timebuf[30] = TEXT(""); + wchar_t timebuf[30] = TEXT(""); GetLastWriteTime(&FindFileData.ftLastWriteTime, timebuf, 30); ubuffer.AppendFormat(format, FindFileData.cFileName, @@ -220,10 +220,10 @@ static void GetPluginsString(CMString& buffer, unsigned& flags) PLUGININFOEX* pi = GetMirInfo(hModule); if (pi != NULL) { - TCHAR timebuf[30] = TEXT(""); + wchar_t timebuf[30] = TEXT(""); GetLastWriteTime(&FindFileData.ftLastWriteTime, timebuf, 30); - const TCHAR *unica = !(((PLUGININFOEX*)pi)->flags & UNICODE_AWARE) ? TEXT("|ANSI|") : TEXT(""); + const wchar_t *unica = !(((PLUGININFOEX*)pi)->flags & UNICODE_AWARE) ? TEXT("|ANSI|") : TEXT(""); ListItem* lst = new ListItem; int v1, v2, v3, v4; @@ -345,17 +345,17 @@ static void GetProtocolStrings(CMString& buffer) for (i = 0; i < protoCountMy; i++) buffer.AppendFormat(TEXT("%-24s %d - Enabled %d - Disabled %sLoaded\r\n"), - (TCHAR*)_A2T(protoListMy[i]), protos[i].countse, + (wchar_t*)_A2T(protoListMy[i]), protos[i].countse, protos[i].countsd, protos[i].nloaded ? L"Not " : L""); } static void GetWeatherStrings(CMString& buffer, unsigned flags) { - TCHAR path[MAX_PATH]; + wchar_t path[MAX_PATH]; GetModuleFileName(NULL, path, MAX_PATH); - LPTSTR fname = _tcsrchr(path, TEXT('\\')); + LPTSTR fname = wcsrchr(path, TEXT('\\')); if (fname == NULL) fname = path; mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\weather\\*.ini")); @@ -399,11 +399,11 @@ static void GetWeatherStrings(CMString& buffer, unsigned flags) id += 5; } - TCHAR timebuf[30] = TEXT(""); + wchar_t timebuf[30] = TEXT(""); GetLastWriteTime(&FindFileData.ftLastWriteTime, timebuf, 30); - static const TCHAR format[] = TEXT(" %s v.%s%S%s [%s] - %S\r\n"); + static const wchar_t format[] = TEXT(" %s v.%s%S%s [%s] - %S\r\n"); buffer.AppendFormat(format, FindFileData.cFileName, (flags & VI_FLAG_FORMAT) ? TEXT("[b]") : TEXT(""), @@ -419,10 +419,10 @@ static void GetWeatherStrings(CMString& buffer, unsigned flags) static void GetIconStrings(CMString& buffer) { - TCHAR path[MAX_PATH]; + wchar_t path[MAX_PATH]; GetModuleFileName(NULL, path, MAX_PATH); - LPTSTR fname = _tcsrchr(path, TEXT('\\')); + LPTSTR fname = wcsrchr(path, TEXT('\\')); if (fname == NULL) fname = path; mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\Icons\\*.*")); @@ -433,7 +433,7 @@ static void GetIconStrings(CMString& buffer) do { if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; - TCHAR timebuf[30] = TEXT(""); + wchar_t timebuf[30] = TEXT(""); GetLastWriteTime(&FindFileData.ftLastWriteTime, timebuf, 30); buffer.AppendFormat(TEXT(" %s [%s]\r\n"), FindFileData.cFileName, timebuf); @@ -450,7 +450,7 @@ void PrintVersionInfo(CMString& buffer, unsigned flags) GetFreeMemoryString(buffer); buffer.Append(L"\r\n"); - TCHAR tszOsVer[200]; + wchar_t tszOsVer[200]; GetOSDisplayString(tszOsVer, _countof(tszOsVer)); buffer.Append(tszOsVer); buffer.Append(L"\r\n"); @@ -464,7 +464,7 @@ void PrintVersionInfo(CMString& buffer, unsigned flags) GetLanguageString(buffer); buffer.Append(L"\r\n"); - TCHAR *profpathfull = Utils_ReplaceVarsT(profpath); + wchar_t *profpathfull = Utils_ReplaceVarsT(profpath); if (flags & VI_FLAG_PRNVAR) { GetFreeDiskString(profpathfull, buffer); buffer.Append(L"\r\n"); @@ -474,12 +474,12 @@ void PrintVersionInfo(CMString& buffer, unsigned flags) GetWow64String(buffer); buffer.Append(L"\r\n"); - TCHAR path[MAX_PATH], mirtime[30]; + wchar_t path[MAX_PATH], mirtime[30]; GetModuleFileName(NULL, path, MAX_PATH); GetLastWriteTime(path, mirtime, 30); buffer.AppendFormat(TEXT("Build time: %s\r\n"), mirtime); - TCHAR profpn[MAX_PATH]; + wchar_t profpn[MAX_PATH]; mir_sntprintf(profpn, TEXT("%s\\%s"), profpathfull, profname); DATABASELINK *db = FindDatabasePlugin(profpn); @@ -505,8 +505,8 @@ void PrintVersionInfo(CMString& buffer, unsigned flags) GetLanguagePackString(buffer); buffer.Append(L"\r\n"); - // buffer.AppendFormat(TEXT("Nightly: %s\r\n"), _tcsstr(vertxt, TEXT("alpha")) ? TEXT("Yes") : TEXT("No")); - // buffer.AppendFormat(TEXT("Unicode: %s\r\n"), _tcsstr(vertxt, TEXT("Unicode")) ? TEXT("Yes") : TEXT("No")); + // buffer.AppendFormat(TEXT("Nightly: %s\r\n"), wcsstr(vertxt, TEXT("alpha")) ? TEXT("Yes") : TEXT("No")); + // buffer.AppendFormat(TEXT("Unicode: %s\r\n"), wcsstr(vertxt, TEXT("Unicode")) ? TEXT("Yes") : TEXT("No")); GetPluginsString(buffer, flags); @@ -541,7 +541,7 @@ void PrintVersionInfo(CMString& buffer, unsigned flags) } -void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const TCHAR* msg) +void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const wchar_t* msg) { if (exc_ptr->ContextRecord == NULL || (exc_ptr->ContextRecord->ContextFlags & CONTEXT_CONTROL) == 0) return; @@ -573,7 +573,7 @@ void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const TCHA const PLUGININFOEX *pluginInfoEx = GetPluginInfoEx(); - TCHAR curtime[30]; + wchar_t curtime[30]; GetISO8061Time(NULL, curtime, 30); CMString buffer; @@ -596,7 +596,7 @@ void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const TCHA buffer.Append(TEXT("\r\nStack Trace:\r\n---------------------------------------------------------------\r\n")); for (int i = 81; --i;) { - char symbuf[sizeof(IMAGEHLP_SYMBOL64) + MAX_SYM_NAME * sizeof(TCHAR) + 4] = { 0 }; + char symbuf[sizeof(IMAGEHLP_SYMBOL64) + MAX_SYM_NAME * sizeof(wchar_t) + 4] = { 0 }; PIMAGEHLP_SYMBOL64 pSym = (PIMAGEHLP_SYMBOL64)symbuf; pSym->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64); pSym->MaxNameLength = MAX_SYM_NAME; @@ -651,7 +651,7 @@ void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const TCHA HMODULE hModule = (HMODULE)Module.BaseOfImage; PLUGININFOEX *pi = GetMirInfo(hModule); if (pi != NULL) { - static const TCHAR formatc[] = TEXT("\r\nLikely cause of the crash plugin: %S\r\n\r\n"); + static const wchar_t formatc[] = TEXT("\r\nLikely cause of the crash plugin: %S\r\n\r\n"); if (pi->shortName) { CMString crashcause; @@ -663,7 +663,7 @@ void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const TCHA } - static const TCHAR formatd[] = TEXT("%p (%S %p): %S (%d): %S\r\n"); + static const wchar_t formatd[] = TEXT("%p (%S %p): %S (%d): %S\r\n"); buffer.AppendFormat(formatd, (void*)frame.AddrPC.Offset, moduleName, (void*)Module.BaseOfImage,lineFileName, Line.LineNumber, name); } -- cgit v1.2.3