summaryrefslogtreecommitdiff
path: root/plugins/CrashDumper/src/dumper.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-10-11 13:19:56 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-10-11 13:19:56 +0000
commit7e67728d3ea7790e4aa7a8197fc458e672922051 (patch)
tree20c77c739f4b225bb64e0564c2895a3b3718b0f4 /plugins/CrashDumper/src/dumper.cpp
parent725c245c57c532658ef0d2a77ea50ff599c40dec (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/dumper.cpp')
-rw-r--r--plugins/CrashDumper/src/dumper.cpp23
1 files changed, 12 insertions, 11 deletions
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"));