diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-10-11 13:19:56 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-10-11 13:19:56 +0000 |
commit | 7e67728d3ea7790e4aa7a8197fc458e672922051 (patch) | |
tree | 20c77c739f4b225bb64e0564c2895a3b3718b0f4 /plugins/CrashDumper/src | |
parent | 725c245c57c532658ef0d2a77ea50ff599c40dec (diff) |
Crash Dumper:
- Duplicate function removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@15532 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CrashDumper/src')
-rw-r--r-- | plugins/CrashDumper/src/crshdmp.cpp | 2 | ||||
-rw-r--r-- | plugins/CrashDumper/src/dumper.cpp | 23 | ||||
-rw-r--r-- | plugins/CrashDumper/src/exhndlr.cpp | 2 | ||||
-rw-r--r-- | plugins/CrashDumper/src/stdafx.h | 1 | ||||
-rw-r--r-- | plugins/CrashDumper/src/utils.cpp | 20 |
5 files changed, 14 insertions, 34 deletions
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp index 04b84e65e5..c853194cb5 100644 --- a/plugins/CrashDumper/src/crshdmp.cpp +++ b/plugins/CrashDumper/src/crshdmp.cpp @@ -65,7 +65,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SERVIC INT_PTR StoreVersionInfoToFile(WPARAM, LPARAM lParam)
{
- CreateDirectoryTree(VersionInfoFolder);
+ CreateDirectoryTreeT(VersionInfoFolder);
TCHAR path[MAX_PATH];
mir_sntprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
diff --git a/plugins/CrashDumper/src/dumper.cpp b/plugins/CrashDumper/src/dumper.cpp index 21a98c3e62..fa96b34b92 100644 --- a/plugins/CrashDumper/src/dumper.cpp +++ b/plugins/CrashDumper/src/dumper.cpp @@ -62,7 +62,7 @@ BOOL CALLBACK LoadedModules64(LPCSTR, DWORD64 ModuleBase, ULONG ModuleSize, PVOI TCHAR path[MAX_PATH];
GetModuleFileName(hModule, path, MAX_PATH);
- buffer.AppendFormat(TEXT("%s %p - %p"), path, (LPVOID)ModuleBase, (LPVOID)(ModuleBase + ModuleSize));
+ buffer.AppendFormat(TEXT("%s %p - %p"), path, ModuleBase, ModuleBase + ModuleSize);
GetVersionInfo(hModule, buffer);
@@ -137,12 +137,16 @@ void GetLinkedModulesInfo(TCHAR *moduleName, CMString &buffer) IMAGE_DIRECTORY_ENTRY_EXPORT, &tableSize);
if (exportData) {
ULONG* funcAddr = (ULONG*)ImageRvaToVa(nthdrs, dllAddr, exportData->AddressOfNames, NULL);
- for (unsigned i = 0; i < exportData->NumberOfNames && !found; ++i) {
+ for (unsigned i = 0; i < exportData->NumberOfNames; ++i) {
char* funcName = (char*)ImageRvaToVa(nthdrs, dllAddr, funcAddr[i], NULL);
- found = mir_strcmp(funcName, "MirandaPluginInfoEx") == 0 || mir_strcmp(funcName, "MirandaPluginInfo") == 0;
if (mir_strcmp(funcName, "DatabasePluginInfo") == 0) {
buffer.Append(TEXT(" This dll is a Miranda database plugin, another database is active right now\r\n"));
found = true;
+ break;
+ }
+ else if(mir_strcmp(funcName, "MirandaPluginInfoEx") == 0) {
+ found = true;
+ break;
}
}
}
@@ -185,7 +189,7 @@ static void GetPluginsString(CMString& buffer, unsigned& flags) CMString ubuffer;
ListItem* dlllist = NULL;
- static const TCHAR format[] = TEXT("%c %s v.%s%d.%d.%d.%d%s [%s] - %S %s\r\n");
+ static const TCHAR format[] = TEXT("\xa4 %s v.%s%d.%d.%d.%d%s [%s] - %S %s\r\n");
do {
bool loaded = false;
@@ -200,7 +204,7 @@ static void GetPluginsString(CMString& buffer, unsigned& flags) TCHAR timebuf[30] = TEXT("");
GetLastWriteTime(&FindFileData.ftLastWriteTime, timebuf, 30);
- ubuffer.AppendFormat(format, TEXT(' '), FindFileData.cFileName,
+ ubuffer.AppendFormat(format, FindFileData.cFileName,
(flags & VI_FLAG_FORMAT) ? TEXT("[b]") : TEXT(""),
0, 0, 0, 0,
(flags & VI_FLAG_FORMAT) ? TEXT("[/b]") : TEXT(""),
@@ -219,8 +223,7 @@ static void GetPluginsString(CMString& buffer, unsigned& flags) TCHAR timebuf[30] = TEXT("");
GetLastWriteTime(&FindFileData.ftLastWriteTime, timebuf, 30);
- bool ep = (size_t)pi->cbSize > sizeof(PLUGININFOEX);
- const TCHAR *unica = (ep && ((PLUGININFOEX*)pi)->flags & 1) ? TEXT("|Unicode aware|") : TEXT("");
+ const TCHAR *unica = (((PLUGININFOEX*)pi)->flags & UNICODE_AWARE) ? TEXT("|Unicode aware|") : TEXT("");
ListItem* lst = new ListItem;
int v1, v2, v3, v4;
@@ -241,7 +244,7 @@ static void GetPluginsString(CMString& buffer, unsigned& flags) v1 = HIBYTE(HIWORD(ver)), v2 = LOBYTE(HIWORD(ver)), v3 = HIBYTE(LOWORD(ver)), v4 = LOBYTE(LOWORD(ver));
}
- lst->str.AppendFormat(format, ep ? TEXT('\xa4') : TEXT(' '), FindFileData.cFileName,
+ lst->str.AppendFormat(format, FindFileData.cFileName,
(flags & VI_FLAG_FORMAT) ? TEXT("[b]") : TEXT(""),
v1, v2, v3, v4,
(flags & VI_FLAG_FORMAT) ? TEXT("[/b]") : TEXT(""),
@@ -660,9 +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");
- buffer.AppendFormat(formatd,
- (LPVOID)frame.AddrPC.Offset, moduleName, (LPVOID)Module.BaseOfImage,
- lineFileName, Line.LineNumber, name);
+ buffer.AppendFormat(formatd, frame.AddrPC.Offset, moduleName, Module.BaseOfImage,lineFileName, Line.LineNumber, name);
}
SymCleanup(hProcess);
buffer.Append(_T("\r\n"));
diff --git a/plugins/CrashDumper/src/exhndlr.cpp b/plugins/CrashDumper/src/exhndlr.cpp index fcd25a8a0d..c690bdc9d2 100644 --- a/plugins/CrashDumper/src/exhndlr.cpp +++ b/plugins/CrashDumper/src/exhndlr.cpp @@ -51,7 +51,7 @@ void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify) HANDLE hDumpFile = NULL;
GetLocalTime(&st);
- CreateDirectoryTree(CrashLogFolder);
+ CreateDirectoryTreeT(CrashLogFolder);
__try {
if (dtsubfldr) {
diff --git a/plugins/CrashDumper/src/stdafx.h b/plugins/CrashDumper/src/stdafx.h index ed12cc4687..88427dda74 100644 --- a/plugins/CrashDumper/src/stdafx.h +++ b/plugins/CrashDumper/src/stdafx.h @@ -117,7 +117,6 @@ void ReadableExceptionInfo(PEXCEPTION_RECORD excrec, CMString& buffer); void GetLastWriteTime(LPCTSTR fileName, LPTSTR lpszString, DWORD dwSize);
void GetLastWriteTime(FILETIME* ftime, LPTSTR lpszString, DWORD dwSize);
-bool CreateDirectoryTree(LPTSTR szDir);
void StoreStringToClip(CMString& buffer);
void ShowMessage(int type, const TCHAR* format, ...);
bool IsPluginEnabled(TCHAR* filename);
diff --git a/plugins/CrashDumper/src/utils.cpp b/plugins/CrashDumper/src/utils.cpp index 990212c935..4abad60ed6 100644 --- a/plugins/CrashDumper/src/utils.cpp +++ b/plugins/CrashDumper/src/utils.cpp @@ -382,26 +382,6 @@ void GetWow64String(CMString &buffer) buffer.Append(TEXT(" [running inside WOW64]"));
}
-
-bool CreateDirectoryTree(LPTSTR szDir)
-{
- DWORD dwAttr = GetFileAttributes(szDir);
- if (dwAttr != INVALID_FILE_ATTRIBUTES && (dwAttr & FILE_ATTRIBUTE_DIRECTORY))
- return true;
-
- TCHAR* pszSlash = _tcsrchr(szDir, TEXT('\\'));
- if (pszSlash == NULL)
- return false;
-
- *pszSlash = 0;
- bool res = CreateDirectoryTree(szDir);
- *pszSlash = TEXT('\\');
-
- if (res) res = CreateDirectory(szDir, NULL) != 0;
-
- return res;
-}
-
void GetVersionInfo(HMODULE hLib, CMString& buffer)
{
HRSRC hVersion = FindResource(hLib, MAKEINTRESOURCE(VS_VERSION_INFO), RT_VERSION);
|