summaryrefslogtreecommitdiff
path: root/plugins/CrashDumper/src/exhndlr.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-09-14 13:08:56 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-09-14 13:08:56 +0000
commit6c2775a7fa796220a8e6c4e6c5e4f27783f4d7f3 (patch)
treeb39bda6512cb8e792b15b869cbf5f8e5b2be7944 /plugins/CrashDumper/src/exhndlr.cpp
parent1227c4bfb5d2fe4f19b0efe43a06a458bfcd0270 (diff)
CrashDumper:
- fails to start in service mode; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@10444 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CrashDumper/src/exhndlr.cpp')
-rw-r--r--plugins/CrashDumper/src/exhndlr.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/plugins/CrashDumper/src/exhndlr.cpp b/plugins/CrashDumper/src/exhndlr.cpp
index c2bc9ce8f5..e110e43eff 100644
--- a/plugins/CrashDumper/src/exhndlr.cpp
+++ b/plugins/CrashDumper/src/exhndlr.cpp
@@ -24,19 +24,18 @@ void RemoveExceptionHandler(void)
int myDebugFilter(unsigned int code, PEXCEPTION_POINTERS ep)
{
- if (code == VcppException(ERROR_SEVERITY_ERROR, ERROR_MOD_NOT_FOUND) ||
- code == VcppException(ERROR_SEVERITY_ERROR, ERROR_PROC_NOT_FOUND))
- {
+ if (code == VcppException(ERROR_SEVERITY_ERROR, ERROR_MOD_NOT_FOUND) ||
+ code == VcppException(ERROR_SEVERITY_ERROR, ERROR_PROC_NOT_FOUND)) {
PDelayLoadInfo dlld = (PDelayLoadInfo)ep->ExceptionRecord->ExceptionInformation[0];
char str[256];
int off = mir_snprintf(str, SIZEOF(str), "dbghelp.dll v.5.0 or later required to provide a crash report\n");
- off += mir_snprintf(str+off, SIZEOF(str)-off, "Missing Module: %s ", dlld->szDll);
+ off += mir_snprintf(str + off, SIZEOF(str) - off, "Missing Module: %s ", dlld->szDll);
if (dlld->dlp.fImportByName)
- mir_snprintf(str+off, SIZEOF(str)-off, "Function: %s ", dlld->dlp.szProcName);
+ mir_snprintf(str + off, SIZEOF(str) - off, "Function: %s ", dlld->dlp.szProcName);
else
- mir_snprintf(str+off, SIZEOF(str)-off, "Ordinal: %x ", dlld->dlp.dwOrdinal);
+ mir_snprintf(str + off, SIZEOF(str) - off, "Ordinal: %x ", dlld->dlp.dwOrdinal);
MessageBoxA(NULL, str, "Miranda Crash Dumper", MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_TOPMOST);
}
@@ -63,7 +62,7 @@ void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify)
}
else
mir_sntprintf(path, MAX_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);
+ 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);
if (hDumpFile != INVALID_HANDLE_VALUE)
@@ -73,7 +72,9 @@ void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify)
TEXT("Miranda Crash Dumper"), MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_TOPMOST);
}
- __except(EXCEPTION_EXECUTE_HANDLER) {}
+ __except (EXCEPTION_EXECUTE_HANDLER)
+ {
+ }
bool empty = GetFileSize(hDumpFile, NULL) == 0;
CloseHandle(hDumpFile);
@@ -88,7 +89,7 @@ void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify)
}
else
mir_sntprintf(path, MAX_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);
+ 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);
@@ -97,7 +98,7 @@ void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify)
if (hDumpFile != INVALID_HANDLE_VALUE)
CreateCrashReport(hDumpFile, exc_ptr, notify ? path : NULL);
}
- __except(myDebugFilter(GetExceptionCode(), GetExceptionInformation())) {}
+ __except (myDebugFilter(GetExceptionCode(), GetExceptionInformation())) {}
bool empty1 = GetFileSize(hDumpFile, NULL) == 0;
CloseHandle(hDumpFile);