From 64e1340acd813704c9e9009b0a4e6fc9a3fb5adf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 10 Nov 2013 17:48:31 +0000 Subject: bkstring removed from CrashDumper git-svn-id: http://svn.miranda-ng.org/main/trunk@6857 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/CrashDumper/src/exhndlr.cpp | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'plugins/CrashDumper/src/exhndlr.cpp') diff --git a/plugins/CrashDumper/src/exhndlr.cpp b/plugins/CrashDumper/src/exhndlr.cpp index cf7ceb308d..253ffec924 100644 --- a/plugins/CrashDumper/src/exhndlr.cpp +++ b/plugins/CrashDumper/src/exhndlr.cpp @@ -54,20 +54,17 @@ void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify) GetLocalTime(&st); CreateDirectoryTree(CrashLogFolder); - __try - { - if (dtsubfldr) - { + __try { + if (dtsubfldr) { mir_sntprintf(path, MAX_PATH, TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay); CreateDirectory(path, NULL); mir_sntprintf(path, MAX_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, 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); - } + hDumpFile = CreateFile(path, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); if (hDumpFile != INVALID_HANDLE_VALUE) CreateMiniDump(hDumpFile, exc_ptr); @@ -82,20 +79,17 @@ void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify) CloseHandle(hDumpFile); if (empty) DeleteFile(path); - __try - { - if (dtsubfldr) - { + __try { + if (dtsubfldr) { mir_sntprintf(path, MAX_PATH, TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay); CreateDirectory(path, NULL); mir_sntprintf(path, MAX_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, 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); - } + hDumpFile = CreateFile(path, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); mir_sntprintf(path, MAX_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); @@ -122,8 +116,7 @@ LONG WINAPI myfilter(PEXCEPTION_POINTERS exc_ptr) LONG WINAPI myfilterv(PEXCEPTION_POINTERS exc_ptr) { - if (0xC0000000L <= exc_ptr->ExceptionRecord->ExceptionCode && 0xC0000500L >= exc_ptr->ExceptionRecord->ExceptionCode) - { + if (0xC0000000L <= exc_ptr->ExceptionRecord->ExceptionCode && 0xC0000500L >= exc_ptr->ExceptionRecord->ExceptionCode) { if (exc_ptr == lastptr) return EXCEPTION_EXECUTE_HANDLER; lastptr = exc_ptr; @@ -134,8 +127,7 @@ LONG WINAPI myfilterv(PEXCEPTION_POINTERS exc_ptr) DWORD MirandaThreadFilter(DWORD code, EXCEPTION_POINTERS* info) { - if (info != lastptr) - { + if (info != lastptr) { lastptr = info; myfilterWorker(info, true); } -- cgit v1.2.3